gpsd: fix cross-compilation#182175
Merged
Conversation
This comment was marked as duplicate.
This comment was marked as duplicate.
bjornfor
reviewed
Jul 20, 2022
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
|
Author
Author
This comment was marked as duplicate.
This comment was marked as duplicate.
sorki
approved these changes
Aug 14, 2022
Member
sorki
left a comment
There was a problem hiding this comment.
Lovely! Thank you! I've wasted many hours trying to fix this.
smancill
requested changes
Aug 15, 2022
Author
|
I have updated the commit message. |
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: SCons/scons#1723 https://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: https://gitlab.com/gpsd/gpsd/-/commit/d0558636038e18d90eb886f668ff5004538f7839 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] ```
bjornfor
approved these changes
Aug 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Builds of
pkgsCross.*.gpsdcurrently fail with:The derivation already includes a patch that fiddles with the
envarray; this might have something to do with it.Fortunately
CCVERSIONis never used for anything other than printing during the build. So we can replaceCCVERSIONwithCC.With this commit,
pkgsCross.mips64el-linux-gnuabi64.gpsdandpkgsCross.powernv.gpsdbuild correctly on x86_64.Things done
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)