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

json-c: 0.13.1 -> 0.14 #90883

Merged
merged 7 commits into from Jul 2, 2020
Merged

json-c: 0.13.1 -> 0.14 #90883

merged 7 commits into from Jul 2, 2020

Conversation

@mmilata
Copy link
Member

mmilata commented Jun 18, 2020

Changes: https://github.com/json-c/json-c/blob/json-c-0.14-20200419/ChangeLog

Not really sure how to do library upgrade where some packages depend on the old version (until upstream fixes it). Most packages need no changes, I've included patches for those that have them in master, and made the rest to depend on the old version. Let me know is some other structure is preferred.

Motivation for this change

New version of popular library.

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.
@mmilata
Copy link
Member Author

mmilata commented Jun 18, 2020

@ofborg build freeradius ttyd drm_info tpm2-tss opae libvmi libmypaint libubox libndctl liblognorm google-compute-engine-oslogin hubicfuse snapper yubikey-personalization zmap mpw syslogng rsyslog uqmi ntopng fastd netifd nfstrace solvespace mypaint sway ptask pianobar girara fwts bluez health-check multipath-tools shogun postgis kernelshark

rpm-ostree was broken already

@mmilata mmilata marked this pull request as ready for review Jun 18, 2020
@jtojnar
Copy link
Contributor

jtojnar commented Jun 18, 2020

rpm-ostree should be fixed by 508a132

@mmilata
Copy link
Member Author

mmilata commented Jun 18, 2020

Thanks, with 508a132 rpm-ostree builds fine against json-c-0.14.

@FRidh FRidh added this to WIP in Staging via automation Jun 19, 2020
@jtojnar
Copy link
Contributor

jtojnar commented Jun 19, 2020

Looks great.

  • Checked the changes.
  • Checked the diffs of old and new directory trees, looking fine.
  • Checked that .pc file looks okay.

Some extra patches:

/nix/store/bh3r88sv8wckwmfyhjxbqmxcha0hrm8h-binutils-2.31.1/bin/ld: /nix/store/c2rlh7xa8fcgg7qz8pl76ipvvb172c6k-glibc-2.30/lib/crt1.o: in function `_start':
/build/glibc-2.30/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
collect2: error: ld returned 1 exit status
/nix/store/5hplxs3kprdp6v62qk3di6a1m1s1paiq-bash-4.4-p23/bin/bash: -I/nix/store/10wxs7b7pl3fi1z9byn87r0lf3wcnvqv-json-c-0.14-dev/include/json-c: No such file or directory
make[2]: *** [lib/CMakeFiles/zmaplib.dir/build.make:109: lib/CMakeFiles/zmaplib.dir/logger.c.o] Error 127
make[2]: *** Waiting for unfinished jobs....
/nix/store/bh3r88sv8wckwmfyhjxbqmxcha0hrm8h-binutils-2.31.1/bin/ld: /nix/store/c2rlh7xa8fcgg7qz8pl76ipvvb172c6k-glibc-2.30/lib/crt1.o: in function `_start':
/build/glibc-2.30/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
collect2: error: ld returned 1 exit status
/nix/store/5hplxs3kprdp6v62qk3di6a1m1s1paiq-bash-4.4-p23/bin/bash: -I/nix/store/10wxs7b7pl3fi1z9byn87r0lf3wcnvqv-json-c-0.14-dev/include/json-c: No such file or directory
make[2]: *** [lib/CMakeFiles/zmaplib.dir/build.make:83: lib/CMakeFiles/zmaplib.dir/blacklist.c.o] Error 127
/nix/store/bh3r88sv8wckwmfyhjxbqmxcha0hrm8h-binutils-2.31.1/bin/ld: /nix/store/c2rlh7xa8fcgg7qz8pl76ipvvb172c6k-glibc-2.30/lib/crt1.o: in function `_start':
/build/glibc-2.30/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
collect2: error: ld returned 1 exit status
/nix/store/5hplxs3kprdp6v62qk3di6a1m1s1paiq-bash-4.4-p23/bin/bash: -I/nix/store/10wxs7b7pl3fi1z9byn87r0lf3wcnvqv-json-c-0.14-dev/include/json-c: No such file or directory
make[2]: *** [lib/CMakeFiles/zmaplib.dir/build.make:122: lib/CMakeFiles/zmaplib.dir/pbm.c.o] Error 127
/nix/store/bh3r88sv8wckwmfyhjxbqmxcha0hrm8h-binutils-2.31.1/bin/ld: /nix/store/c2rlh7xa8fcgg7qz8pl76ipvvb172c6k-glibc-2.30/lib/crt1.o: in function `_start':
/build/glibc-2.30/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
collect2: error: ld returned 1 exit status
/nix/store/5hplxs3kprdp6v62qk3di6a1m1s1paiq-bash-4.4-p23/bin/bash: -I/nix/store/10wxs7b7pl3fi1z9byn87r0lf3wcnvqv-json-c-0.14-dev/include/json-c: No such file or directory
make[2]: *** [lib/CMakeFiles/zmaplib.dir/build.make:96: lib/CMakeFiles/zmaplib.dir/constraint.c.o] Error 127
make[1]: *** [CMakeFiles/Makefile2:139: lib/CMakeFiles/zmaplib.dir/all] Error 2

looks like a linking error but Void did not need any patch void-linux/void-packages@701b122

@jtojnar
Copy link
Contributor

jtojnar commented Jun 19, 2020

Building zmap with ninja gives us more info:

[4/56] Building C object lib/CMakeFiles/zmaplib.dir/pbm.c.o
FAILED: lib/CMakeFiles/zmaplib.dir/pbm.c.o
/nix/store/v1hcd1cswjgd11gan4czq7hada69iqkq-gcc-wrapper-9.3.0/bin/gcc -DJSON -I/nix/store/phl75ffn401sd3zyc4mj8fz4l2p2hmky-json-c-0.14-dev/include/json-c -Ilib -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1 -O2 -Wall -Wformat=2 -Wno-format-nonliteral -pedantic -fno-strict-aliasing -Wextra -Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls -Wnested-externs -Wbad-function-cast -Winit-self -Wmissing-noreturn -Wstack-protector /nix/store/phl75ffn401sd3zyc4mj8fz4l2p2hmky-json-c-0.14-dev/include;-I/nix/store/phl75ffn401sd3zyc4mj8fz4l2p2hmky-json-c-0.14-dev/include/json-c -std=gnu99 -O3 -DNDEBUG -MD -MT lib/CMakeFiles/zmaplib.dir/pbm.c.o -MF lib/CMakeFiles/zmaplib.dir/pbm.c.o.d -o lib/CMakeFiles/zmaplib.dir/pbm.c.o   -c lib/pbm.c
/nix/store/bh3r88sv8wckwmfyhjxbqmxcha0hrm8h-binutils-2.31.1/bin/ld: /nix/store/phl75ffn401sd3zyc4mj8fz4l2p2hmky-json-c-0.14-dev/include: file not recognized: Is a directory
collect2: error: ld returned 1 exit status
/bin/sh: -I/nix/store/phl75ffn401sd3zyc4mj8fz4l2p2hmky-json-c-0.14-dev/include/json-c: not found

Looks like the Cflags are joined using semicolong for some reason, curiously causing a linking error.

Removing the -I flag that was not there in 0.13 fixes the build. I wonder why other distros do not see the issue though:

diff --git a/pkgs/development/libraries/json-c/default.nix b/pkgs/development/libraries/json-c/default.nix
index 636c913c7d6..2805480588c 100644
--- a/pkgs/development/libraries/json-c/default.nix
+++ b/pkgs/development/libraries/json-c/default.nix
@@ -20,6 +20,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
+  postFixup = ''
+    substituteInPlace "$dev/lib/pkgconfig/json-c.pc" --replace 'Cflags: -I''${includedir}' 'Cflags:'
+  '';
+
   meta = with stdenv.lib; {
     description = "A JSON implementation in C";
     homepage    = "https://github.com/json-c/json-c/wiki";
@ofborg ofborg bot requested a review from romildo Jun 19, 2020
@mmilata
Copy link
Member Author

mmilata commented Jun 19, 2020

Nice, thanks for the clue. Looks like it's a bug in the upstream CMakefile.txt, opened a PR: zmap/zmap#609.

@mmilata mmilata force-pushed the mmilata:json-c-0.14 branch from e4f6804 to c7fcfa3 Jun 19, 2020
@mmilata
Copy link
Member Author

mmilata commented Jun 19, 2020

Only cryptsetup remains on 0.13.1 now. Unfortunately the upstream commits do not apply cleanly to our version. Looking at the difficulties Fedora had I'd suggest waiting for cryptsetup update to 2.3.3 (#91017) which is compatible with json-c-0.14.

@ofborg ofborg bot requested a review from Ma27 Jun 19, 2020
@Ma27
Ma27 approved these changes Jun 19, 2020
Staging automation moved this from WIP to Ready Jun 19, 2020
@FRidh
Copy link
Member

FRidh commented Jul 2, 2020

please rebase

@mmilata mmilata force-pushed the mmilata:json-c-0.14 branch from c7fcfa3 to a086bdd Jul 2, 2020
@mmilata mmilata force-pushed the mmilata:json-c-0.14 branch from a086bdd to 582591e Jul 2, 2020
@mmilata
Copy link
Member Author

mmilata commented Jul 2, 2020

Rebased & dropped the newsboat commit because it's no longer needed.

@mmilata mmilata force-pushed the mmilata:json-c-0.14 branch from 582591e to b39c3a1 Jul 2, 2020
@mmilata
Copy link
Member Author

mmilata commented Jul 2, 2020

Dropped the cryptsetup commit (#91017 is merged) and the json-c 0.13 version because it's no longer needed.

@ofborg ofborg bot requested a review from Ma27 Jul 2, 2020
@jtojnar jtojnar merged commit b81594a into NixOS:staging Jul 2, 2020
15 of 16 checks passed
15 of 16 checks passed
connman-ncurses, connman-ncurses.passthru.tests, json_c, json_c.passthru.tests, libu2f-host, libu2f-host.passthru.tests, libu2f-server, libu2f-server.passthru.tests, multipath-tools, multipath-tools.passthru.tests, yubikey-personalization, yubikey-personalization.passthru.tests, zmap, zmap.passthru.tests on aarch64-linux
Details
Evaluation Performance Report Evaluator Performance Report
Details
connman-ncurses, connman-ncurses.passthru.tests, json_c, json_c.passthru.tests, libu2f-host, libu2f-host.passthru.tests, libu2f-server, libu2f-server.passthru.tests, multipath-tools, multipath-tools.passthru.tests, yubikey-personalization, yubikey-personalization.passthru.tests, zmap, zmap.passthru.tests on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b39c3a1"; rev="b39c3a1a1772e2f40057de9f158fa08bc009b596"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b39c3a1"; rev="b39c3a1a1772e2f40057de9f158fa08bc009b596"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b39c3a1"; rev="b39c3a1a1772e2f40057de9f158fa08bc009b596"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b39c3a1"; rev="b39c3a1a1772e2f40057de9f158fa08bc009b596"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b39c3a1"; rev="b39c3a1a1772e2f40057de9f158fa08bc009b596"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b39c3a1"; rev="b39c3a1a1772e2f40057de9f158fa08bc009b596"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="b39c3a1"; rev="b39c3a1a1772e2f40057de9f158fa08bc009b596"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Staging automation moved this from Ready to Done Jul 2, 2020
@jtojnar
Copy link
Contributor

jtojnar commented Jul 2, 2020

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.