Skip to content
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

Merged
merged 1 commit into from Oct 22, 2018

Conversation

zraexy
Copy link
Member

@zraexy zraexy commented Oct 20, 2018

Motivation for this change

13c1f26 added a separate dev output, however the includes are still installed to out because INCLUDE_INSTALL_DIR defaults to ${CMAKE_INSTALL_PREFIX}/include. They get automatically moved to dev by the builder, but INTERFACE_INCLUDE_DIRECTORIES in the CMake package config still points to the old location in out. This breaks the build of kreport.

Needs backport to release-18.09.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@@ -14,4 +14,7 @@ mkDerivation {
qtscript qtsvg qtquickcontrols qtwebkit shared-mime-info krunner kparts
knewstuff gpsd
];
preConfigure = ''
cmakeFlags+=" -DINCLUDE_INSTALL_DIR=''${!outputDev}/include"
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Contributor

@jtojnar jtojnar Oct 21, 2018

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.

Copy link
Member Author

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 .

Copy link
Contributor

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?

Copy link
Member

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).

Copy link
Contributor

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.

Copy link
Member Author

@zraexy zraexy Oct 21, 2018

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

Copy link
Member

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.

@zraexy
Copy link
Member Author

zraexy commented Oct 22, 2018

Unless there are any other issues I would like to get this merged. calligra and kexi have been not building in nixos-18.09 for over a week.

@ttuegel ttuegel merged commit d35c7f9 into NixOS:master Oct 22, 2018
@ttuegel
Copy link
Member

ttuegel commented Oct 22, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants