Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add emacs 26.1 #3352

Closed
wants to merge 5 commits into from
Closed

Conversation

timvisher
Copy link

@timvisher timvisher commented Jun 18, 2018

Problems

  • Though I am depending on ncurses, I get an error during the build.
    Some variable appears to not be being set to allow emacs to know where
    to find libncurses.so.6

    ./temacs --batch  --load loadup bootstrap
    ./temacs: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
    

This feels like something I'm doing wrong here rather than something
that I'm not understanding about the emacs build process.

Motivation: Adding emacs 26.1, need help with cross-cc tooling.

Checklist

  • [] Build rule all-supported completed successfully
  • [] Package upgrade completed successfully
  • [] New installation of package completed successfully

@timvisher
Copy link
Author

ping :)

@Safihre
Copy link
Contributor

Safihre commented Jul 9, 2018

After it fails, did you try to find libncurses.so.6 file on your system in the spksrc folder after it stops? You probably need to somehow tell it where to look for linking.
I'm not a true expert on this myself, but managed by tweaking some of the FLAGS or command-line parameters.

Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. My understanding is that prefix value is inconsistent in configure args

cross/emacs/Makefile Outdated Show resolved Hide resolved
spk/emacs/Makefile Outdated Show resolved Hide resolved
spk/emacs/Makefile Outdated Show resolved Hide resolved
spk/emacs/Makefile Outdated Show resolved Hide resolved
@timvisher
Copy link
Author

I applied all the changes you asked for. Sadly it didn't resolve my problems. FWIW, it appears that emacs is maybe using a non-standard method of determining where to look for ncurses, but I've been unable to locate any instructions on libncurses specifically regarding emacs builds.

I've picked apart the configure run command to look for potential errors in the LDFLAGS variable but it all looks good to me and the directory it mentions indeed contains libncurses.so.6.

I've reached out for help on the mailing list so maybe someone there will be able to help me out.

@timvisher
Copy link
Author

Someone got back to me on the emacs list. They think this has a somewhat dubious chance of success unfortunately. But if there's anything in their message that you can speak to please do. :)

@timvisher
Copy link
Author

Got some news! I was able to get the temacs step to run by hand using the advice that Noam gave me on the mailing list. Can you give me any ideas how I could work this into the spksrc build process?

vagrant@debian-8:~/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/src$ LD_LIBRARY_PATH=../../install/var/packages/emacs/target/lib/ ./temacs --batch --load loadup
bootstrap
Loading loadup.el (source)...
Using load-path (/home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/lisp /home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/lisp/emacs-lisp /home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/lisp/progmodes /home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/lisp/language /home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/lisp/international /home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/lisp/textmodes /home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/emacs-26.1/lisp/vc)
Loading emacs-lisp/byte-run...
…
Finding pointers to doc strings...done
Dumping under the name emacs
87479 pure bytes used

@timvisher
Copy link
Author

timvisher commented Aug 21, 2018

This also made it all the way to the stripping step.

vagrant@debian-8:~/spksrc/spk/emacs$ LD_LIBRARY_PATH=$PWD/work-apollolake-6.1/install/var/packages/emacs/target/lib/ make arch-apollolake
…
===>  Stripping binaries and libraries of emacs
Stripping bin/asn1Coding... ok
Stripping bin/asn1Decoding... ok
Stripping bin/asn1Parser... ok
Stripping bin/captoinfo... ok
Stripping bin/certtool... ok
Stripping bin/clear... ok
Stripping bin/emacs... chmod: cannot operate on dangling symlink ‘/home/vagrant/spksrc/spk/emacs/work-apollolake-6.1/staging/bin/emacs’
../../mk/spksrc.strip.mk:49: recipe for target 'strip_target' failed
make[1]: *** [strip_target] Error 1
make[1]: Leaving directory '/home/vagrant/spksrc/spk/emacs'
../../mk/spksrc.spk.mk:451: recipe for target 'arch-apollolake' failed
make: [arch-apollolake] Error 2 (ignored)

@@ -0,0 +1 @@
bin:bin/emacs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should include here all files required to be packaged with proper "type": https://github.com/SynoCommunity/spksrc/wiki/PLIST-files
So "lnk" has to be used for bin/emacs

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will give that a try. Any ideas on the LD_LIBRARY_PATH problem?

@timvisher
Copy link
Author

timvisher commented Aug 27, 2018

With that change in place I was able to run the following without error on a clean tree.

vagrant@debian-8:~/spksrc/spk/emacs$ LD_LIBRARY_PATH=$PWD/work-apollolake-6.1/install/var/packages/emacs/target/lib/ make arch-apollolake

I'm unsure exactly what I need to do to verify that emacs can launch cleanly though, and I'm still not sure how to configure LD_LIBRARY_PATH correctly.

Still: progress! Huzzah!

@ymartin59
Copy link
Contributor

You have to include required libraries or other resources in PLIST file so everything is embedded in package.

It is expected you cannot run binary "as is" because dynamic linkage expects some specific location you may inspect with ldd.

@timvisher
Copy link
Author

I added

lnk:lib/libncurses.so
lnk:lib/libncurses.so.6
lib:lib/libncurses.so.6.1

to the changeset and ran:

vagrant@debian-8:~/spksrc/spk/emacs$ make arch-apollolake

and failed again at the temacs step.

And again, make clean then

vagrant@debian-8:~/spksrc/spk/emacs$ LD_LIBRARY_PATH=$PWD/work-apollolake-6.1/install/var/packages/emacs/target/lib/ make arch-apollolake

worked. Any thoughts on how to inform spksrc that LD_LIBRARY_PATH needs to be set for this build to include the target lib dir or similar?

@timvisher
Copy link
Author

Ping. :)

1 similar comment
@timvisher
Copy link
Author

Ping. :)

@timvisher
Copy link
Author

Any new thoughts here?

@m4tt075
Copy link
Contributor

m4tt075 commented Dec 5, 2018

@timvisher Just looked into this, trying to help. Unfortunately, I've not been able to find a quick fix either. This does not mean anything. Others might be able to help you. In any case, I found some insights that cross-compilation of emacs might not be straight-forward in the answer linked here:
https://stackoverflow.com/questions/46746976/how-to-cross-compile-emacs-for-ios
Maybe(!), there is is way building emacs natively first (like for the mono package for instance), but frankly, not sure it is worth the effort, if you can use nano instead.

@timvisher
Copy link
Author

@m4tt075 Thanks for trying to help! In this instance I have basically no interest in emacs as an editor and much interest in emacs as an IRC client. :)

nano is fine for a readline based editor, as you pointed out, and I really don't want to take the plunge into irssi.

@m4tt075
Copy link
Contributor

m4tt075 commented Dec 5, 2018

@timvisher Ah, ok. Interesting. And znc?

@timvisher
Copy link
Author

@m4tt075 Yeah. I just really like my emacs set up. :)

https://xkcd.com/1782/

@m4tt075
Copy link
Contributor

m4tt075 commented Dec 6, 2018

@timvisher Ahhh, that is YOU! LOL
Very well. You have my empathy! Good luck with your package. Maybe someone else can step in...

@ymartin59
Copy link
Contributor

@timvisher Please configure your Git client - your commits' author is "vagrant@debian-8.10-amd64" at the moment

@ymartin59
Copy link
Contributor

I have found out what is wrong. After emacs binary is cross-compiled, build process goes on compiling lisp thanks to temacs binary - which may not be runnable on compile system (if for another architecture like ARM).
My option is that lisp compilation has to be postponed to package postinstallation where temacs binary is runnable - the same way Python compiles its libaries https://github.com/SynoCommunity/spksrc/blob/master/spk/python3/src/service-setup.sh#L18

@ymartin59
Copy link
Contributor

ymartin59 commented Dec 8, 2018

References:

So there is chance a package can be created "easily" for x64 platforms but other architecture would require to tweak Emacs build process.

@ymartin59
Copy link
Contributor

Even try to go further building x64 for amd64 only adding export LD_LIBRARY_PATH=/spksrc/spk/emacs/work-x64-5.2/install/var/packages/emacs/target/lib/
but then "dumping" complains:

Dumping under the name emacs
**************************************************
Warning: Your system has a gap between BSS and the
heap (12297400 bytes).  This usually means that exec-shield
or something similar is in effect.  The dump may
fail because of this.  See the section about
exec-shield in etc/PROBLEMS for more information.
**************************************************

Because building in Docker context if I guess right.

vagrant and others added 4 commits October 5, 2020 14:19
Problems
--------

- Though I am depending on ncurses, I get an [error during the build][].
  Some variable appears to not be being set to allow emacs to know where
  to find libncurses.so.6

  ```
  ./temacs --batch  --load loadup bootstrap
  ./temacs: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
  ```

This feels like something I'm doing wrong here rather than something
that I'm not understanding about the emacs build process.
- update emacs
- include all binaries in PLIST
- use SPK_COMMANDS variable (avoid service-setup.sh)
- use cross/ncursesw to fix error with ncurses
- TODO: build tools for host to fix build for cross compiled packages
@hgy59
Copy link
Contributor

hgy59 commented Jul 13, 2023

closing due to lack of support for cross compilation (see https://stackoverflow.com/questions/46746976/how-to-cross-compile-emacs-for-ios)

@hgy59 hgy59 closed this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants