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

Qt 5: Fix debug flags #34047

Merged
merged 2 commits into from Jan 20, 2018
Merged

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Jan 19, 2018

Motivation

Setting debug flags for Qt 5-based builds incorrectly overrides NIX_CFLAGS_COMPILE.

Incidentally I decided that debug should be true or false, but never null. (What would that even mean?)

Testing

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

NIX_CFLAGS_COMPILE =
let arg = args.NIX_CFLAGS_COMPILE or []; in
optional (debug == true) "-DQT_NO_DEBUG"
++ (if builtins.isList arg then arg else [arg]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there is lib.toList for this purpose.

@bkchr
Copy link
Contributor

bkchr commented Jan 19, 2018

Do we want to reset the commits that we have created to circumvent the bug?

@orivej orivej mentioned this pull request Jan 19, 2018
8 tasks
else "-DCMAKE_BUILD_TYPE=Release");
++ [
"-DBUILD_TESTING=OFF"
''-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use apostrophes instead of double quotes?

@ttuegel
Copy link
Member Author

ttuegel commented Jan 19, 2018

Do we want to reset the commits that we have created to circumvent the bug?

I don't think that's necessary. The only practical difference between NIX_CFLAGS_COMPILE and CXXFLAGS is that the latter requires extra escapes because it passes through the shell once more.

If ‘mkDerivation’ is passed ‘NIX_CFLAGS_COMPILE’, we should include those flags
along with the common flags.

See also: NixOS#34039 NixOS#34038 NixOS#33935 NixOS#33933 NixOS#33930 NixOS#33927
@ttuegel ttuegel force-pushed the bugfix/qt-5/NIX_CFLAGS_COMPILE branch from 9a0e724 to 4a39533 Compare January 20, 2018 15:11
@ttuegel ttuegel merged commit 88464ec into NixOS:master Jan 20, 2018
@ttuegel ttuegel deleted the bugfix/qt-5/NIX_CFLAGS_COMPILE branch January 20, 2018 17:51
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

5 participants