Skip to content

pkgsStatic.cctz: fix build#180325

Merged
superherointj merged 1 commit intoNixOS:masterfrom
maj0e:patch-2
Sep 21, 2022
Merged

pkgsStatic.cctz: fix build#180325
superherointj merged 1 commit intoNixOS:masterfrom
maj0e:patch-2

Conversation

@maj0e
Copy link
Contributor

@maj0e maj0e commented Jul 6, 2022

Description of changes

The static build of cctz

nix-build --pure ./nixpkgs -A pkgsStatic.cctz

was failing at the installPhase with:

install flags: SHELL=/nix/store/pxfxgmas6iyqb6dq7d7d7kvv1vld4r89-bash-interactive-5.1-p16/bin/bash PREFIX=\$\(out\) install_hdrs install_shared_lib
install -d /nix/store/jvrlakd1800qbdcailhxym016p095hi3-cctz-static-x86_64-unknown-linux-musl-2.3/include/cctz
install -m 644 -p include/cctz/civil_time.h include/cctz/civil_time_detail.h include/cctz/time_zone.h include/cctz/zone_info_source.h /nix/store/jvrlakd1800qbdcailhxym016p095hi3-cctz-static-x86_64-unknown-linux-musl-2.3/include/cctz
x86_64-unknown-linux-musl-g++ -O3 -g -Wall -Iinclude -std=c++11  -fPIC -MMD  -O3  -O3 -shared -o libcctz.so civil_time_detail.o time_zone_fixed.o time_zone_format.o time_zone_if.o time_zone_impl.o time_zone_info.o time_zone_libc.o time_zone_lookup.o time_zone_posix.o zone_info_source.o
/nix/store/57mlf0zidj36xx7ikfln9km5ymzgxv1z-x86_64-unknown-linux-musl-binutils-2.38/bin/x86_64-unknown-linux-musl-ld: /nix/store/jnin5hhg78y0cww1ima7d8l9xdh74s71-x86_64-unknown-linux-musl-stage-final-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-musl/11.3.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/57mlf0zidj36xx7ikfln9km5ymzgxv1z-x86_64-unknown-linux-musl-binutils-2.38/bin/x86_64-unknown-linux-musl-ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status

The install targets were "install_hdrs" and "install_shared_lib".
The later is obviously not correct for a static build and was changed to
"install_lib" (corresponds to libcctz.a) for that case.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@maj0e maj0e changed the title Fix static build for cctz cctz: Fix static build Jul 6, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 6, 2022
@superherointj
Copy link
Contributor

superherointj commented Sep 9, 2022

Please:

  • squash commits
  • commit message title should have been be: cctz: fix static build (you can keep the long commit message, that is fine.)

@superherointj superherointj changed the title cctz: Fix static build cctz: fix static build Sep 9, 2022
@superherointj
Copy link
Contributor

I confirm pkgsStatic.cctz does not build at master. But builds with this fix.

@maj0e Can you update what I asked so we can merge this?

@superherointj superherointj added awaiting_changes 6.topic: static Static builds (e.g. pkgsStatic) labels Sep 9, 2022
@superherointj
Copy link
Contributor

buildInputs = lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Foundation;

You have not updated here.

@superherointj
Copy link
Contributor

Squash commits.

@maj0e
Copy link
Contributor Author

maj0e commented Sep 13, 2022

nix-build --pure ./ -A pkgsStatic.cctz
error: Function called without required argument "Foundation" at /home/markus/Daten/Projekte/Server/nixpkgs/pkgs/development/libraries/cctz/default.nix:1

I get an error, when testing locally.

@ofborg ofborg bot added the 8.has: clean-up This PR removes packages or removes other cruft label Sep 13, 2022
@maj0e
Copy link
Contributor Author

maj0e commented Sep 13, 2022

I squashed the commits. As I mentioned, I get an error for the argument Foundation, when I test it locally. CI is ok, though.

@superherointj
Copy link
Contributor

II get an error for the argument Foundation, when I test it locally.

I confirm problem. @SuperSandro2000

The install targets were "install_hdrs"
and "install_shared_lib". The later is obviously not
correct for a static build and was changed to
"install_lib" (corresponds to libcctz.a) for that case.
@superherointj superherointj changed the title cctz: fix static build pkgsStatic.cctz: fix build Sep 21, 2022
@superherointj
Copy link
Contributor

superherointj commented Sep 21, 2022

Ideally commit should have been: pkgsStatic.cctz: fix build

CI should build as static. See:
https://github.com/NixOS/ofborg/#automatic-building

But I have no objection in merging this as it is.

I have opened an issue here to clarify this:
NixOS/ofborg#613

@superherointj superherointj merged commit e02ea2e into NixOS:master Sep 21, 2022
@Janik-Haag Janik-Haag added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: static Static builds (e.g. pkgsStatic) 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants