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
ECL does not fully recover from relocation #11359
Comments
comment:1
One problem (perhaps the only one?) is that ECL uses the C compiler for compiling lisp (much like cython) and gives it include paths and library paths that it found out upon configuration.
There is a slight problem that the paths also end up in other variables (perhaps because of the way that sage calls configure when configuring ECL?):
Since it is a bit unsanitary to have references to old locations lying around (one might link to wrong versions of libraries if the old location still exists!), we should probably strip those variables as well. Possible solutions:
|
comment:2
Confirmed! This seems to be indeed the only problem. I did the following in
after which rebuilding maxima succeeds in a relocated position. Note that this piece of code does not scrub c::cc-flags or c::ld-flags yet. The definitions for the default values of these variables seem to live in |
comment:3
The dirty
but we are adding paths there, not flags! It needs the include path to find the boehm-gc headers, but our library search paths should already be set up. Can we instead just do
If the library really needs to be mentioned here, perhaps also a
but I think we can leave that one out. With this I get an ECL where we obtain
so no paths in the flags variables anymore! That just leaves figuring out where best to change the values of the ecl-...-directory variables. |
comment:4
The following two fixes resolve the issues Cleaning paths from ..-flags variablesIn
by
(web documentation indicates that Sun Studio and IBM compilers also support this variable, so although it's not POSIX (neither is CPPFLAGS), it doesn't seem to be GNU exclusive.) Making initialization of ecl-...-directory variables runtimePatch
are replaced by
|
comment:5
Avoiding patching ECLThe role of
before the compiler package is loaded, our values will persist. So, if one finds another file of lisp instructions that are guaranteed to be executed upon ECL startup ( |
comment:6
So do we have to do two things here? Reworking spkg-install and the relocation script or just one of them is enough? And then at what stage? I am ready to cut a new ecl spkg for 4.7.1 if needed. I could take the opportunity to update maxima to 5.24.0 at the same time. |
comment:7
Replying to @kiwifb:
Yes, that and patch ECL.
No changes to relocation script required. The patch to ECL means that the default values for the So both changes are necessary and both are to the ecl spkg and both take effect at ECL build-time (well, the patch of course also changes ECL's runtime behaviour. Since a large part of building ECL consists of ECL compiling itself, the two overlap) (the comment about avoiding patching ECL is just recording possible avenues someone might pursue if they feel really reluctant to patch ECL) |
comment:8
I am for the less intrusive option but I am also pragmatic if it is far more practical to patch ecl itself. |
comment:9
Actually, for sage/libs/ecl.pyx it's not so much of a problem, since our initialization of ecllib involves sending some instructions there anyway, so we could just add the For fixing the behaviour of the ECL executable I haven't actually found a solution other than wrapping it with a shell script, which really does add considerable overhead. Patching is definitely the cleaner solution, but will likely be with us in perpetuity, with all the extra maintenance of rebasing the patch with any ECL upgrade. |
comment:10
OK. I am putting cutting a patched ecl according to your instruction on my TODO list for the week starting tomorrow. Like I said I'll probably cut a new maxima as well only |
comment:11
Avoiding patching ECL in a future releaseThe development version of ECL has two configuration options that will allow avoiding patching ECL in the future. We'll be able to make a file
and then add the following options to ECL's configure:
This option is not available in 11.1.1 yet. |
comment:12
Replying to @nbruin:
Should we delay making a new spkg until it is released or do you think |
comment:13
Replying to @kiwifb:
That depends on how urgently people think this needs fixing. Given that in practice, it only affects people wanting to build maxima on a moved Sage install and that they have a reasonable workaround of rebuilding ecl first (which builds quickly), I'd say this can wait. But if you're going to make a new ECL package anyway, I'd say patch the flaw, or at least the CCFLAGS thing. |
comment:14
I am not in a particular hurry as I have other things I'd like to do. So unless there is pressure to do so. I'll wait for the next ecl. |
This comment has been minimized.
This comment has been minimized.
Author: Jeroen Demeyer |
comment:16
Attachment: ecl-12.12.1.p4.diff.gz Whats with the CFLAGS discussion on the ticket? Not necessary any more? The new spkg doesn't address that, it just implements a workaround for broken include paths. |
comment:17
Replying to @vbraun:
True, but I guess this workaround is sufficient if it makes maxima build. |
comment:18
I think the c-flags are still a problem. Try this
I didn't check, but I assume these paths are still hardcoded and hence not adjusted by relocation. We're putting the "-I" and I think also the "-L" directives into those paths upon ecl config-and-build time. They are just not the right spot to put those. We'd be better off letting the environment be so that these things are found automatically, e.g. via setting the appropriate link paths (already done) and include search paths (for instance via Failing that, we need to patch ECL so that these paths get set relative to As explained above, we can now also avoid patching sage and instead configure sage to include our own customized ecl boot routine to set up the environment with the appropriate path information during ecl invokation. |
comment:19
Replying to @nbruin:
For the record: In contrast to |
comment:21
Nils or Leif: can you give an example of an actual compilation which fails because of this? The wrong paths might not matter that much if the proper include and library files are found anyway through other means (e.g. environment variables such as |
comment:22
Replying to @jdemeyer:
It's pretty clear how you can make it fail:
(I admit I haven't actually tried. It may be that with the symlink proposed on #14662 in place, the lookup happens at the right place prior to the place searched due to the I'm a little surprised this suddenly gets marked as blocker when the issue was known for 2 years. |
comment:23
FWIW, Especially for libs, searching "random" folders is pretty delicate. (Think e.g. of bdists; we of course still have almost the same problem with And it's perhaps not too uncommon to copy a Sage installation for upgrading, i.e., keeping the files at the original location. |
comment:25
Replying to @nbruin:
Fair enough, if you intentionally want to break it by providing a bogus Note: an old |
This comment has been minimized.
This comment has been minimized.
Changed author from Jeroen Demeyer to none |
Changed keywords from ecl relocation to ecl hardcoded paths |
comment:26
I will review the workaround as part of #14662. Leaving this ticket open until you figure out how to set paths correctly ;-) |
Reviewer: Jeroen Demeyer |
comment:31
Obsolete by the new binary packaging I guess. |
CPPFLAGS are recorded by ECL for future use as default values for
c::*cc-flags*
. But we want Sage to be relocate-able, so no build paths should be hardcoded.This ticket proposes various changes to the ECL spkg-install that may work.
See also #11348 and this sage-devel thread.
Component: packages: standard
Keywords: ecl hardcoded paths
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/11359
The text was updated successfully, but these errors were encountered: