-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
godot: fix NIX_* environment propagations to scons #213030
Conversation
scons build system does not work by default in nixpkgs envoironment as it filters system environment and throws away NIX_* flags: https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html Fix build system to always propagate os.environment.
Hi! We were trying to decipher the previous version of this patch in #177578 (comment), but @Rotaerk brings up a good point: even without this patch, Godot builds fine -- why is that? Seemingly even without this patch, our environment variables are being propagated properly... did you run into a scenario where this doesn't happen? Thanks. |
#210004 exposed variable filtering in many The PR was reverted since and might not fail |
Specifically, does |
I don't believe that patch strips any environment variables that weren't already stripped by the SCons script. See this comment for an explanation of the patch. If anything, if SCons' In current nixpkgs, I think Godot will probably build successfully without this patch in most environments — but the default behaviour here breaks hermeticity, so it will depend on the host system and the presence/absence of sandboxing. This is masked by the behaviour of cc-wrapper in environments with |
On the other hand, I think that if you pass |
The crucial detail of this patch is: -env_base = Environment(tools=custom_tools)
+env_base = Environment(ENV = os.environ, tools=custom_tools) (or
I'm not sure I agree. Doesn't $ cat pkg_config_additions.patch
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 98c9ddb..0cc2bff 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -255,6 +255,10 @@ def configure(env):
env.ParseConfig("pkg-config xrender --cflags --libs")
env.ParseConfig("pkg-config xi --cflags --libs")
+ env.ParseConfig("pkg-config xfixes --cflags --libs")
+ env.ParseConfig("pkg-config glu --cflags --libs")
+ env.ParseConfig("pkg-config zlib --cflags --libs") Looks like an upstream configuration just does not work here.
I am not sure if full environment filtering is the correct fix for hermeticity problems. It's not a In my view the correct fix would be to fix the build system and package configure phase to prefer explicitly passed in lookup paths first and explicitly disable features that could leak in non-hermetic lookup paths. That way the non-hermetic paths even if present would not take practical part in the lookup. On top of that environment filtering certainly drops If you still think this patch is wrong then feel free to drop it. |
No, I think your version of this patch is great. Mine hewed as closely to the original Godot behaviour as possible — you've gone much further and made sure it makes no changes to the nixpkgs-provided environment, which I think is exactly what we want to do. As you say, I think the original Godot behaviour was a bit of a hack to start with. I recommend we keep these changes. |
Yeah, that sounds about right. |
scons build system does not work by default in nixpkgs envoironment as it filters system environment and throws away NIX_* flags:
Fix build system to always propagate os.environment.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes