-
Notifications
You must be signed in to change notification settings - Fork 33
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
Things are compiled under ./env, but ./env / ./env.in is for running examples/tests/... only #111
Comments
This fixes <https://lists.gnu.org/archive/html/guile-user/2024-10/msg00009.html>, <wingo/fibers#111>. * gnu/packages/patches/guile-fibers-cross-build-fix.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/guile-xyz.scm (guile-fibers)[arguments]: When cross-building, add `apply-cross-build-fix-patch' phase to apply it. Change-Id: Ic845db832b9446c8cb5b534cc2db63b98c417b1a
As mentioned by @janneke, here ./env comes in: |
@civodul, could you give removing './env' a try (I don't have a good set up at the moment)? |
On a maybe related matter, I got the impression that
isn't completely correct, or became redundant. If Line 23 in 01f475f
extension-library would never be run during compilation (excluding tests). So, replacing it by an unconditional @extlibdir@ should work.
|
I would rather avoid environment variable pollution.
But then it would still do an environment variable lookup, and then users of Fibers have one more thing to worry about. Eliminating the environment variable eliminates risks. For example, what if an implementation of 'sh' written in Guile and using Fibers is used?
See removing |
As I wrote in #114, Guix carries a patch by @janneke that removes So I'm not a fan of this approach. My preference goes to something like the |
Oh, our messages crossed. I agree that it's best if we can avoid that environment variable lookup at run time, just not at any cost. Anyway, I have limited bandwidth so any fix is good to take! |
Also, maybe we can remove the whole |
It's needed for tests, that's what TESTS_ENVIRONMENT is for. IIUC, it only needs to be removed in guile.am, you don't need to remove
It eliminates the
Maybe try removing './env' from guile.m4 first? |
I think the ideal solution would be to modify Guile, such that you can tell it that 'module X needs module Y, but only for procedures/variables/..., not for macros'. Then no override mechanism nor (*) exception: would be nice if it could still look at the .go for defined/undefinedness, types, inlining, but without actually properly loading it, or something Perhaps (That's also insufficient for portable RnRS -- perhaps 'phases' is an option, but I'm not familiar enough with them to be sure, and Guile always does the implicit phasing thing.) |
The
|
I don't recall what I was thinking about when I wrote that message, but after-the-fact I would say 'it = ./env', not 'it = PR #77'. I don't recall what testing I did at the time (I did some testing, but I don't recall to what extent).
The .scm search path is already set up by the makefile (-L "$(abs_top_srcdir)$") (*). Though, I suppose you could let a (*) actually only abs_top_srcdir, not build directory, so slight changes may be needed for out-of-tree compilation. When compiling, the build directory should be mentioned to Guile (for .go), but currently it can't properly deal with that when cross-compiling, because:
Overall, I would say that it is dangerous to conflate load paths (.scm for interpreter, .go for JIT) with source/compilation path (.scm to compile, .go to inline), so './env' shouldn't do the job of both. (I think usually the .scm paths are fine to conflate because they are sources, but even then, they aren't always target-independent, e.g. embedding .so file names.) In a future where Guile properly separates '.go to load' with '.go for inlining', |
Also, I would rather avoid setting (It was rejected for being Guix-specific, but that makes little sense because Guix' compilation tool is Guix-specific, of course a dependency tracking mechanism is entwined with the compilation tool, and the reviewer doesn't apply this requirement to their own code (e.g. changes to the very same compilation tool and (*) the other meaning, not the free/non-free meaning. |
(This is response to bug report at guile-user ML, not yet in archives)
Running
Looking at the backtrace, while compiling (fibers operations), it loads (fibers events-impl).
In particular, it loads the override. The override/non-override was added in 62b2ca6 to make sure that when compiling, no .so are loaded! The override contains the .so loading code, the non-override fibers/events-impl.scm is a stub that’s completely safe for (cross-)compilation.
So, it has no business loading override/fibers/events-impl.scm! The only place where ‘override’ is added to the load path is in ‘env.in/env’, which is only used for testing (not for actual compilation).
Yet, the make says ‘./env [guild compile stuff’ – that ‘./env’ shouldn’t be appearing there (it’s for running tests / examples (runtime things), not compilation). Looking at https://github.com/wingo/fibers/actions/runs/11133129373/job/30938526065, this ‘./env’ also mysteriously appears upstream.
So, what adds ./env and how do we stop it? (I don’t have an appropriate system for investigation at the moment.)
The text was updated successfully, but these errors were encountered: