-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
lib/attrsets: make getFirstOutput support strings #410779
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
base: master
Are you sure you want to change the base?
Conversation
2651d7f
to
2f03be6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to more input, but based on the provided info, I'd recommend against this for cost/benefit reasons.
The outputDev
etc variables have been internal to setup.sh
.
It complicates getBin
, which I believe should be simple, so that it is easy to understand how an output is found.
We don't seem to have needed this, and SDL compat doesn't seem like a good motivating example to me.
The sdl-compat
program seems to be a relic of the pre-pkg-config
past. Configure scripts should probably use pkg-config
instead. That also more straightforward for cross compilation.
Do we really need this? It seems that we'd impose the cost of this questionable solution on all Nixpkgs users, by imposing the complexity of this solution on all packages.
A I agree that the eval overhead is not pretty. Would you prefer we switch to |
531438d
to
4630d5d
Compare
|
This works fine: nix-repl> :b stdenv.mkDerivation { name = "test"; stictDeps = true; buildInputs = [ sdl2-compat ]; dontUnpack = true; configurePhase = "sdl2-config --help"; }
...
> Usage: /nix/store/3r1cplqpqfxc3j3my2ma0l311rs932qy-sdl2-compat-2.32.54-dev/bin/sdl2-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]
... What's the use case for |
If convenience for the That could then even be made compatible with |
4630d5d
to
86d1558
Compare
It does not work if |
🤦
|
is this amputated PR mergeable or is there reason to maybe want to reintroduce the dropped commits? |
Yeah it's close. The The The |
86d1558
to
379f2c6
Compare
`outputDev` is not expect any `listOf str`, only `str`. This is the only instance of `outputDev` being set to a list in nixpkgs. This error was likely masked by `toString` behavior for lists.
379f2c6
to
d36a1ed
Compare
EDIT: title was "lib/attrsets: make getBin and co respect outputBin if set"
As a motivating example I added a commit that sets
sdl2-compat.meta.mainProgram
(to matchSDL_compat
). It installs its binary to$dev/bin/
due tooutoutBin = "dev"
, since the binary is typically only used duringconfigurePhase
. This change makeslib.getExe sdl2-compat
point at the right path.outputDev
fromlistOf str
tostr
lib/attrsets: make getBin and co respect outputBin if set$outputInclude
sdl2-compat: set meta.mainProgramEDIT: dropped two commits, since this path is not the way to go, but the fixes along the way still apply. I'll open a treewide pr for the alternative approach
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.