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

connman: 1.37 -> 1.38 #80812

Closed
wants to merge 19 commits into from
Closed

Conversation

doronbehar
Copy link
Contributor

Motivation for this change
  • Update connman 1.38, see change log.
  • Cleanup build for easy enable / disable of features.
Things done
  • Rewrite all features' enable / disable flags.
  • Cleaned up dependencies, including unneeded ones.
  • Added 2 new build flavors - connmanFull and connmanThin with several more / less features enabled / disabled.
  • 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.

cc @matejc

@ofborg ofborg bot requested a review from matejc February 22, 2020 17:26
@doronbehar doronbehar changed the title Update connman connman: 1.37 -> 1.38 Feb 29, 2020
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/122

pkgs/tools/networking/connman/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/default.nix Outdated Show resolved Hide resolved
@erikarvstedt
Copy link
Member

Nice overall improvements, thanks! 😸

Copy link
Contributor Author

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

Thanks for reviewing. I have just 1 doubt left.

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/default.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/default.nix Outdated Show resolved Hide resolved
@erikarvstedt
Copy link
Member

erikarvstedt commented Mar 1, 2020

I'm not sure I understand the idea of this syntax

Just copy the approach that tesseract uses. Rename default.nix to connman.nix and move the definitions of the three connman variants into default.nix

@doronbehar
Copy link
Contributor Author

Great, thanks again @erikarvstedt . PR should be ready now.

@erikarvstedt
Copy link
Member

erikarvstedt commented Mar 2, 2020

I think that all options that just translate to a --enable/disable-* configure flag, without additional logic like setting buildInputs, can be removed. It's not worth the added complexity, the user can always override configureFlags.

Here's how it should be done. I've also added these fixes:

  • moved runtime deps to buildInputs
  • removed use of lowPrio

What's left to be done:

  • I can't judge if the profiles connmanFull and connmanMinimal and all of the added package options are sensible. This needs feedback from other connman users.
  • The AUR build supports these optional runtime dependencies: bluez, wpa_supplicant, iwd. Maybe we should provide these, too.
    Although we enable iwd, we don't have iwd in buildInputs. Is that correct?

@doronbehar
Copy link
Contributor Author

I think that all options that just translate to a --enable/disable-* configure flag, without additional logic like setting buildInputs, can be removed. It's not worth the added complexity, the user can always override configureFlags.

I'm not sure I agree. The reason behind my approach is that the --disable/ --enable flags are more explicit - we either require a certain feature or we don't, meaning we don't count on it's presence in buildInputs or a like to provide it's compilation. I got convinced that this is a good approach after: #79864 (comment).

In the current state of configureFlags, we use the same defaults as upstream, only it's easier to figure out which feature is enabled / disabled by default. Perhaps the only exception is --enable-iwd (which is disabled by default in upstream's ./configure). This way, you don't have to download the tarball yourself and run ./configure --help in order to view all available options and see which are enabled/disabled by default and then, compare it with what's in connman.nix.

  • removed use of lowPrio

I don't mind this change though :)

I can't judge if the profiles connmanFull and connmanMinimal and all of the added package options are sensible. This needs feedback from other connman users.

I agree. I am a connman user myself and I can imagine myself using at least connmanMinimal - perhaps on an embedded device that doesn't need WiFi nor any other feature. As for connmanFull, I think there would always be someone out there who'd want all the bells and whistles this program can provide. That's just me though. I'm open to hear other opinions.

Although we enable iwd, we don't have iwd in buildInputs. Is that correct?

Correct. The same goes for wpa_supplicant. It's evident that connman (in 1.37 as well) connects to both daemons via dbus. Hence, the user should choose which program he wishes to use as a wireless daemon and install it. Even Arch Linux puts them in makedepends and not depends.

@erikarvstedt
Copy link
Member

Thanks for your thoughtful response.

I'm not sure I agree.

Yeah, we'll have to wait for a judgement from a more seasoned contributor.
Can you add my other fixes that are unrelated to the options?

@doronbehar
Copy link
Contributor Author

doronbehar commented Mar 3, 2020

Yeah, we'll have to wait for a judgement from a more seasoned contributor.

Agreed. Allow me to summon @worldofpeace to judge on this issue as they supported this approach in #79864 (comment)

Can you add my other fixes that are unrelated to the options?

Sure. As for the removal of lowPrio, you got it. But as for:

  • moved runtime deps to buildInputs

I see that in https://github.com/erikarvstedt/nixpkgs/blob/1860c678353d1a9d9706bff7581abcb4a5cc0944/pkgs/tools/networking/connman/connman.nix#L47 . My opinion is that this is an imposition we shouldn't take. Just because a connman derivation was built with (e.g) a certain vpn feature enabled, it doesn't mean that all of the (e.g) openvpn derivation should be downloaded to a user's /nix/store. If a user would like to couple connman with say openvpn, he should handle that in /etc/nixos/configuration.nix somehow and not most people wouldn't do that.

@erikarvstedt
Copy link
Member

erikarvstedt commented Mar 3, 2020

The distinction between buildInputs and nativeBuildinputs is only relevant for cross-compiling. In regular builds (no cross-compilation), both can be used interchangeably and won't affect which drvs are dependencies (nix-store -q --references) of the resulting build output.

Actually, it seems that connman just references the openvpn binary (sbin/openvpn) in connman-vpnd. A dependency only needs to be added to *buildInputs when it should modify the build environment in some way, like setting up library paths. This is not needed for openvpn and in fact most of the other buildInputs, so they can be removed. Here's my patch: erikarvstedt@cd1273b.

@doronbehar
Copy link
Contributor Author

I always thought that the difference between buildInputs and nativeBuildInputs is as between runtime dependencies and build only dependencies (makedepends). I'm using NixOS for a long time and I think I got finally a little bit better understanding of I dependencies in Nixpkgs.. I still get lost though when reading https://nixos.org/nixpkgs/manual/#ssec-stdenv-dependencies .

@erikarvstedt I know you won't completely agree with me about this but I'd like to ask you anyway perhaps only for the sake of me learning: Say I have several binaries in ./result/bin/*. I can run:

$ ldd ./result/bin/*
Which gives:
./result/bin/connmanctl:
	linux-vdso.so.1 (0x00007ffffdd1a000)
	libdbus-1.so.3 => /nix/store/srvy3fwc6655kq9a274dfaw8iczna9b9-dbus-1.12.16-lib/lib/libdbus-1.so.3 (0x00007fb48c3e5000)
	libglib-2.0.so.0 => /nix/store/vwvjrh97byihk40gwl26f0lnb3w405cv-glib-2.62.4/lib/libglib-2.0.so.0 (0x00007fb48c2be000)
	libreadline.so.6 => /nix/store/j0hlpbcs6j3phqxsv09wjrvwxv17lg50-readline-6.3p08/lib/libreadline.so.6 (0x00007fb48c274000)
	libdl.so.2 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libdl.so.2 (0x00007fb48c26f000)
	libc.so.6 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libc.so.6 (0x00007fb48c0b0000)
	libpthread.so.0 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libpthread.so.0 (0x00007fb48c08d000)
	libsystemd.so.0 => /nix/store/2n66ha7fnk87jr0yq6ihnl8czwa7iknw-systemd-243.4-lib/lib/libsystemd.so.0 (0x00007fb48bfd1000)
	libpcre.so.1 => /nix/store/b5sam900j8278388zwirpwap5gw8m4l4-pcre-8.43/lib/libpcre.so.1 (0x00007fb48bf5e000)
	libncursesw.so.6 => /nix/store/7yjv8l75a8b1x3vmmnbsdwd5b0gzngga-ncurses-6.1-20190112/lib/libncursesw.so.6 (0x00007fb48beed000)
	/nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/ld-linux-x86-64.so.2 => /nix/store/y9zg6ryffgc5c9y67fcmfdkyyiivjzpj-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007fb48c43b000)
	librt.so.1 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/librt.so.1 (0x00007fb48bee1000)
	liblzma.so.5 => /nix/store/yvsjlr772hagwpdwg9qlsfpdf68wyjmg-xz-5.2.4/lib/liblzma.so.5 (0x00007fb48beb7000)
	liblz4.so.1 => /nix/store/5handm3cwbix8zys1llznzdcxpxwj06i-lz4-1.9.1/lib/liblz4.so.1 (0x00007fb48be84000)
	libcap.so.2 => /nix/store/3yc4gjawd1w9gvp1539li3lil2icdzdz-libcap-2.27-lib/lib/libcap.so.2 (0x00007fb48be7d000)
	libgcrypt.so.20 => /nix/store/7wjbixabz2vq6kp0wfp64djg6bcb0x5r-libgcrypt-1.8.5/lib/libgcrypt.so.20 (0x00007fb48bd5e000)
	libgpg-error.so.0 => /nix/store/zzipnaayyzfvga0q3c70y861d58gdjc0-libgpg-error-1.36/lib/libgpg-error.so.0 (0x00007fb48bd38000)
./result/bin/connmand:
	linux-vdso.so.1 (0x00007ffe0617c000)
	libglib-2.0.so.0 => /nix/store/vwvjrh97byihk40gwl26f0lnb3w405cv-glib-2.62.4/lib/libglib-2.0.so.0 (0x00007f79f65da000)
	libdbus-1.so.3 => /nix/store/srvy3fwc6655kq9a274dfaw8iczna9b9-dbus-1.12.16-lib/lib/libdbus-1.so.3 (0x00007f79f6586000)
	libgnutls.so.30 => /nix/store/5sn08v4z5agv2k659szh95c8nklrcb61-gnutls-3.6.12/lib/libgnutls.so.30 (0x00007f79f63ac000)
	libresolv.so.2 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libresolv.so.2 (0x00007f79f6393000)
	libdl.so.2 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libdl.so.2 (0x00007f79f638e000)
	librt.so.1 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/librt.so.1 (0x00007f79f6382000)
	libxtables.so.12 => /nix/store/7jcgvxhmicwbvl4jw78l4q939f8596ax-iptables-1.8.4/lib/libxtables.so.12 (0x00007f79f636f000)
	libc.so.6 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libc.so.6 (0x00007f79f61b0000)
	libpcre.so.1 => /nix/store/b5sam900j8278388zwirpwap5gw8m4l4-pcre-8.43/lib/libpcre.so.1 (0x00007f79f613d000)
	libpthread.so.0 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libpthread.so.0 (0x00007f79f611c000)
	libsystemd.so.0 => /nix/store/2n66ha7fnk87jr0yq6ihnl8czwa7iknw-systemd-243.4-lib/lib/libsystemd.so.0 (0x00007f79f605e000)
	libp11-kit.so.0 => /nix/store/w02i4w7r4hpycmyryh7xr6aa6l3v1dsb-p11-kit-0.23.19/lib/libp11-kit.so.0 (0x00007f79f5f2d000)
	libunistring.so.2 => /nix/store/mxaxvp33wg9sim8qh2kkw041v492bvxj-libunistring-0.9.10/lib/libunistring.so.2 (0x00007f79f5daa000)
	libtasn1.so.6 => /nix/store/kzmdmkpp960v5d1czbwzzj2zzxrg4wxl-libtasn1-4.16.0/lib/libtasn1.so.6 (0x00007f79f5d94000)
	libnettle.so.7 => /nix/store/g3s0wk5b0d7hcy5xlw7x0fmyfdf5yxy2-nettle-3.5.1/lib/libnettle.so.7 (0x00007f79f5d57000)
	libhogweed.so.5 => /nix/store/g3s0wk5b0d7hcy5xlw7x0fmyfdf5yxy2-nettle-3.5.1/lib/libhogweed.so.5 (0x00007f79f5d1c000)
	libgmp.so.10 => /nix/store/r05vk4zq34sps98izq4v4n9h7m1a6wgx-gmp-6.2.0/lib/libgmp.so.10 (0x00007f79f5c7a000)
	/nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/ld-linux-x86-64.so.2 => /nix/store/y9zg6ryffgc5c9y67fcmfdkyyiivjzpj-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f79f6703000)
	libpcap.so.1 => /nix/store/1prpyz7vis4wwakqzabca3qpsk6yvb4r-libpcap-1.9.1/lib/libpcap.so.1 (0x00007f79f5c30000)
	libmnl.so.0 => /nix/store/p6mzr73njz01989c685ci346ldmglm5z-libmnl-1.0.4/lib/libmnl.so.0 (0x00007f79f5c28000)
	libnftnl.so.11 => /nix/store/r1f53qxf42mqxfad9sbffibxr0irqdlz-libnftnl-1.1.5/lib/libnftnl.so.11 (0x00007f79f5bf5000)
	liblzma.so.5 => /nix/store/yvsjlr772hagwpdwg9qlsfpdf68wyjmg-xz-5.2.4/lib/liblzma.so.5 (0x00007f79f5bcb000)
	liblz4.so.1 => /nix/store/5handm3cwbix8zys1llznzdcxpxwj06i-lz4-1.9.1/lib/liblz4.so.1 (0x00007f79f5b98000)
	libcap.so.2 => /nix/store/3yc4gjawd1w9gvp1539li3lil2icdzdz-libcap-2.27-lib/lib/libcap.so.2 (0x00007f79f5b91000)
	libgcrypt.so.20 => /nix/store/7wjbixabz2vq6kp0wfp64djg6bcb0x5r-libgcrypt-1.8.5/lib/libgcrypt.so.20 (0x00007f79f5a70000)
	libffi.so.7 => /nix/store/phwyg24nm8z4r91iyrhmdfljxpw1ihd5-libffi-3.3/lib/../lib64/libffi.so.7 (0x00007f79f5a63000)
	libgpg-error.so.0 => /nix/store/zzipnaayyzfvga0q3c70y861d58gdjc0-libgpg-error-1.36/lib/libgpg-error.so.0 (0x00007f79f5a3f000)
./result/bin/connmand-wait-online:
	linux-vdso.so.1 (0x00007ffc367bc000)
	libglib-2.0.so.0 => /nix/store/vwvjrh97byihk40gwl26f0lnb3w405cv-glib-2.62.4/lib/libglib-2.0.so.0 (0x00007f04d9133000)
	libdbus-1.so.3 => /nix/store/srvy3fwc6655kq9a274dfaw8iczna9b9-dbus-1.12.16-lib/lib/libdbus-1.so.3 (0x00007f04d90df000)
	libc.so.6 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libc.so.6 (0x00007f04d8f20000)
	libpcre.so.1 => /nix/store/b5sam900j8278388zwirpwap5gw8m4l4-pcre-8.43/lib/libpcre.so.1 (0x00007f04d8ead000)
	libpthread.so.0 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libpthread.so.0 (0x00007f04d8e8c000)
	libsystemd.so.0 => /nix/store/2n66ha7fnk87jr0yq6ihnl8czwa7iknw-systemd-243.4-lib/lib/libsystemd.so.0 (0x00007f04d8dce000)
	/nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/ld-linux-x86-64.so.2 => /nix/store/y9zg6ryffgc5c9y67fcmfdkyyiivjzpj-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f04d925c000)
	librt.so.1 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/librt.so.1 (0x00007f04d8dc4000)
	liblzma.so.5 => /nix/store/yvsjlr772hagwpdwg9qlsfpdf68wyjmg-xz-5.2.4/lib/liblzma.so.5 (0x00007f04d8d9a000)
	liblz4.so.1 => /nix/store/5handm3cwbix8zys1llznzdcxpxwj06i-lz4-1.9.1/lib/liblz4.so.1 (0x00007f04d8d67000)
	libcap.so.2 => /nix/store/3yc4gjawd1w9gvp1539li3lil2icdzdz-libcap-2.27-lib/lib/libcap.so.2 (0x00007f04d8d5e000)
	libgcrypt.so.20 => /nix/store/7wjbixabz2vq6kp0wfp64djg6bcb0x5r-libgcrypt-1.8.5/lib/libgcrypt.so.20 (0x00007f04d8c3f000)
	libgpg-error.so.0 => /nix/store/zzipnaayyzfvga0q3c70y861d58gdjc0-libgpg-error-1.36/lib/libgpg-error.so.0 (0x00007f04d8c1b000)
./result/bin/connman-vpnd:
	linux-vdso.so.1 (0x00007ffdff9e8000)
	libglib-2.0.so.0 => /nix/store/vwvjrh97byihk40gwl26f0lnb3w405cv-glib-2.62.4/lib/libglib-2.0.so.0 (0x00007f928de62000)
	libdbus-1.so.3 => /nix/store/srvy3fwc6655kq9a274dfaw8iczna9b9-dbus-1.12.16-lib/lib/libdbus-1.so.3 (0x00007f928de0e000)
	libgnutls.so.30 => /nix/store/5sn08v4z5agv2k659szh95c8nklrcb61-gnutls-3.6.12/lib/libgnutls.so.30 (0x00007f928dc34000)
	libresolv.so.2 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libresolv.so.2 (0x00007f928dc1b000)
	libdl.so.2 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libdl.so.2 (0x00007f928dc16000)
	libc.so.6 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libc.so.6 (0x00007f928da55000)
	libpcre.so.1 => /nix/store/b5sam900j8278388zwirpwap5gw8m4l4-pcre-8.43/lib/libpcre.so.1 (0x00007f928d9e2000)
	libpthread.so.0 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/libpthread.so.0 (0x00007f928d9c1000)
	libsystemd.so.0 => /nix/store/2n66ha7fnk87jr0yq6ihnl8czwa7iknw-systemd-243.4-lib/lib/libsystemd.so.0 (0x00007f928d905000)
	libp11-kit.so.0 => /nix/store/w02i4w7r4hpycmyryh7xr6aa6l3v1dsb-p11-kit-0.23.19/lib/libp11-kit.so.0 (0x00007f928d7d2000)
	libunistring.so.2 => /nix/store/mxaxvp33wg9sim8qh2kkw041v492bvxj-libunistring-0.9.10/lib/libunistring.so.2 (0x00007f928d64f000)
	libtasn1.so.6 => /nix/store/kzmdmkpp960v5d1czbwzzj2zzxrg4wxl-libtasn1-4.16.0/lib/libtasn1.so.6 (0x00007f928d639000)
	libnettle.so.7 => /nix/store/g3s0wk5b0d7hcy5xlw7x0fmyfdf5yxy2-nettle-3.5.1/lib/libnettle.so.7 (0x00007f928d5fe000)
	libhogweed.so.5 => /nix/store/g3s0wk5b0d7hcy5xlw7x0fmyfdf5yxy2-nettle-3.5.1/lib/libhogweed.so.5 (0x00007f928d5c3000)
	libgmp.so.10 => /nix/store/r05vk4zq34sps98izq4v4n9h7m1a6wgx-gmp-6.2.0/lib/libgmp.so.10 (0x00007f928d51f000)
	/nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/ld-linux-x86-64.so.2 => /nix/store/y9zg6ryffgc5c9y67fcmfdkyyiivjzpj-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f928df8b000)
	librt.so.1 => /nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30/lib/librt.so.1 (0x00007f928d515000)
	liblzma.so.5 => /nix/store/yvsjlr772hagwpdwg9qlsfpdf68wyjmg-xz-5.2.4/lib/liblzma.so.5 (0x00007f928d4eb000)
	liblz4.so.1 => /nix/store/5handm3cwbix8zys1llznzdcxpxwj06i-lz4-1.9.1/lib/liblz4.so.1 (0x00007f928d4b8000)
	libcap.so.2 => /nix/store/3yc4gjawd1w9gvp1539li3lil2icdzdz-libcap-2.27-lib/lib/libcap.so.2 (0x00007f928d4af000)
	libgcrypt.so.20 => /nix/store/7wjbixabz2vq6kp0wfp64djg6bcb0x5r-libgcrypt-1.8.5/lib/libgcrypt.so.20 (0x00007f928d390000)
	libffi.so.7 => /nix/store/phwyg24nm8z4r91iyrhmdfljxpw1ihd5-libffi-3.3/lib/../lib64/libffi.so.7 (0x00007f928d383000)
	libgpg-error.so.0 => /nix/store/zzipnaayyzfvga0q3c70y861d58gdjc0-libgpg-error-1.36/lib/libgpg-error.so.0 (0x00007f928d35f000)
This gives a view of the actual runtime dependencies. As for an executable there calling (e.g) openvpn or a like, we can't ever know that by looking at `ldd`'s output so let's ignore this scenario for the sake of simplicity.

In comparison to ldd's output, this is the output of nix-store -q --references $(nix-build -A connmanFull):

/nix/store/1ncwrl8bplq3xhmj8pxfkx4y0i90vmnx-glibc-2.30
/nix/store/00rilbj1qjpr8kzi7rasmsiw9v1czrd6-vpnc-0.5.3-post-r550
/nix/store/5sn08v4z5agv2k659szh95c8nklrcb61-gnutls-3.6.12
/nix/store/p6mzr73njz01989c685ci346ldmglm5z-libmnl-1.0.4
/nix/store/7jcgvxhmicwbvl4jw78l4q939f8596ax-iptables-1.8.4
/nix/store/injg047z5jv8ng0yxa8ds54nfrhhs5g7-ppp-2.4.7
/nix/store/80nkg3kcivbkavb9nxpf7pfd7vhnxvgp-pptp-1.10.0
/nix/store/bmqdvxbsc6zncmbjw8lf82wsmm6jc579-openvpn-2.4.7
/nix/store/j0hlpbcs6j3phqxsv09wjrvwxv17lg50-readline-6.3p08
/nix/store/rvf426ps2bai9fcghdnn0lxc2j7dq1gi-openconnect-8.05
/nix/store/srvy3fwc6655kq9a274dfaw8iczna9b9-dbus-1.12.16-lib
/nix/store/vwvjrh97byihk40gwl26f0lnb3w405cv-glib-2.62.4
/nix/store/wgd0b14rjh59c75rmv35gxma8kghlmxp-connman-1.38

Say I would like to remove the reference to ppp, openvpn, vpnc and openconnect. How should I construct the inputs in such a way that they will only be used in build time, but wouldn't be strictly required for running?

@erikarvstedt
Copy link
Member

erikarvstedt commented Mar 3, 2020

How should I construct the inputs in such a way...

connman calls these binaries by their absolute store paths. So, for private use, you could pass wrapper binaries to the build that call the main binary in PATH. (Drop me a mail if you need more help here.)

But this is inappropriate for nixpkgs where all dependencies should be made explicit.

@doronbehar
Copy link
Contributor Author

I see, (I read https://nixos.org/nixos/nix-pills/automatic-runtime-dependencies.html and that helped me understand better).

As for the buildInputs vs nativeBuildInputs, here's a quote from https://nixos.org/nixpkgs/manual/#ssec-stdenv-dependencies :

Since these packages are able to be run at build-time, they are added to the PATH, as described above. But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies. This isn't currently enforced, but could be in the future.

That makes sense with what I understand better only now. However, in our case, the dependencies openvpn, vpnc and openconnect are used in configureFlags and they are referenced directly (to their bin/ path) hence they will always be referenced in the output, no matter that they are added to nativeBuildInputs or buildInputs.

I understand now this logic.

pkgs/tools/networking/connman/connman.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/connman.nix Outdated Show resolved Hide resolved
pkgs/tools/networking/connman/connman.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Show resolved Hide resolved
@alyssais
Copy link
Member

alyssais commented Mar 6, 2020

Allow me to summon @worldofpeace to judge on this issue as he (they) supported this approach in #79864 (comment)

We do not address worldofpeace like this. I understand they have already made it plain to you that it is not appropriate to call them “he”, including “he (they)”. In case this is still not clear, a phrasing that is not disrespectful to worldofpeace would have been:

“Allow me to summon @worldofpeace to judge on this issue as they supported this approach in…”

@erikarvstedt
Copy link
Member

@alyssais, thanks for reading through all of this. Do you think it would make sense to close this PR and reopen it with squashed commits and one single comment by me which addresses outstanding issues, so we can spare future reviewers all the detours in our discussion?

@doronbehar
Copy link
Contributor Author

We do not address worldofpeace like this. I understand they have already made it plain to you that it is not appropriate to call them “he”, including “he (they)”.

Thank you @alyssais for joining the discussion. Unfortunately, I've failed to understand that a while ago when worldofpeace have first explained it to me and I understood a totally different scenario. Just a few hours ago I've messaged them explaining this. Please forgive my insensitivity.

@worldofpeace
Copy link
Contributor

@alyssais, thanks for reading through all of this. Do you think it would make sense to close this PR and reopen it with squashed commits and one single comment by me which addresses outstanding issues, so we can spare future reviewers all the detours in our discussion?

I think it would make sense to re-pr so it can attract reviewers. I currently won't have the time to review this just yet, since we are so close to getting 20.03 out.

@doronbehar
Copy link
Contributor Author

doronbehar commented Mar 27, 2020

Closing for the sake of a cleaner re-pr (#83473).

@doronbehar doronbehar closed this Mar 27, 2020
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