Prior to this commit, builds of `pkgsCross.*.gpsd` were failing.
`gpsd` expects `CCVERSION` to be set, and fails if it is not set.
Scons does not guarantee that `CCVERSION` will be set, nor does it
specify under what circumstances it will or will not be set: "This may
or may not be set, depending on the specific C compiler being used."
https://scons.org/doc/production/HTML/scons-man.html#cv-CCVERSION
Apparently cross-compilation triggers one of those unspecified
circumstances. There are several bug reports to scons relating to
this:
https://github.com/SCons/scons/issues/1723https://github.com/SCons/scons/issues?q=is%3Aissue+ccversion+is%3Aclosed
`gpsd` does not use `CCVERSION` for any purpose other than printing a
log message at the start of the build:
d055863603
This commit modifies the log message, replacing `env['CCVERSION']`
with `env['CC']`, since `CC` is always set when using nixpkgs'
standard builder.
With this commit, `pkgsCross.mips64el-linux-gnuabi64.gpsd` and
`pkgsCross.powernv.gpsd` build correctly on x86_64. Prior to this
commit, they would fail with:
```
scons: Reading SConscript files ...
scons version: 4.1.0
scons is running under Python version: 3.10.5.final.0
gpsd version: 3.23.1
This system is: linux
KeyError: 'CCVERSION':
File "/build/gpsd-3.23.1/SConstruct", line 69:
SConscript('SConscript',
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Script/SConscript.py", line 654:
return method(*args, **kw)
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Script/SConscript.py", line 591:
return _SConscript(self.fs, *files, **subst_kw)
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Script/SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/build/gpsd-3.23.1/gpsd-3.23.1/SConscript", line 883:
announce("cc is %s, version %s" % (env['CC'], env['CCVERSION']))
File "/nix/store/0vmqv6f2s8bj2a50gk8g05jcb5scnifb-scons-4.1.0/lib/python3.10/site-packages/SCons/Environment.py", line 388:
return self._dict[key]
```
While it might seem odd, 0.0.0.0/0 or ::/0 gateways are valid and
commonly used on point-to-point links (e.g. a wireguard tunnel) to
indicate that all traffic needs to be sent to a given interface.
systemd-networkd actually documents this as a valid configuration in its
man pages [1].
Tested to do the right thing in one of my NixOS containers using
a Wireguard tunnel as its default route.
[1] https://www.freedesktop.org/software/systemd/man/systemd.network.html#DefaultRouteOnDevice=