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
marble: Fix include install to dev output #48764
Conversation
@@ -14,4 +14,7 @@ mkDerivation { | |||
qtscript qtsvg qtquickcontrols qtwebkit shared-mime-info krunner kparts | |||
knewstuff gpsd | |||
]; | |||
preConfigure = '' | |||
cmakeFlags+=" -DINCLUDE_INSTALL_DIR=''${!outputDev}/include" |
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.
Could you use cmakeFlags = [ "-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include" ]
instead of preConfigure
?
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 wasn't aware that the placeholder
builtin had been added.
The nice thing about using outputDev
is that it's valid regardless of whether or not a separate dev
output exists.
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 agree, this should definitely use outputDev
, otherwise it may silently fail.
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.
This package has control over the outputs it provides. And even if someone used marble.overrideAttrs (super: { outputs = null; })
, removing dev output will definitely not fail silently.
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 just want to point out that outputs
can't be null
or empty.
marble.overrideAttrs (oldAttrs: { outputs = [ "out" ]; })
fails when trying to install to the temporary string provided by placeholder "dev"
. In order to avoid it you would have to use: marble.overrideAttrs (oldAttrs: { outputs = [ "out" ]; cmakeFlags = []; })
I really don't see the advantage of that method .
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.
Placeholder variant is much more concise. Why would anyone in their right mind remove dev output?
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.
Concision is not a virtue above correctness.
Perhaps we could use placeholder
with assert (lib.elem "dev" outputs)
.
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.
It will be asserted by virtue of trying to install into the dev output. When the output does not exist, the installation will fail.
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 not saying it's a common thing but there is precedent for it in-tree:
untrunc overrides libav_12 removing dev
systemd-cryptsetup-generator overrides systemd removing dev
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.
Failing during install, when we could fail during evaluation, is disrespectful to our users. Not failing is preferable to both.
At the moment, I am maintainer-by-default of this package. Because I'm responsible for providing support for it (what support I can), I would prefer it not fail if possible. If either of you or anyone else wants to take over maintenance of this package, I will defer entirely to that person.
Unless there are any other issues I would like to get this merged. |
Thanks! |
Motivation for this change
13c1f26 added a separate
dev
output, however the includes are still installed toout
becauseINCLUDE_INSTALL_DIR
defaults to${CMAKE_INSTALL_PREFIX}/include
. They get automatically moved todev
by the builder, butINTERFACE_INCLUDE_DIRECTORIES
in the CMake package config still points to the old location inout
. This breaks the build ofkreport
.Needs backport to
release-18.09
.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)