distcc-avahi: install compiler symlinks under /usr/lib/distcc/bin/ to match Arch upstream layout #6

Closed
opened 2026-05-08 18:49:56 +00:00 by marfrit · 0 comments
Owner

Summary

The distcc-avahi PKGBUILD installs compiler symlinks (gcc, g++, cc, c++, c89, c99, aarch64-unknown-linux-gnu-gcc[-15.2.1], aarch64-unknown-linux-gnu-g++) directly under /usr/lib/distcc/, while the upstream Arch distcc package (and makepkg's buildenv hook) expect them under /usr/lib/distcc/bin/.

Net effect: BUILDENV=(distcc ...) in /etc/makepkg.conf is silently ineffective on hosts using distcc-avahi. makepkg exports DISTCC_HOSTS but does NOT prepend the distcc shim directory to PATH, so every compile runs locally.

Reproduction (on fermi)

# pacman -Q distcc-avahi
distcc-avahi 3.4-18
# grep BUILDENV /etc/makepkg.conf
BUILDENV=(distcc color !ccache check !sign)
# ls /usr/lib/distcc/bin
ls: cannot access '/usr/lib/distcc/bin': No such file or directory
# ls /usr/lib/distcc/
aarch64-unknown-linux-gnu-g++  c++  cc      g++  gcc
aarch64-unknown-linux-gnu-gcc  c89  c99

And the canonical upstream check:

# grep -A3 distcc /usr/share/makepkg/buildenv/compiler.sh | head
        elif [[ -d /usr/lib/distcc/bin ]]; then
                export PATH="/usr/lib/distcc/bin:$PATH"
        fi

Live build trace shows which gcc resolves to /usr/bin/gcc, not the distcc shim, even with BUILDENV=distcc and update-distcc-symlinks having run.

Workaround applied on fermi

Created /usr/lib/distcc/bin as a self-symlink (ln -sfn . /usr/lib/distcc/bin). With this in place, makepkg builds correctly distribute via distcc.

This is a packaging hack and should be replaced by the proper layout in the PKGBUILD.

Proposed fix

Update the distcc-avahi PKGBUILD's package() and/or the bundled update-distcc-symlinks to install symlinks at /usr/lib/distcc/bin/<compiler> (mirroring Arch extra/distcc), then ship a backwards-compat empty stub or drop the historical Debian-style path entirely.

Verify with:

sudo -u builder bash -c "cd <PKGBUILD> && makepkg -f --nodeps --noconfirm"
# build()'s PATH should contain /usr/lib/distcc/bin/ and which gcc -> /usr/lib/distcc/bin/gcc

Discovered

2026-05-08 on fermi while diagnosing why fermi was not utilizing the distcc pool (tesla, dcc1, dcc2, boltzmann) despite all four workers advertising via Avahi and DISTCC_HOSTS="+zeroconf" set.

## Summary The distcc-avahi PKGBUILD installs compiler symlinks (gcc, g++, cc, c++, c89, c99, aarch64-unknown-linux-gnu-gcc[-15.2.1], aarch64-unknown-linux-gnu-g++) directly under `/usr/lib/distcc/`, while the upstream Arch `distcc` package (and `makepkg`'s buildenv hook) expect them under `/usr/lib/distcc/bin/`. Net effect: `BUILDENV=(distcc ...)` in `/etc/makepkg.conf` is silently ineffective on hosts using distcc-avahi. `makepkg` exports `DISTCC_HOSTS` but does NOT prepend the distcc shim directory to `PATH`, so every compile runs locally. ## Reproduction (on fermi) ``` # pacman -Q distcc-avahi distcc-avahi 3.4-18 # grep BUILDENV /etc/makepkg.conf BUILDENV=(distcc color !ccache check !sign) # ls /usr/lib/distcc/bin ls: cannot access '/usr/lib/distcc/bin': No such file or directory # ls /usr/lib/distcc/ aarch64-unknown-linux-gnu-g++ c++ cc g++ gcc aarch64-unknown-linux-gnu-gcc c89 c99 ``` And the canonical upstream check: ``` # grep -A3 distcc /usr/share/makepkg/buildenv/compiler.sh | head elif [[ -d /usr/lib/distcc/bin ]]; then export PATH="/usr/lib/distcc/bin:$PATH" fi ``` Live build trace shows `which gcc` resolves to `/usr/bin/gcc`, not the distcc shim, even with BUILDENV=distcc and `update-distcc-symlinks` having run. ## Workaround applied on fermi Created `/usr/lib/distcc/bin` as a self-symlink (`ln -sfn . /usr/lib/distcc/bin`). With this in place, makepkg builds correctly distribute via distcc. This is a packaging hack and should be replaced by the proper layout in the PKGBUILD. ## Proposed fix Update the distcc-avahi PKGBUILD's package() and/or the bundled `update-distcc-symlinks` to install symlinks at `/usr/lib/distcc/bin/<compiler>` (mirroring Arch `extra/distcc`), then ship a backwards-compat empty stub or drop the historical Debian-style path entirely. Verify with: ``` sudo -u builder bash -c "cd <PKGBUILD> && makepkg -f --nodeps --noconfirm" # build()'s PATH should contain /usr/lib/distcc/bin/ and which gcc -> /usr/lib/distcc/bin/gcc ``` ## Discovered 2026-05-08 on fermi while diagnosing why fermi was not utilizing the distcc pool (tesla, dcc1, dcc2, boltzmann) despite all four workers advertising via Avahi and `DISTCC_HOSTS="+zeroconf"` set.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marfrit/marfrit-packages#6