Skip to contentSkip to conversation

distro packaging, makefiles, deps, systemd, new tools

PATCH In review Jason A. Donenfeld 4 participants 10 messages Jan 4, 2017 – Jan 11, 2017

lore
Share & tools
lore
#0 lore raw

Hey Christian, Daniel, Dan, and other maintainers,

The next snapshot is going to have some improvements to the tooling, and along with this comes a more complicated Makefile. I wanted to run the changes by y'all (downstreams).

- The makefile now has a few WITH_{FEATURE}=yes|no environment flags, as well as auto-detection. Documentation is here:
https://git.zx2c4.com/WireGuard/plain/src/tools/INSTALL
And the Makefile itself is here:
https://git.zx2c4.com/WireGuard/tree/src/tools/Makefile

Question: does this propose a desirable situation for you as a downstream?

- The wg-config script is now called wg-quick and is quite simple and nice. Documentation:
https://git.zx2c4.com/WireGuard/about/src/tools/wg-quick.8
And source:
https://git.zx2c4.com/WireGuard/tree/src/tools/wg-quick.bash

OpenWRT should _not_ ship this. NixOS probably should not ship this. When systemd-networkd gets support for WireGuard, systemd-based distros should not ship this. But everybody else who just wants a simple rough script for quickly bringing up and down VPNs can ship this, as it's a big help to users. It's installed according to the documentation for the Makefile above.

- There's now an "upstream" systemd unit for wg-quick, called [email protected]. It's pretty simple:
https://git.zx2c4.com/WireGuard/tree/src/tools/[email protected]

Question: does this unit seem sane to you? Can you ship it downstream as is, or will you need modifications?

Thanks,
Jason

#1 lore raw

PATCH 1/1 tools: remove DESTDIR for autodetection

From: Christian Hesse <[email protected]>

DESTDIR is always empty, no need to check anything there. Check the main system instead.

---
 src/tools/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/tools/Makefile +3 -3
index fe483b9..8160cc9 100644
@@ -12,12 +12,12 @@ WITH_WGQUICK ?=
 WITH_SYSTEMDUNITS ?=
 
 ifeq ($(WITH_BASHCOMPLETION),)
-ifneq ($(strip $(wildcard $(DESTDIR)$(BASHCOMPDIR))),)
+ifneq ($(strip $(wildcard $(BASHCOMPDIR))),)
 WITH_BASHCOMPLETION := yes
 endif
 endif
 ifeq ($(WITH_WGQUICK),)
-ifneq ($(strip $(wildcard $(DESTDIR)$(BINDIR)/bash)),)
+ifneq ($(strip $(wildcard $(BINDIR)/bash)),)
 WITH_WGQUICK := yes
 endif
 ifneq ($(strip $(wildcard $(DESTDIR)/bin/bash)),)
@@ -25,7 +25,7 @@ WITH_WGQUICK := yes
 endif
 endif
 ifeq ($(WITH_SYSTEMDUNITS),)
-ifneq ($(strip $(wildcard $(DESTDIR)$(SYSTEMDUNITDIR))),)
+ifneq ($(strip $(wildcard $(SYSTEMDUNITDIR))),)
 WITH_SYSTEMDUNITS := yes
 endif
 endif
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 1/1] tools: remove DESTDIR for autodetection

Quoted 4 lines · Christian Hesse

From: Christian Hesse <[email protected]>

DESTDIR is always empty, no need to check anything there. Check the main system instead.

why are we checking either place? It's entirely possible that my dedicated build farm doesn't have any bash completion mechanisms installed, even if my development system does.

           --dkg
#3 lore raw

Re: [PATCH 1/1] tools: remove DESTDIR for autodetection

Quoted 3 lines · Daniel Kahn Gillmor

why are we checking either place? It's entirely possible that my dedicated build farm doesn't have any bash completion mechanisms installed, even if my development system does.

Yes, the concept of auto-detection is "broken". But it's useful as a default, for people doing make && make install on their dev machines. Packagers should always set these types of flags explicitly, as with autotools.

#4 lore raw

Re: [PATCH 1/1] tools: remove DESTDIR for autodetection

For reference, the Gentoo 9999 ebuild does this:

https://gitweb.gentoo.org/repo/gentoo.git/tree/net-misc/wireguard/wireguard-9999.ebuild#n51

emake \
WITH_BASHCOMPLETION=yes \
WITH_SYSTEMDUNITS=yes \
WITH_WGQUICK=yes \
DESTDIR="${D}" \
BASHCOMPDIR="$(get_bashcompdir)" \
PREFIX="${EPREFIX}/usr" \
-C src/tools install

I imagine Debian and Arch will do something similar, perhaps leaving out explicitly setting BASHCOMPDIR if you use standard patches. I expect for OpenWRT to set all of these explicitly to "no". Etc.

Jason

#6 lore raw
In reply to Jason A. Donenfeld
Quoted 6 lines · Jason A. Donenfeld

Hey Christian, Daniel, Dan, and other maintainers,

The next snapshot is going to have some improvements to the tooling, and along with this comes a more complicated Makefile. I wanted to run the changes by y'all (downstreams).

Quoted 7 lines

- The makefile now has a few WITH_{FEATURE}=yes|no environment flags, as well as auto-detection. Documentation is here:
https://git.zx2c4.com/WireGuard/plain/src/tools/INSTALL
And the Makefile itself is here:
https://git.zx2c4.com/WireGuard/tree/src/tools/Makefile

Question: does this propose a desirable situation for you as a downstream?

Reading through INSTALL, these parameters look reasonable to me as a downstream.

Quoted 6 lines

- The wg-config script is now called wg-quick and is quite simple and nice. Documentation:
https://git.zx2c4.com/WireGuard/about/src/tools/wg-quick.8
And source:
https://git.zx2c4.com/WireGuard/tree/src/tools/wg-quick.bash

Quoted 6 lines

OpenWRT should _not_ ship this. NixOS probably should not ship this. When systemd-networkd gets support for WireGuard, systemd-based distros should not ship this. But everybody else who just wants a simple rough script for quickly bringing up and down VPNs can ship this, as it's a big help to users. It's installed according to the documentation for the Makefile above.

this also looks good.

Quoted 6 lines

- There's now an "upstream" systemd unit for wg-quick, called [email protected]. It's pretty simple:
https://git.zx2c4.com/WireGuard/tree/src/tools/[email protected]

Question: does this unit seem sane to you? Can you ship it downstream as is, or will you need modifications?

although i haven't tested it, a quick read through the .service file looks reasonable to me. Thanks for thinking about system integration stuff.

        --dkg
#7 lore raw
In reply to Jason A. Donenfeld
Quoted 4 lines · Jason A. Donenfeld

=20
OpenWRT should _not_ ship this. =08=0D

Agreed.

Everything else looks good to me. Just had a brief look at it.

Let's see what buildbot says. Should all run smoothly!

#8 lore raw
Quoted 3 lines · Dan Lüdtke

On 4 Jan 2017, at 19:50, Jason A. Donenfeld <[email protected]> wrote:

OpenWRT should _not_ ship this.

Agreed.

Everything else looks good to me. Just had a brief look at it.

Let's see what buildbot says. Should all run smoothly!

I assume youre not shipping the bash completion stuff either, right? Since openwrt doesn't use bash.