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

bzip2: 1.0.6 -> 1.0.8 #94969

Closed
wants to merge 2 commits into from
Closed

Conversation

jonringer
Copy link
Contributor

@jonringer jonringer commented Aug 8, 2020

Motivation for this change

closes #65029

Things done
  • 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.

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

nice work, thanks!

@FRidh FRidh added this to Needs review in Staging Aug 15, 2020
@jonringer jonringer force-pushed the bzip2-1.0.8-staging branch 2 times, most recently from 8a287c5 to 02a5c02 Compare August 23, 2020 17:11
@jonringer
Copy link
Contributor Author

@GrahamcOfBorg build bzip2

@jonringer
Copy link
Contributor Author

jonringer commented Aug 23, 2020

it's really annoying to build this package. essentially invalidates only of the early stages of gcc.

@jonringer
Copy link
Contributor Author

I tried for like 3 hours to get https://github.com/kholia/OSX-KVM working on my server. However, it seems that catalina requires network access to install. And I could never get the image to see a network device

@dasJ
Copy link
Member

dasJ commented Aug 29, 2020

@jonringer How did you try to test this? I have a mac laying around, I can try

@dasJ
Copy link
Member

dasJ commented Aug 29, 2020

Darwin nix-build . -A bzip2:

…
cc -shared -Wl,-install_name -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
cc -fpic -fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -o bzip2-shared bzip2.c libbz2.so.1.0.8
rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.8 libbz2.so.1.0
installing
install flags: SHELL=/nix/store/2ws9cmamvr7xyvdg4d2nnd1bmr1zjrrq-bootstrap-tools/bin/bash pkgconfigdir=/nix/store/yb73khzfnrh9wdqjm0bgp3zfr6l9ymg6-bzip2-1.0.8-dev/lib/pkgconfig m4datadir=/nix/store/yb73khzfnrh9wdqjm0bgp3zfr6l9ymg6-bzip2-1.0.8-dev/share/aclocal aclocaldir=/nix/store/yb73khzfnrh9wdqjm0bgp3zfr6l9ymg6-bzip2-1.0.8-dev/share/aclocal PREFIX=\$\(out\) install
rm -f libbz2.a
ar cq libbz2.a blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
ranlib libbz2.a
gcc -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64  -o bzip2 bzip2.o -L. -lbz2
/nix/store/2ws9cmamvr7xyvdg4d2nnd1bmr1zjrrq-bootstrap-tools/bin/bash: gcc: command not found
make: *** [Makefile:41: bzip2] Error 127
builder for '/nix/store/bfai3z8h29xa7yz2ngnqsadw7k0wmg9k-bzip2-1.0.8.drv' failed with exit code 2
cannot build derivation '/nix/store/m56wsp2pcyyii7ba5hr2y4ajbrif2csb-python3-minimal-3.8.5.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/yjid7jzqzdf8n9mxyhkfikmi8yx82fjk-libxml2-2.9.10.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/f6rhbw2hiwr223j7yz7x4y4g44ywn7s4-swift-corefoundation.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/k0pdppwa87bdvdfgqs5dq68ymp6z3kj3-xnu-osx-10.12.6.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7mna8akc4b0454xijafv48zywnzf90mq-Libsystem-osx-10.12.6.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/2vk5km8dgivvq97mijijwqi6zffjx636-bootstrap-stage2-stdenv-darwin.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ns9klpm7vgd0nv9a9djlphbfa7bv593w-bootstrap-stage2-stdenv-darwin.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d76vzpsb1rnvjlyhdy7izmrmqg3w2san-bootstrap-stage3-stdenv-darwin.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/09l7lp8bqc3xq7smjv59h0nx16i4yzn6-bzip2-1.0.8.drv': 1 dependencies couldn't be built
error: build of '/nix/store/09l7lp8bqc3xq7smjv59h0nx16i4yzn6-bzip2-1.0.8.drv' failed

@jonringer
Copy link
Contributor Author

@dasJ do you mind trying again?

Unrelated, it would be nice if it wasn't a PITA trying to emulate darwin.

# fix shared library options
postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace Makefile-libbz2_so \
--replace "soname" "install_name"
Copy link
Member

Choose a reason for hiding this comment

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

This isn't enough, the install_name should point to the absolute path of the library not just it's basename since darwin doesn't use rpath.

ext = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
moveToOutput bin $bin
ln -s libbz2${ext}.1.0 libbz2${ext}.1
Copy link
Member

Choose a reason for hiding this comment

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

The Makefile-libbz2_so build doesn't create a dylib so this shouldn't be conditional unless that's also changed.

Copy link
Member

Choose a reason for hiding this comment

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

this used to be the case, but either works fine

-r-xr-xr-x 1 root nixbld 77168 Jan  1  1970 libbz2.1.dylib
lrwxr-xr-x 1 root nixbld    14 Jan  1  1970 libbz2.dylib -> libbz2.1.dylib
-r-xr-xr-x 1 root nixbld   944 Jan  1  1970 libbz2.la

@jonringer
Copy link
Contributor Author

jonringer commented Aug 29, 2020

at this point, I'm fine with just leaving darwin with 1.0.6, and just focusing on linux. It doesn't make sense for me to throw darts on a platform I can't locally test and verify.

EDIT: Also my darwin-specific knowledge is very small, as I don't use that platform.

@LnL7
Copy link
Member

LnL7 commented Aug 29, 2020

I took a stab at it here 35560e8 but yeah, I'm not sure it's worth it given the 1.1 situation.

@FRidh
Copy link
Member

FRidh commented Aug 29, 2020

Right. Let's not bother with 1.0.8. We can however see if we can get 1.1.x in as additional package and then try to migrate to that for 21.03.

@FRidh FRidh mentioned this pull request Aug 29, 2020
10 tasks
FRidh added a commit to FRidh/nixpkgs that referenced this pull request Aug 29, 2020
bzip2 has been unmaintained for a long time. For a while now, there has
been maintainership, resulting in the release of 1.0.8. At the same
time, there is now a master branch (version 1.1.x) which supports meson
and cmake as build systems.

This commit adds the current HEAD of the master branch (1.1.x). In the
future we may want to use this one instead of the older and patched
1.0.6 we currently have.

Related:
- NixOS#65029
- NixOS#94969
@jonringer
Copy link
Contributor Author

pinned darwin to the current 1.0.6, then bumped linux to 1.0.8

@ofborg ofborg bot removed the 6.topic: stdenv Standard environment label Aug 29, 2020
@dasJ
Copy link
Member

dasJ commented Aug 29, 2020

Looks a lot better now:

…
post-installation fixup
Patching '/nix/store/63hsj1vlibwzwfcq1cm1ph0jj3hbbbs1-bzip2-1.0.6.0.1-dev/lib/pkgconfig/bzip2.pc' includedir to output /nix/store/63hsj1vlibwzwfcq1cm1ph0jj3hbbbs1-bzip2-1.0.6.0.1-dev
strip is /nix/store/2ws9cmamvr7xyvdg4d2nnd1bmr1zjrrq-bootstrap-tools/bin/strip
stripping (with command strip and flags -S) in /nix/store/cb05xkqizid3qfwba1fxy6rr62dspn9b-bzip2-1.0.6.0.1-bin/bin
patching script interpreter paths in /nix/store/cb05xkqizid3qfwba1fxy6rr62dspn9b-bzip2-1.0.6.0.1-bin
/nix/store/cb05xkqizid3qfwba1fxy6rr62dspn9b-bzip2-1.0.6.0.1-bin/bin/bzmore: interpreter directive changed from "/bin/sh" to "/nix/store/q1vgix0ybvih2dz98ifxzpyfj2fy8hfi-bash-4.4-p23/bin/sh"
/nix/store/cb05xkqizid3qfwba1fxy6rr62dspn9b-bzip2-1.0.6.0.1-bin/bin/bzgrep: interpreter directive changed from "/bin/sh" to "/nix/store/q1vgix0ybvih2dz98ifxzpyfj2fy8hfi-bash-4.4-p23/bin/sh"
/nix/store/cb05xkqizid3qfwba1fxy6rr62dspn9b-bzip2-1.0.6.0.1-bin/bin/bzdiff: interpreter directive changed from "/bin/sh" to "/nix/store/q1vgix0ybvih2dz98ifxzpyfj2fy8hfi-bash-4.4-p23/bin/sh"
strip is /nix/store/2ws9cmamvr7xyvdg4d2nnd1bmr1zjrrq-bootstrap-tools/bin/strip
stripping (with command strip and flags -S) in /nix/store/63hsj1vlibwzwfcq1cm1ph0jj3hbbbs1-bzip2-1.0.6.0.1-dev/lib
patching script interpreter paths in /nix/store/63hsj1vlibwzwfcq1cm1ph0jj3hbbbs1-bzip2-1.0.6.0.1-dev
strip is /nix/store/2ws9cmamvr7xyvdg4d2nnd1bmr1zjrrq-bootstrap-tools/bin/strip
stripping (with command strip and flags -S) in /nix/store/lzq29qn1j0y8icf473lsmwx06ifvbvq3-bzip2-1.0.6.0.1/lib
patching script interpreter paths in /nix/store/lzq29qn1j0y8icf473lsmwx06ifvbvq3-bzip2-1.0.6.0.1
gzipping man pages under /nix/store/pm6dq1w7wyadsfzba3yfpf4fd278i9ql-bzip2-1.0.6.0.1-man/share/man/
strip is /nix/store/2ws9cmamvr7xyvdg4d2nnd1bmr1zjrrq-bootstrap-tools/bin/strip
patching script interpreter paths in /nix/store/pm6dq1w7wyadsfzba3yfpf4fd278i9ql-bzip2-1.0.6.0.1-man
/nix/store/cb05xkqizid3qfwba1fxy6rr62dspn9b-bzip2-1.0.6.0.1-bin

nix-build . -A bzip2 1598.73s user 282.17s system 266% cpu 11:45.32 total

@FRidh
Copy link
Member

FRidh commented Aug 29, 2020

Cross is broken though (riscv64). I suggest not going further with this.

@jonringer
Copy link
Contributor Author

jonringer commented Aug 29, 2020

Cross is broken though (riscv64). I suggest not going further with this.

how are you testing this? pkgs.Cross.risv64?

@FRidh
Copy link
Member

FRidh commented Aug 30, 2020

$ nix-build -A pkgsCross.riscv64.bzip2

FRidh added a commit that referenced this pull request Aug 30, 2020
bzip2 has been unmaintained for a long time. For a while now, there has
been maintainership, resulting in the release of 1.0.8. At the same
time, there is now a master branch (version 1.1.x) which supports meson
and cmake as build systems.

This commit adds the current HEAD of the master branch (1.1.x). In the
future we may want to use this one instead of the older and patched
1.0.6 we currently have.

Related:
- #65029
- #94969
@FRidh
Copy link
Member

FRidh commented Oct 6, 2020

Closing this because 1.0.8 is not worth it (see earlier comments).

@FRidh FRidh closed this Oct 6, 2020
Staging automation moved this from Needs review to Done Oct 6, 2020
@jonringer jonringer deleted the bzip2-1.0.8-staging branch October 6, 2020 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants