Skip to content

Comments

Update nix pin with make nixpkgs#618

Closed
hswong3i wants to merge 1 commit intocontainers:mainfrom
alvistack:master-linux-amd64
Closed

Update nix pin with make nixpkgs#618
hswong3i wants to merge 1 commit intocontainers:mainfrom
alvistack:master-linux-amd64

Conversation

@hswong3i
Copy link
Contributor

@hswong3i hswong3i commented Mar 7, 2021

  • Bugfix make nixpkgs which pin with branch nixos-21.05
  • Code lint with nixpkgs-fmt
  • Code sync between x86_64 and aarch64

Signed-off-by: Wong Hoi Sing Edison hswong3i@pantarei-design.com

@giuseppe
Copy link
Member

giuseppe commented Mar 8, 2021

tests are failing

@hswong3i hswong3i force-pushed the master-linux-amd64 branch 2 times, most recently from 65b64d3 to bd1f35c Compare March 12, 2021 07:31
@hswong3i
Copy link
Contributor Author

@giuseppe @saschagrunert similar as cri-o/cri-o#4630 (comment), systemd-minimal-247.3-aarch64-unknown-linux-gnu.drv is failed but amd64 version looks good for me :-S

See https://github.com/containers/crun/pull/618/checks?check_run_id=2093026025#step:6:31716

systemd-minimal> OSError: [Errno 8] Exec format error: '/tmp/nix-build-systemd-minimal-247.3-aarch64-unknown-linux-gnu.drv-0/source/tools/xml_helper.py'
builder for '/nix/store/qg481rzr1mmpwxby28g7hwzlfjg4qzig-systemd-minimal-247.3-aarch64-unknown-linux-gnu.drv' failed with exit code 2; last 10 log lines:
      pc, self.stdout, self.stderr = self.run_command(cmd, args, env, source_dir, build_dir, subdir, mesonintrospect, in_builddir, check)
    File "/nix/store/fk194v974hasc4js9m1xy46bjphlhk4z-meson-0.56.0/lib/python3.8/site-packages/mesonbuild/interpreter.py", line 200, in run_command
      p, o, e = Popen_safe(command_array, stdout=stdout, env=child_env, cwd=cwd)
    File "/nix/store/fk194v974hasc4js9m1xy46bjphlhk4z-meson-0.56.0/lib/python3.8/site-packages/mesonbuild/mesonlib.py", line 1217, in Popen_safe
      p = subprocess.Popen(args, universal_newlines=True, close_fds=False,
    File "/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/subprocess.py", line 858, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/nix/store/yl69v76azrz4daiqksrhb8nnmdiqdjg9-python3-3.8.8/lib/python3.8/subprocess.py", line 1706, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  OSError: [Errno 8] Exec format error: '/tmp/nix-build-systemd-minimal-247.3-aarch64-unknown-linux-gnu.drv-0/source/tools/xml_helper.py'
cannot build derivation '/nix/store/bj1zjs7nyqvw8v7plqcj5vn165ydh77m-lvm2-2.03.11-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d7hyjvy9qpina79zvnhrcdrr7h10dhky-cryptsetup-2.3.4-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/jw734f8kyhs66kwp37sgkf2gmihvkh6z-systemd-247.3-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7snfpjp0a5klnvlznbkfp4qy9sziv810-crun-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
error: build of '/nix/store/7snfpjp0a5klnvlznbkfp4qy9sziv810-crun-aarch64-unknown-linux-gnu.drv' failed

@saschagrunert
Copy link
Member

It seems to fail on arm64, not amd64. Or am I missing anything?

@hswong3i
Copy link
Contributor Author

It seems to fail on arm64, not amd64. Or am I missing anything?

Yes, the build only failed for arm64, amd64 is fine.

@giuseppe
Copy link
Member

@hswong3i had a chance to look at this again?

@saschagrunert
Copy link
Member

Looks like this is the patch we have to wait for: NixOS/nixpkgs#117914

@hswong3i hswong3i force-pushed the master-linux-amd64 branch 2 times, most recently from d502508 to 449df01 Compare April 3, 2021 14:41
@hswong3i
Copy link
Contributor Author

hswong3i commented Apr 3, 2021

@saschagrunert I fix the make nixpkgs to pin branch nixos-20.09 correctly ;-)

@hswong3i hswong3i force-pushed the master-linux-amd64 branch from 449df01 to b445f77 Compare April 4, 2021 01:15
@hswong3i hswong3i force-pushed the master-linux-amd64 branch 4 times, most recently from 475d26b to 6aa7e3c Compare April 16, 2021 00:20
@hswong3i hswong3i force-pushed the master-linux-amd64 branch 2 times, most recently from 1ff0dd6 to c048460 Compare April 21, 2021 01:31
@hswong3i hswong3i force-pushed the master-linux-amd64 branch 3 times, most recently from 925f9cb to 527a99a Compare May 6, 2021 03:51
@hswong3i
Copy link
Contributor Author

hswong3i commented May 6, 2021

@saschagrunert may this PR have your kindly review and approval?

@saschagrunert
Copy link
Member

The static build is still failing.

@hswong3i
Copy link
Contributor Author

hswong3i commented May 7, 2021

The static build is still failing.

Error from build log (see https://github.com/containers/crun/pull/618/checks?check_run_id=2515014267) show that it is related to aarch64-linux but not x86_64-linux.

My local build for x86_64-linux is totally fine without any error :-S

@saschagrunert aarch64-linux support seems introduced by 8d0ebf6, would you mind to fix it onward?

2021-05-06T05:39:48.8050967Z perl5.32.0-Module-Build> Compilation failed in require at /nix/store/kv9h22a8hffmd3j64dy9v9c95lbgxcf3-perl-5.32.0-aarch64-unknown-linux-gnu/lib/perl5/5.32.0/aarch64-linux/Data/Dumper.pm line 304.
2021-05-06T05:39:48.8078754Z perl5.32.0-Module-Build> Couldn't run Build.PL: No such file or directory at lib/Module/Build/Compat.pm line 341.
2021-05-06T05:39:48.8255703Z builder for '/nix/store/2kx3sgx8yay6sn5p5s9mibjbq9zcwyc7-perl5.32.0-Module-Build-0.4231-aarch64-unknown-linux-gnu.drv' failed with exit code 2; last 10 log lines:
2021-05-06T05:39:48.8257765Z   inc_bundling_support....disabled
2021-05-06T05:39:48.8258213Z     requires:
2021-05-06T05:39:48.8258620Z       ! inc::latest is not installed
2021-05-06T05:39:48.8259008Z   
2021-05-06T05:39:48.8259530Z   ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the versions
2021-05-06T05:39:48.8260314Z   of the modules indicated above before proceeding with this installation
2021-05-06T05:39:48.8260823Z   
2021-05-06T05:39:48.8261229Z   Attempt to reload Scalar/Util.pm aborted.
2021-05-06T05:39:48.8263041Z   Compilation failed in require at /nix/store/kv9h22a8hffmd3j64dy9v9c95lbgxcf3-perl-5.32.0-aarch64-unknown-linux-gnu/lib/perl5/5.32.0/aarch64-linux/Data/Dumper.pm line 304.
2021-05-06T05:39:48.8264852Z   Couldn't run Build.PL: No such file or directory at lib/Module/Build/Compat.pm line 341.
2021-05-06T05:39:48.8289345Z cannot build derivation '/nix/store/vn76fqcks1ggzyf56sv6ksy8wzlca183-perl5.32.0-HTML-TagCloud-0.38-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
2021-05-06T05:39:48.9619034Z cannot build derivation '/nix/store/pk430ikarq3scbdhq7zsiyv5jr7scl8d-git-2.29.3-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
2021-05-06T05:39:53.3440034Z cannot build derivation '/nix/store/yphz95iagrm9rxy894p1pvv1kjsxkf5q-crun-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
2021-05-06T05:39:53.3546899Z error: build of '/nix/store/yphz95iagrm9rxy894p1pvv1kjsxkf5q-crun-aarch64-unknown-linux-gnu.drv' failed
2021-05-06T05:39:53.7359666Z ##[error]Process completed with exit code 100.

@hswong3i hswong3i force-pushed the master-linux-amd64 branch 3 times, most recently from c106b6b to f5295d3 Compare June 3, 2021 08:32
@saschagrunert
Copy link
Member

@saschagrunert aarch64-linux support seems introduced by 8d0ebf6, would you mind to fix it onward?

I'd prefer fixing it before merging this PR.

@hswong3i
Copy link
Contributor Author

hswong3i commented Jun 3, 2021

@saschagrunert with updated to nixos-21.05 we are now ready for criu with aarch64, but x86_64 now coming with following error:

$ nix build -f nix/ -L 2>&1 | tail -n 50
systemd> Run-time dependency libapparmor found: YES 3.0.1
systemd> Run-time dependency polkit-gobject-1 found: NO (tried pkgconfig and cmake)
systemd> Library acl found: YES
systemd> Run-time dependency audit found: YES 2.8.5
systemd> Run-time dependency blkid found: YES 2.36.2
systemd> Run-time dependency libkmod found: YES 27
systemd> Library pam found: YES
systemd> Library pam_misc found: YES
systemd> Run-time dependency libmicrohttpd found: YES 0.9.71
systemd> Run-time dependency libcryptsetup found: YES 2.3.5
systemd> Checking for function "crypt_set_metadata_size" with dependency libcryptsetup: YES
systemd> Checking for function "crypt_activate_by_signed_key" with dependency libcryptsetup: YES
systemd> Run-time dependency libcurl found: YES 7.76.1
systemd> Run-time dependency libidn2 found: YES 2.3.1
systemd> Run-time dependency libiptc found: YES 1.8.7
systemd> Run-time dependency libqrencode found: NO (tried pkgconfig and cmake)
systemd> Library gcrypt found: YES
systemd> Library gpg-error found: YES
systemd> Run-time dependency gnutls found: NO (tried pkgconfig and cmake)
systemd> Run-time dependency openssl found: YES 1.1.1k
systemd> Run-time dependency p11-kit-1 found: NO (tried pkgconfig and cmake)
systemd> Run-time dependency libfido2 found: NO (tried pkgconfig and cmake)
systemd> Run-time dependency libdw found: NO (tried pkgconfig and cmake)
systemd> Run-time dependency zlib found: YES 1.2.11
systemd> Library bz2 found: YES
systemd> Run-time dependency liblzma found: YES 5.2.5
systemd> Run-time dependency liblz4 found: YES 1.9.3
systemd> Run-time dependency libzstd found: NO (tried pkgconfig and cmake)
systemd> Run-time dependency xkbcommon found: NO (tried pkgconfig and cmake)
systemd> Run-time dependency libpcre2-8 found: YES 10.36
systemd> Run-time dependency glib-2.0 found: NO
systemd> meson.build:1284:8: ERROR: Could not generate cargs for glib-2.0:
systemd> Package libpcre was not found in the pkg-config search path.
systemd> Perhaps you should add the directory containing `libpcre.pc'
systemd> to the PKG_CONFIG_PATH environment variable
systemd> Package 'libpcre', required by 'glib-2.0', not found
systemd> A full log can be found at /tmp/nix-build-systemd-247.6.drv-0/source/build/meson-logs/meson-log.txt
builder for '/nix/store/nn9lc637083d25ipr3hw6vn2cjh2aa67-systemd-247.6.drv' failed with exit code 1; last 10 log lines:
  Run-time dependency glib-2.0 found: NO 
  
  meson.build:1284:8: ERROR: Could not generate cargs for glib-2.0:
  Package libpcre was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libpcre.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'libpcre', required by 'glib-2.0', not found
  
  
  A full log can be found at /tmp/nix-build-systemd-247.6.drv-0/source/build/meson-logs/meson-log.txt
cannot build derivation '/nix/store/zfr6wsngglvj1agqllbvhz9lzsg9g3s3-crun.drv': 1 dependencies couldn't be built
error: build of '/nix/store/zfr6wsngglvj1agqllbvhz9lzsg9g3s3-crun.drv' failed

Any hints or idea?

@hswong3i
Copy link
Contributor Author

hswong3i commented Jun 4, 2021

ok this line from NixOS/nixpkgs@5f8a741 generate the glib problem for systemd (https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/systemd/default.nix#L328):

  mesonFlags = [
    "-Dglib=${lib.boolToString (glib != null)}"
  ];

Simply hard-code it as false could solve the problem for x86_64, now testing for aarch64

@hswong3i hswong3i force-pushed the master-linux-amd64 branch 9 times, most recently from 62c00b7 to 06ee575 Compare June 10, 2021 02:36
@giuseppe
Copy link
Member

is m4 not installed?


2021-06-10T04:35:00.4836104Z crun-aarch64-unknown-linux-gnu> libtoolize:   error: One of these is required:
2021-06-10T04:35:00.4837372Z crun-aarch64-unknown-linux-gnu> libtoolize:                 gm4 gnum4 m4
2021-06-10T04:35:00.4852660Z crun-aarch64-unknown-linux-gnu> libtoolize:   error: Please install GNU M4, or 'export M4=/path/to/gnu/m4'.
2021-06-10T04:35:00.4856175Z crun-aarch64-unknown-linux-gnu> autoreconf: error: libtoolize failed with exit status: 1
2021-06-10T04:35:00.5156257Z builder for '/nix/store/a8r7p1qwq6h3j8f5j1yw52dz1lsm3k1j-crun-aarch64-unknown-linux-gnu.drv' failed with exit code 1; last 10 log lines:
2021-06-10T04:35:00.5158413Z   autoreconf: configure.ac: adding subdirectory yajl to autoreconf
2021-06-10T04:35:00.5159275Z   autoreconf: Entering directory 'yajl'
2021-06-10T04:35:00.5159847Z   autoreconf: configure.ac: not using Gettext
2021-06-10T04:35:00.5160557Z   autoreconf: running: aclocal --force 
2021-06-10T04:35:00.5161102Z   autoreconf: configure.ac: tracing
2021-06-10T04:35:00.5161802Z   autoreconf: running: libtoolize --copy --force
2021-06-10T04:35:00.5162552Z   libtoolize:   error: One of these is required:
2021-06-10T04:35:00.5163065Z   libtoolize:                 gm4 gnum4 m4
2021-06-10T04:35:00.5163842Z   libtoolize:   error: Please install GNU M4, or 'export M4=/path/to/gnu/m4'.
2021-06-10T04:35:00.5164534Z   autoreconf: error: libtoolize failed with exit status: 1
2021-06-10T04:35:00.5283373Z error: build of '/nix/store/a8r7p1qwq6h3j8f5j1yw52dz1lsm3k1j-crun-aarch64-unknown-linux-gnu.drv' failed
2021-06-10T04:35:00.9376208Z ##[error]Process completed with exit code 100.

@hswong3i
Copy link
Contributor Author

hswong3i commented Jun 11, 2021

is m4 not installed?

I also did a try to manually install gnum4 but no luck...

Here are the diff in between, with no specific handling for m4 at amd64:

$ diff -urpNwbB nix/default.nix nix/default-arm64.nix 
--- nix/default.nix	2021-06-09 22:03:46.723085852 +0800
+++ nix/default-arm64.nix	2021-06-09 22:03:46.723085852 +0800
@@ -1,9 +1,11 @@
-{ system ? builtins.currentSystem, enableSystemd ? true }:
+{ enableSystemd ? true }:
 let
   pkgs = (import ./nixpkgs.nix {
+    crossSystem = {
+      config = "aarch64-unknown-linux-gnu";
+    };
     config = {
       packageOverrides = pkg: {
-        criu = (static pkg.criu);
         gpgme = (static pkg.gpgme);
         libassuan = (static pkg.libassuan);
         libgpgerror = (static pkg.libgpgerror);
@@ -29,7 +31,7 @@ let
           configureFlags = [
             "--enable-confdir=/etc"
             "--enable-usbdropdir=/var/lib/pcsc/drivers"
-            "--with-systemdsystemunitdir=${placeholder "bin"}/lib/systemd/system"
+            "--disable-libsystemd"
           ];
           buildInputs = [ pkgs.python3 pkgs.udev pkgs.dbus pkgs.systemd ];
         });
@@ -76,7 +78,7 @@ let
     enableParallelBuilding = true;
     outputs = [ "out" ];
     nativeBuildInputs = [ autoreconfHook bash gitMinimal pkg-config python3 which ];
-    buildInputs = [ glibc glibc.static glib criu libcap libseccomp protobufc systemd yajl ];
+    buildInputs = [ glibc glibc.static glib libcap libseccomp protobufc systemd yajl ];
     configureFlags = [ "--enable-static" ]
       ++ lib.optional (!enableSystemd) [ "--disable-systemd" ];
     prePatch = ''
@@ -84,7 +86,7 @@ let
       export LDFLAGS='-s -w -static-libgcc -static'
       export EXTRA_LDFLAGS='-s -w -linkmode external -extldflags "-static -lm"'
       export CRUN_LDFLAGS='-all-static'
-      export LIBS='${criu}/lib/libcriu.a ${glibc.static}/lib/libc.a ${glibc.static}/lib/libpthread.a ${glibc.static}/lib/librt.a ${lib.getLib libcap}/lib/libcap.a ${lib.getLib libseccomp}/lib/libseccomp.a ${protobufc}/lib/libprotobuf-c.a ${protobuf}/lib/libprotobuf.a ${lib.getLib systemd}/lib/libsystemd.a ${yajl}/lib/libyajl_s.a'
+      export LIBS='${glibc.static}/lib/libc.a ${glibc.static}/lib/libpthread.a ${glibc.static}/lib/librt.a ${lib.getLib libcap}/lib/libcap.a ${lib.getLib libseccomp}/lib/libseccomp.a ${protobufc}/lib/libprotobuf-c.a ${protobuf}/lib/libprotobuf.a ${lib.getLib systemd}/lib/libsystemd.a ${yajl}/lib/libyajl_s.a'
     '';
     buildPhase = ''
       patchShebangs .

@hswong3i hswong3i force-pushed the master-linux-amd64 branch 3 times, most recently from b0a0d5b to 578de62 Compare June 17, 2021 14:41
@rhatdan
Copy link
Member

rhatdan commented Jun 22, 2021

@hswong3i Is the artifact failure a problem?

@hswong3i hswong3i force-pushed the master-linux-amd64 branch 2 times, most recently from 45784eb to cbb7c22 Compare June 29, 2021 05:31
  - Bugfix `make nixpkgs` which pin with branch `nixos-21.05`
  - Code lint with `nixpkgs-fmt`
  - Code sync between x86\_64 and aarch64

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
@hswong3i hswong3i force-pushed the master-linux-amd64 branch from cbb7c22 to e4d7d9a Compare July 14, 2021 14:08
@rhatdan
Copy link
Member

rhatdan commented Jul 26, 2021

@hswong3i Still not working?

@hswong3i
Copy link
Contributor Author

I am moving my Ansible Role to using kubic repo.

@hswong3i hswong3i closed this Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants