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

networkmanager: port to Meson #59916

Merged
merged 2 commits into from Apr 23, 2019
Merged

networkmanager: port to Meson #59916

merged 2 commits into from Apr 23, 2019

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Apr 20, 2019

Motivation for this change

All hail Meson!

See the commit messages for details.

Things done

I checked that the outputs still match: The man and doc were moved to separate outputs, Vapi was added to dev output, devdoc were added, libtool files were removed from out.

I also opened the docs in Devhelp but they suffer from the common about:blank bug: env XDG_DATA_DIRS=$(nix-build -A networkmanager.devdoc --no-link)/share GTK3_MODULES= devhelp

  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

gobject-introspection uses glib’s g_module_open function, which in turn relies
on dlopen. I also implemented openat, since I initially thought this function
was used but turns out dlopen uses the openat signal directly. We might as
well keep it, even thought I do not need it at the moment.
@gebner
Copy link
Member

gebner commented Apr 20, 2019

This should go to staging instead of master, right?

@jtojnar jtojnar changed the base branch from master to staging April 20, 2019 10:49
@worldofpeace
Copy link
Contributor

Yay same, hail meson (bows graciously) @jtojnar

Review incoming sometime tomorrow

pkgs/tools/networking/network-manager/default.nix Outdated Show resolved Hide resolved
"-Dmodem_manager=true"
"-Dnmtui=true"
"-Ddocs=true"
"-Dlibnm_glib=true" # legacy library, TODO: remove
Copy link
Contributor

Choose a reason for hiding this comment

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

What in nixpkgs still needs this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is hard to determine since programs may use the typelib at runtime, but since GNOME depended on it until 3.26 (IIRC), I would think all the GNOME forks like MATE will still require it.

];

buildInputs = [
systemd libuuid polkit ppp libndp curl
systemd libselinux audit libpsl libuuid polkit ppp libndp curl
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really want selinux?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I usually try to have the largest broadest set of features that builds and there is some interest in SELinux in Nix. It does not really affect closure size much (Δ < 1M) but if there are some downsides we can remove it, sure.

meson + selinux: 403727760
meson:           403141328
autotools:       413526024

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that makes sense. I don't know how SELinux works, but does enabling it without support in NixOS cause problems? If not this is fine.

All hail Meson!

One serious issue is that building docs does not work.

We patch gobject-introspection to use absolute paths for shared libraries
in GIR files. Building the NetworkManager docs relies on the produced
introspection data but since the library is not yet installed
at the time the docs are generated, the build will fail.

It works in Autotools for some reason; they probably use
the pregenerated GIRs from the tarball.

Disabling the docs completely is not possible at the moment either,
since nmc [depends on them][1].

I have decided to fix this by pointing the installed location to the one
in the build directory using libredirect. Unfortunately, we cannot just set
the environment variables directly, since the build system runs
the documentation generator in a clean environment.

I have also added man, doc and devdoc outputs so the generated files have
somewhere to go.

Secondly, since Nix store is immutable, we also cannot use the package prefix
for configuration and mutable state data. At the same time, we cannot write
to the appropriate global directories during build. Autotools allowed to change
this in installFlags but Meson lacks similar mechanism so we need to patch
the build files.

Finally, I also removed the at_console patch since the permission has been
removed in 0.9.10.

[1]: https://bugzilla.gnome.org/show_bug.cgi?id=796755
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