zerotier / zeronsd

A DNS server for ZeroTier users
https://zerotier.com
BSD 3-Clause "New" or "Revised" License
493 stars 56 forks source link

Build requires rustfmt installed via rustup #228

Open xokdvium opened 7 months ago

xokdvium commented 7 months ago

I've encountered the same issue as mentioned in the thread here: https://discuss.zerotier.com/t/zeronsd-build-fail-how-to-fix/8222 (using 5.2.0 release). Since this issue is long closed, but the failure persists I'll post this here.

After some investigation it turns out that https://github.com/oxidecomputer/rustfmt-wrapper/blob/c5335c713dfd6d2a2ef917a3d0461c51f03b55db/src/lib.rs#L22 requires that either a RUSTFMT environment variable is provided or rustfmt is installed via rustup. So for non-rustup toolchains it's sufficient to set RUSTFMT to point to the correct executable. It would be really nice if this limitation were somehow documented, since not all CI builds install rustfmt as a native build dependency. I don't see a way to skip formatting with progenitor-impl but maybe I'm blind and there's a magic env variable that does that.

Hope this helps anyone with the same problem.