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: use relative cmake LIBDIR #82654

Merged
merged 1 commit into from Mar 15, 2020

Conversation

B4dM4n
Copy link
Contributor

@B4dM4n B4dM4n commented Mar 15, 2020

Motivation for this change

wireshark expects CMAKE_INSTALL_LIBDIR to be relative and prefixes
it with CMAKE_INSTALL_PREFIX in some places to make it absolute.
This results in duplicate absolute paths being accessed, which don't exist like:

/nix/store/d1lshac7vwnmhl09fwc04pzmcgn1y219-wireshark-qt-3.2.2//nix/store/d1lshac7vwnmhl09fwc04pzmcgn1y219-wireshark-qt-3.2.2/lib/wireshark/extcap

Therefore extcap binaries like sshdump can't be used.

Making CMAKE_INSTALL_LIBDIR relative fixes this issue.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@bjornfor
Copy link
Contributor

Is there an upstream issue? (Because this is an upstream issue, since CMAKE_INSTALL_LIBDIR is allowed to be absolute.)

Copy link
Contributor

@bjornfor bjornfor left a comment

Choose a reason for hiding this comment

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

I'd like to see a reference to upstream issue though (it is their bug).

@B4dM4n
Copy link
Contributor Author

B4dM4n commented Mar 15, 2020

I couldn't find any upstream issue about this, but changes that involve CMAKE_INSTALL_LIBDIR tend to favor relative paths: 34574 23043

@bjornfor
Copy link
Contributor

bjornfor commented Mar 15, 2020

That's unfortunate, since it's documented to allow absolute paths: "If the value is not already an absolute path, an absolute path is constructed typically by [...]." (https://cmake.org/cmake/help/v3.16/module/GNUInstallDirs.html).

UPDATE: And there are CMAKE_INSTALL_FULL_<dir> variables for getting absolute paths, without having to manually prefix stuff like upstream apparently does unconditionally.

`wireshark` expects `CMAKE_INSTALL_LIBDIR` to be relative and prefixes
it with `CMAKE_INSTALL_PREFIX` in some places to make it absolute.
This results in duplicate absolute paths being accessed, which don't exist.

Making `CMAKE_INSTALL_LIBDIR` relative fixes this issue.
@B4dM4n
Copy link
Contributor Author

B4dM4n commented Mar 15, 2020

I opened an upstream issue and embedded the link.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16444

@ofborg ofborg bot requested a review from bjornfor March 15, 2020 15:34
Copy link
Contributor

@bjornfor bjornfor left a comment

Choose a reason for hiding this comment

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

Great!

@bjornfor bjornfor merged commit e7f2ad0 into NixOS:master Mar 15, 2020
@B4dM4n B4dM4n deleted the wireshark-relative-libdir branch March 15, 2020 16:20
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

2 participants