ahgamut / superconfigure

wrap autotools configure scripts to build with Cosmopolitan Libc
The Unlicense
159 stars 22 forks source link

WIP: Update emacs to 29.1 #6

Closed alexpdp7 closed 8 months ago

alexpdp7 commented 8 months ago

This does not work, but it updates a bit some of the patches required to build Emacs. I have no idea what the errors are about- maybe stuff that is not yet in Cosmopolitan? (That would explain why they are not shipping the latest Emacs, I guess.)

Just putting this somewhere public in case someone works on it.

alexpdp7 commented 8 months ago

Oh https://github.com/jart/cosmopolitan/commit/5e8c928f1a37349a8c72f0b6aae5e535eace3f41 ...

ahgamut commented 8 months ago

I am yet to understand how Cosmopolitan implements those functions, I'd prefer to wait before adding them to the build.

For now, we can merge your PR if you can avoid the build errors: update the minimal.diff to change out HAVE_DLOPEN to HAVE_DLOPEN0 in Emacs' config.h.in, just like how we currently have HAVE_FIONREAD0. (similarly for dlsym)

alexpdp7 commented 8 months ago

OK, just force-pushed a change. There's no HAVE_DLOPEN- but I think HAVE_MODULES is the thing. I'll go to sleep now, so I don't know if the following build will do the trick:

https://github.com/alexpdp7/superconfigure/actions/runs/6757619286/job/18368348415

Thanks for the hint! I really don't know what I'm doing.

alexpdp7 commented 8 months ago

Ah, something else broke. Don't worry too much, I can live without this. I'll poke a bit tomorrow, but you don't have to spend time on this.

ahgamut commented 8 months ago

Oh, I added the modules thing recently because I thought it would speed things up. Hmm, let me take a look.

alexpdp7 commented 8 months ago

The last builds without modules succeeded!

ahgamut commented 8 months ago

Nice! I have an issue getting it to build locally, I'll merge the PR once that issue is resolved. (Edit: aarch64 build has some errors.)

alexpdp7 commented 8 months ago

Excellent. Let me know if I can be of any help, although I'm really a noob (I'm relying on GitHub Actions to build, because this is scary to me :).

Two updates:

Warning: arch-dependent data dir '/zip/x86_64/emacs/29.1/x86_64-pc-linux-gnu/': ENOENT/2/No such file or directory

when starting Emacs.

edit: https://github.com/alexpdp7/superconfigure/commit/b7529ee555d701429feda951becd663d4562b9fe adds emacsclient https://github.com/alexpdp7/superconfigure/actions/runs/6760777668/job/18374920572.

I think I now can use this, thank you so much!

ahgamut commented 8 months ago

Warning: arch-dependent data dir '/zip/x86_64/emacs/29.1/x86_64-pc-linux-gnu/': ENOENT/2/No such file or directory

This warning means Emacs will start up slower, because it uses emacs.pdmp to speed up start times. I'm seeing a similar issue on the aarch64 build, and I'm not sure where the difference is.

If it works, we can add emacsclient as part of the superconfigure releases also.

alexpdp7 commented 8 months ago

I've been using emacs and emacsclient this morning, updating my Emacs config with some niceties in 29.1, and it seems to work fine.

So I think we want two changes:

Do you prefer one PR (with two commits) or two separate PRs?

ahgamut commented 8 months ago

One PR should be enough. Can you confirm that the warning does not appear?

alexpdp7 commented 8 months ago

No, I'm seeing the warning. In any case, I'll update this PR.

ahgamut commented 8 months ago

Hey, I'm sorry but I can't get emacs-29.1 to build and work properly on aarch64. I've mentioned you in a recent commit that adds emacsclient to the emacs build.

Thank you for the PR! I'm going to close it for now while I try to figure where the build issue is. I'd be happy to add emacs-29.2 or a later version if you submit a PR (or if I fix the build issue on my end, I'll reopen this and merge it.)

alexpdp7 commented 8 months ago

No worries, I have my binary now. I have rebased the 29.1 update on top of your main branch. I think it builds:

https://github.com/alexpdp7/superconfigure/actions/runs/6763795027/job/18381335056

, I see some issues, but apparently unrelated to Emacs; one is the "git core" stuff you pushed, and the other is for berry? Not sure if llvm will finish building successfully, but my GH Actions build seems to say Emacs is OK?

ahgamut commented 8 months ago

can you post the output of unzip -vl emacs | grep -v share here? The issue I was running into was that aarch64 part doesn't have the .pdmp file with the right fingerprint.

I think I fixed the git-core thing, will look into the berry error.

alexpdp7 commented 8 months ago
$ wget https://github.com/alexpdp7/superconfigure/releases/download/emacs_29.1/editor.zip
$ unzip editor.zip 
$ unzip -vl bin/emacs | grep -v share
Archive:  bin/emacs
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
  458752  Defl:N   166592  64% 07-29-2023 00:00 2e659503  .symtab.amd64
  458752  Defl:N   151111  67% 07-29-2023 00:00 fcab6443  .symtab.arm64
       0  Stored        0   0% 03-17-2022 07:00 00000000  .cosmo
11527560  Defl:N  2786836  76% 11-05-2023 22:37 d99a7e4c  x86_64/emacs/29.1/x86_64-linux-gnu/emacs-4ae1ae7bbf15bc2d65f8de18afacf78af040ff575480c3d6428cd101437de87c.pdmp
11507768  Defl:N  2782704  76% 11-05-2023 22:37 745a50e3  aarch64/emacs/29.1/aarch64-linux-gnu/emacs-65f3e7a727584e3d7caa5f65e51ddd68355741c93936ce79923b0c81f36a380c.pdmp
--------          -------  ---                            -------
104756108         30508483  71%                            4864 files
ahgamut commented 8 months ago

Huh interesting, I was always getting a emacs-.pdmp for the aarch64 build.