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

wireshark: explicitly disable the Qt build when building Gtk #33477

Merged
merged 2 commits into from Jan 6, 2018

Conversation

andir
Copy link
Member

@andir andir commented Jan 5, 2018

Motivation for this change

In a recent CMAKE(?) or wireshark release the default behavior did
change. A failing build log can be seen at hydra [1].

[1] https://hydra.nixos.org/build/67179559/nixlog/1

Things done
  • 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.

@jtojnar
Copy link
Contributor

jtojnar commented Jan 6, 2018

The package was updated cd7ce7c, probably caused by wireshark/wireshark@09ba63e.

@@ -23,7 +23,7 @@ in stdenv.mkDerivation {
sha256 = "0bpiby916k3k8bm7q8b1dflva6zs0a4ircskrck0d538dfcrb50q";
};

cmakeFlags = optional withGtk "-DBUILD_wireshark_gtk=TRUE";
cmakeFlags = optional withGtk "-DBUILD_wireshark_gtk=TRUE -DBUILD_wireshark=OFF";
Copy link
Contributor

Choose a reason for hiding this comment

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

You can have both withGtk and withQt enabled. It would be better to turn them on/off separately.

@orivej
Copy link
Contributor

orivej commented Jan 6, 2018

Please fix wireshark-cli too.

@jtojnar
Copy link
Contributor

jtojnar commented Jan 6, 2018

@orivej Respecting withQt argument should fix that too.

In a recent Cmake(?) or wireshark release the default behaviour did
change. A failing build log can be seen at hydra [1].

[1] https://hydra.nixos.org/build/67179559/nixlog/1
@andir
Copy link
Member Author

andir commented Jan 6, 2018

@jtojnar @orivej I've added another commit (and rebased onto master). Does that look better?

@@ -23,7 +23,8 @@ in stdenv.mkDerivation {
sha256 = "0bpiby916k3k8bm7q8b1dflva6zs0a4ircskrck0d538dfcrb50q";
};

cmakeFlags = optional withGtk "-DBUILD_wireshark_gtk=TRUE";
cmakeFlags = (if withGtk then ["-DBUILD_wireshark_gtk=TRUE"] else ["-DBUILD_wireshark_gtk=OFF"]) ++
(if withQt then ["-DBUILD_wireshark=TRUE"] else ["-DBUILD_wireshark=OFF"]);
Copy link
Contributor

@jtojnar jtojnar Jan 6, 2018

Choose a reason for hiding this comment

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

It would probably be nicer to factor this out to a function, see for example

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/stxxl/default.nix#L6

Copy link
Contributor

Choose a reason for hiding this comment

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

Including the use of ON/OFF instead of TRUE/OFF.

Copy link
Contributor

Choose a reason for hiding this comment

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

With only two options inline is also fine, but it can be simplified to cmakeFlags = [ "-DBUILD_wireshark_gtk=${if withGTK then "ON" else "OFF"}" … ].

Copy link
Contributor

Choose a reason for hiding this comment

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

I still think 0–1–∞ rule results in more aesthetically pleasing code but this will work too.

Copy link
Contributor

Choose a reason for hiding this comment

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

That rule is pretty, but such duplication as this one is slightly easier to reason about both for the author of the change and for the readers. (Because it is local and it does not introduce any new names or functions.)

This should also fix the wireshark-cli variant
@andir
Copy link
Member Author

andir commented Jan 6, 2018

updates to the variant proposed in #33477 (comment)

@orivej orivej changed the title wireshark-gtk: explicitly disable the Qt build when building Gtk wireshark: explicitly disable the Qt build when building Gtk Jan 6, 2018
@orivej orivej merged commit c48fbe0 into NixOS:master Jan 6, 2018
@orivej
Copy link
Contributor

orivej commented Jan 6, 2018

Thank you!

@andir andir deleted the wireshark-gtk branch January 6, 2018 12:06
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