Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0ad: fix build by using gcc9Stdenv #108761

Merged
merged 2 commits into from Jan 20, 2021
Merged

Conversation

chvp
Copy link
Member

@chvp chvp commented Jan 8, 2021

Motivation for this change

The 0ad build fails since gcc 10 was made default with this error:

CommonConvert.cpp
DLL.cpp
Decompose.cpp
StdSkeletons.cpp
PSAConvert.cpp
XMLFix.cpp
precompiled.cpp
PMDConvert.cpp
Maths.cpp
GeomReindex.cpp
Linking Collada
/nix/store/4l1qrgxfy171bngpphp4p9wj7bhrlfn3-binutils-2.34/bin/ld: ../../../libraries/source/fcollada/lib/libFColladaSR.a(FAXInstanceExport.o): in function `FArchiveXML::WritePhysicsRigidBodyInstance(FCDObject*, _xmlNode*)':
FAXInstanceExport.cpp:(.text+0xc69): undefined reference to `_xmlNode* FArchiveXML::AddPhysicsParameter<FMVector3, 0>(_xmlNode*, char const*, FCDParameterAnimatableT<FMVector3, 0>&)'
/nix/store/4l1qrgxfy171bngpphp4p9wj7bhrlfn3-binutils-2.34/bin/ld: FAXInstanceExport.cpp:(.text+0xc7f): undefined reference to `_xmlNode* FArchiveXML::AddPhysicsParameter<FMVector3, 0>(_xmlNode*, char const*, FCDParameterAnimatableT<FMVector3, 0>&)'
collect2: error: ld returned 1 exit status
make[1]: *** [Collada.make:98: ../../../binaries/system/libCollada.so] Error 1
make: *** [Makefile:173: Collada] Error 2
error: --- Error ------------------------------------------------------------------------------- nix-build
builder for '/nix/store/ybyi0amjy8il1ycmkx6qmq0kshd13dnc-0ad-0.0.23b.drv' failed with exit code 2
error: --- Error ------------------------------------------------------------------------------- nix-build
1 dependencies of derivation '/nix/store/f9aab3b5b74s7lp5k0l541ajwfpg5hms-zeroad-0.0.23b.drv' failed to build

This changes the 0ad derivation to use the gcc9Stdenv.

Things done

Played a few games using this build method.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@aanderse
Copy link
Member

aanderse commented Jan 8, 2021

@IvarWithoutBones I didn't realize gcc10Stdenv is default now (yuzu).
@charvp sorry for the noise 😄

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 108761 run on x86_64-linux 1

1 package marked as broken and skipped:
  • zeroad

@ajs124 ajs124 mentioned this pull request Jan 12, 2021
10 tasks
@chvp
Copy link
Member Author

chvp commented Jan 20, 2021

Note that the package is not actually broken, it just depends on something marked as insecure.

@SuperSandro2000
Copy link
Member

builder for '/nix/store/sqn534jb4zl5sikbyshhf74z3hwi7bjj-0ad-0.0.23b.drv' failed with exit code 2; last 10 log lines:
  NetClient.cpp
  In file included from ../../../source/scriptinterface/ScriptVal.h:21,
                   from ../../../source/network/NetClient.h:24,
                   from ../../../source/network/NetClient.cpp:20:
  ../../../source/scriptinterface/ScriptTypes.h:60:10: fatal error: jspubtd.h: No such file or directory
     60 | #include "jspubtd.h"
        |          ^~~~~~~~~~~
  compilation terminated.
  make[1]: *** [network.make:139: obj/network_Release/NetClient.o] Error 1
  make: *** [Makefile:71: network] Error 2
cannot build derivation '/nix/store/nk6rfk14dk742mj0dgrz00k224pdwgcx-zeroad-0.0.23b.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/hci8pi1afrjlpg4xv52bk720z2c3zm7f-env.drv': 1 dependencies couldn't be built

@chvp
Copy link
Member Author

chvp commented Jan 20, 2021

Huh, that's weird. When I run NIXPKGS_ALLOW_INSECURE=1 NIX_PATH=nixpkgs=$PWD nix-build -A zeroad in a nixpkgs checkout of this branch the build succeeds.

Edit: When rebasing master I get the same error. I'll look into it.

@chvp
Copy link
Member Author

chvp commented Jan 20, 2021

Looks like 9bb3fcc broke the build by not replacing one pkgconfig that should have been replaced. I added a commit that fixes this.

9bb3fcc missed one important rename of pkgconfig, breaking the build.
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
# Workaround invalid pkg-config name for mozjs
mkdir pkg-config
ln -s ${spidermonkey_38}/lib/pkgconfig/* pkg-config/mozjs-38.pc
PKG_CONFIG_PATH="$PWD/pkgconfig:$PKG_CONFIG_PATH"
PKG_CONFIG_PATH="$PWD/pkg-config:$PKG_CONFIG_PATH"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deliberately left those out because most of the time they where wrong.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108761 run on x86_64-linux 1

1 package built:
  • zeroad

@SuperSandro2000 SuperSandro2000 merged commit 8008eba into NixOS:master Jan 20, 2021
@chvp chvp deleted the fix/zeroad-build branch February 5, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants