Skip to content

Comments

json-c: 0.13.1 -> 0.14#90883

Merged
jtojnar merged 7 commits intoNixOS:stagingfrom
mmilata:json-c-0.14
Jul 2, 2020
Merged

json-c: 0.13.1 -> 0.14#90883
jtojnar merged 7 commits intoNixOS:stagingfrom
mmilata:json-c-0.14

Conversation

@mmilata
Copy link
Member

@mmilata 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.

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Jun 18, 2020
@ofborg ofborg bot requested review from dotlambda, lovek323 and philandstuff June 18, 2020 12:30
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. labels Jun 18, 2020
@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 June 18, 2020 15:43
@jtojnar
Copy link
Member

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.

@jtojnar
Copy link
Member

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
Member

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 June 19, 2020 12:01
@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
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 June 19, 2020 14:11
@FRidh
Copy link
Member

FRidh commented Jul 2, 2020

please rebase

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label 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
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 removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 2, 2020
@ofborg ofborg bot requested a review from Ma27 July 2, 2020 17:21
@jtojnar jtojnar merged commit b81594a into NixOS:staging Jul 2, 2020
@jtojnar
Copy link
Member

jtojnar commented Jul 2, 2020

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants