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

pkgsCross.armv7l-hf-multiplatform.btrfs-progs fails to build #50925

Closed
eburimu opened this issue Nov 22, 2018 · 33 comments
Closed

pkgsCross.armv7l-hf-multiplatform.btrfs-progs fails to build #50925

eburimu opened this issue Nov 22, 2018 · 33 comments
Assignees
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@eburimu
Copy link
Contributor

eburimu commented Nov 22, 2018

Issue description

these derivations will be built:
  /nix/store/kqwb525yy9y19chcf29mhasayzkgcbkf-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv
building '/nix/store/kqwb525yy9y19chcf29mhasayzkgcbkf-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv'...
unpacking sources
unpacking source archive /nix/store/3z7xbd91mpm3r1y9h8vpcwzbyhmd1lax-btrfs-progs-v4.19.tar.xz
source root is btrfs-progs-v4.19
setting SOURCE_DATE_EPOCH to timestamp 1541239698 of file btrfs-progs-v4.19/config/install-sh
patching sources
updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./config/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config/config.guess
configuring
configure flags: --disable-static --prefix=/nix/store/kig6dwdh89fy65jb4lw4z6vk0fllsrry-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf --build=x86_64-unknown-linux-gnu --host=armv7l-unknown-linux-gnueabihf
checking for armv7l-unknown-linux-gnueabihf-gcc... armv7l-unknown-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether armv7l-unknown-linux-gnueabihf-gcc accepts -g... yes
checking for armv7l-unknown-linux-gnueabihf-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... armv7l-unknown-linux-gnueabihf-gcc -E
checking for grep that handles long lines and -e... /nix/store/k7sszlqy0f9ixbnjp3ghvmdis03m5qqz-gnugrep-3.1/bin/grep
checking for egrep... /nix/store/k7sszlqy0f9ixbnjp3ghvmdis03m5qqz-gnugrep-3.1/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for armv7l-unknown-linux-gnueabihf-gcc... (cached) armv7l-unknown-linux-gnueabihf-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether armv7l-unknown-linux-gnueabihf-gcc accepts -g... (cached) yes
checking for armv7l-unknown-linux-gnueabihf-gcc option to accept ISO C89... (cached) none needed
checking whether C compiler accepts -std=gnu90... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... armv7l-unknown-linux-gnueabihf
checking for an ANSI C-conforming const... yes
checking for working volatile... yes
checking whether byte ordering is bigendian... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for a BSD-compatible install... /nix/store/rlrf0k4z6vasy9sqswxj66cg5vmnvpsk-coreutils-8.30/bin/install -c
checking whether ln -s works... yes
checking for armv7l-unknown-linux-gnueabihf-ar... armv7l-unknown-linux-gnueabihf-ar
checking for rm... /nix/store/rlrf0k4z6vasy9sqswxj66cg5vmnvpsk-coreutils-8.30/bin/rm
checking for rmdir... /nix/store/rlrf0k4z6vasy9sqswxj66cg5vmnvpsk-coreutils-8.30/bin/rmdir
checking for openat... yes
checking for reallocarray... yes
checking for armv7l-unknown-linux-gnueabihf-pkg-config... no
checking for pkg-config... /nix/store/l6wsvyviggk0af6c829w7qsvk1ncb3r2-pkg-config-0.29.2/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for backtrace... yes
checking for backtrace_symbols_fd... yes
checking for xmlto... /nix/store/hn2imdqln90y9xl8xinrp52wl24ks0sl-xmlto-0.0.28/bin/xmlto
checking for mv... /nix/store/rlrf0k4z6vasy9sqswxj66cg5vmnvpsk-coreutils-8.30/bin/mv
checking for a sed that does not truncate output... /nix/store/kb2h4llzakvphmryvwqljvyqqnxnslvm-gnused-4.5/bin/sed
checking for asciidoc... /nix/store/37iqfzb070cr8kcxay97ld0yizgk87zr-asciidoc-8.6.9/bin/asciidoc
checking for asciidoctor... no
checking for ext2fs... yes
checking for com_err... yes
checking for reiserfscore >= 3.6.27... no
checking for FIEMAP_EXTENT_SHARED defined in linux/fiemap.h... yes
checking for blkid... yes
checking for uuid... yes
checking for zlib... yes
checking for libzstd >= 1.0.0... yes
checking for a Python interpreter with version >= 3.4... python
checking for python... /nix/store/q7wqmmq18r2m4n4yfb7zkkbpnirc6k91-python3-3.7.1/bin/python
checking for python version... 3.7
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.7/site-packages
checking for python-3.7... no
configure: error: Package requirements (python-3.7) were not met:

No package 'python-3.7' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables PYTHON_CFLAGS
and PYTHON_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
builder for '/nix/store/kqwb525yy9y19chcf29mhasayzkgcbkf-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 1
error: build of '/nix/store/kqwb525yy9y19chcf29mhasayzkgcbkf-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv' failed

Steps to reproduce

$ cat ./btrfs-progs.sh
   #!/bin/sh
   nix-build -I nixpkgs=/home/void/nixpkgs -E 'let t1 = import <nixpkgs> {}; in let pkgs = import <nixpkgs> { crossSystem = t1.l ib.systems.examples.armv7l-hf-multiplatform // { system = "armv7l-linux"; }; }; in pkgs.btrfs-progs '

Im on nixpkgs/staging.

@dywedir dywedir added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Nov 22, 2018
@eburimu
Copy link
Contributor Author

eburimu commented Nov 22, 2018

Tries to locate python3 via pkg-config. Below is the config.log.

647 configure:6455: checking for a Python interpreter with version >= 3.4
 648 configure:6472: python -c import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for \
     the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '3.4'.split('.'))) + [0, 0, 0] minverhex \
     = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] s\
     ys.exit(sys.hexversion < minverhex)
 649 configure:6475: $? = 0
 650 configure:6481: result: python
 651 configure:6489: checking for python
 652 configure:6507: found /nix/store/1sf1lkplgwrp0c3b7m8329gcrbw1isk0-python3-3.7.1/bin/python
 653 configure:6519: result: /nix/store/1sf1lkplgwrp0c3b7m8329gcrbw1isk0-python3-3.7.1/bin/python
 654 configure:6537: checking for python version
 655 configure:6544: result: 3.7
 656 configure:6556: checking for python platform
 657 configure:6563: result: linux
 658 configure:6589: checking for python script directory
 659 configure:6624: result: ${prefix}/lib/python3.7/site-packages
 660 configure:6633: checking for python extension module directory
 661 configure:6668: result: ${exec_prefix}/lib/python3.7/site-packages
 662 configure:6683: checking for python-3.7
 663 configure:6690: $PKG_CONFIG --exists --print-errors "python-${PYTHON_VERSION}"
 664 Package python-3.7 was not found in the pkg-config search path.
 665 Perhaps you should add the directory containing `python-3.7.pc'
 666 to the PKG_CONFIG_PATH environment variable
 667 No package 'python-3.7' found
 668 configure:6693: $? = 1
 669 configure:6707: $PKG_CONFIG --exists --print-errors "python-${PYTHON_VERSION}"
 670 Package python-3.7 was not found in the pkg-config search path.
 671 Perhaps you should add the directory containing `python-3.7.pc'
 672 to the PKG_CONFIG_PATH environment variable
 673 No package 'python-3.7' found
 674 configure:6710: $? = 1
 675 configure:6724: result: no
 676 No package 'python-3.7' found
 677 configure:6740: error: Package requirements (python-3.7) were not met:
 678 
 679 No package 'python-3.7' found

Apparently, there is no such pc:

 [nix-shell:~/pi/btrfs-progs-v4.19]$ pkg-config --list-all|grep python
  

@eburimu
Copy link
Contributor Author

eburimu commented Nov 22, 2018

I was able to add the following and make pkg-config work.

  PKG_CONFIG_PATH = "${buildPackages.python3Packages.python}/lib/pkgconfig";

Then I've got the following:

  9987 rm btrfs-man5.xml btrfs-ioctl.xml
  9988     [PY]     libbtrfsutil
  9989 In file included from /nix/store/1sf1lkplgwrp0c3b7m8329gcrbw1isk0-python3-3.7.1/include/python3.7m/Python.h:53:0,
  9990                  from btrfsutilpy.h:27,
  9991                  from error.c:20:
  9992 /nix/store/1sf1lkplgwrp0c3b7m8329gcrbw1isk0-python3-3.7.1/include/python3.7m/pyport.h:699:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  9993  #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  9994   ^~~~~
  9995 error: command 'armv7l-unknown-linux-gnueabihf-gcc' failed with exit status 1
  9996 make: *** [Makefile:435: libbtrfsutil_python] Error 1
  9997 builder for '/nix/store/hwmp1f51iryjwf9afka3f4rw7g3sr7ac-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2
  9998 error: build of '/nix/store/hwmp1f51iryjwf9afka3f4rw7g3sr7ac-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv' failed

@eburimu
Copy link
Contributor Author

eburimu commented Nov 23, 2018

ping @matthewbauer

@Mic92
Copy link
Member

Mic92 commented Nov 23, 2018

python3 is in nativeBuildInputs I am not sure pkg-config will pick it up from there.

@matthewbauer
Copy link
Member

Yeah no buildPackages is needed here - it needs to link against the cross built python.

@eburimu
Copy link
Contributor Author

eburimu commented Nov 23, 2018

@Mic92 It doesn't pick, therefore the PKG_CONFIG_PATH.

  9993 checking getaddrinfo bug... yes
  9994 Fatal: You must get working getaddrinfo() function.
  9995        or you can specify "--disable-ipv6".
  9996 builder for '/nix/store/gf22ij9b8vw0ljzqays6b9gx9ixrlvj5-python3-3.7.1-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 1
  9997 cannot build derivation '/nix/store/c79hj954ka2jz77w9ybqnqbjrgjbcxb3-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv': 1 dependencies co\
       uldn't be built
  9998 error: build of '/nix/store/c79hj954ka2jz77w9ybqnqbjrgjbcxb3-btrfs-progs-4.19-armv7l-unknown-linux-gnueabihf.drv' failed

The above is what I get, @matthewbauer .

@tathougies
Copy link
Contributor

For what it's worth, I've successfully built btrfs-progs for arm on my cross-compilation branches. Perhaps this has to do with python cross-compilation support (nixpkgs currently produces broken python3 extensions), which I'll be submitting some more patches for.

@eburimu
Copy link
Contributor Author

eburimu commented Nov 23, 2018

This doesn't work pretty much.

python3.overrideAttrs(old: {
              configureFlags = old.configureFlags ++ ["--disable-ipv6"];
              CONFIG_SITE = writeScript "config.site" ''                                                                                           
                ac_cv_file__dev_ptmx=no                                                                                                            
               ac_cv_file__dev_ptc=no                                                                                                             
             '';
             });

matthewbauer added a commit to matthewbauer/nixpkgs that referenced this issue Nov 26, 2018
@matthewbauer
Copy link
Member

I think matthewbauer@e23b753 will fix this.

@eburimu
Copy link
Contributor Author

eburimu commented Nov 27, 2018

Hey @matthewbauer,

I'm recompiling from scratch after #50915
Please hold while I get the error once more & verify your fix.

@eburimu
Copy link
Contributor Author

eburimu commented Nov 27, 2018

Hello back @matthewbauer ,

I get

  9987 checking for zlib... yes
  9988 checking for libzstd >= 1.0.0... yes
  9989 checking for a Python interpreter with version >= 3.4... none
  9990 configure: error: no suitable Python interpreter found

The python I get in the build env is 2.7.15. How did you get python3 w/ the settings above?

best.

@Mic92
Copy link
Member

Mic92 commented Dec 3, 2018

820927c was reverted in 713f5e2

@matthewbauer
Copy link
Member

Mic92@3c31069 should fix this

@flokli
Copy link
Contributor

flokli commented Dec 6, 2019

This got further by now - it's now failing here:

config.status: creating config.h

        btrfs-progs v5.3.1

        prefix:             /nix/store/svm0v31chiv7l3vd4bsl28m3ka1hjkpn-btrfs-progs-5.3.1-armv7l-unknown-linux-gnueabihf
        exec prefix:        ${prefix}

        bindir:             ${exec_prefix}/bin
        libdir:             ${exec_prefix}/lib
        includedir:         ${prefix}/include

        compiler:           armv7l-unknown-linux-gnueabihf-gcc
        cflags:             -g -O2 -Wall -D_FORTIFY_SOURCE=2
        ldflags:

        programs:           yes
        shared libraries:   yes
        static libraries:   no
        documentation:      yes
        doc generator:      asciidoc
        backtrace support:  yes
        btrfs-convert:      yes (ext2)
        btrfs-restore zstd: yes
        Python bindings:    yes
        Python interpreter: /nix/store/c2n0xp0j3nacr1l17lmrdzwp16ljsvll-python3-3.7.5/bin/python

        Type 'make' to compile.

building
build flags: SHELL=/nix/store/jg730c9crhf06bf800jyv85cmq0n285k-bash-4.4-p23/bin/bash
    [CC]     btrfs.o
    [CC]     dir-item.o
    [CC]     inode-map.o
    [CC]     qgroup.o
    [CC]     kernel-lib/list_sort.o
    [CC]     props.o
    [CC]     kernel-shared/ulist.o
    [CC]     check/qgroup-verify.o
    [CC]     backref.o
    [CC]     common/string-table.o
    [CC]     common/task-utils.o
    [CC]     inode.o
    [CC]     file.o
    [CC]     find-root.o
    [CC]     common/help.o
    [CC]     send-dump.o
    [CC]     common/fsfeatures.o
    [CC]     common/format-output.o
    [CC]     common/device-utils.o
    [CC]     cmds/subvolume.o
    [CC]     cmds/filesystem.o
    [CC]     cmds/device.o
    [CC]     cmds/scrub.o
    [CC]     cmds/inspect.o
    [CC]     cmds/balance.o
    [CC]     cmds/send.o
    [CC]     cmds/receive.o
    [CC]     cmds/quota.o
    [CC]     cmds/qgroup.o
    [CC]     cmds/replace.o
    [CC]     check/main.o
    [CC]     cmds/restore.o
    [CC]     cmds/rescue.o
    [CC]     cmds/rescue-chunk-recover.o
    [CC]     cmds/rescue-super-recover.o
    [CC]     cmds/property.o
    [CC]     cmds/filesystem-usage.o
    [CC]     cmds/inspect-dump-tree.o
    [CC]     cmds/inspect-dump-super.o
    [CC]     cmds/inspect-tree-stats.o
    [CC]     cmds/filesystem-du.o
    [CC]     mkfs/common.o
    [CC]     check/mode-common.o
    [CC]     check/mode-lowmem.o
    [CC]     send-stream.o
    [CC]     send-utils.o
    [CC]     kernel-lib/rbtree.o
    [CC]     btrfs-list.o
    [CC]     kernel-lib/radix-tree.o
    [CC]     extent-cache.o
    [CC]     extent_io.o
    [CC]     kernel-lib/crc32c.o
    [CC]     common/messages.o
    [CC]     uuid-tree.o
    [CC]     utils-lib.o
    [CC]     common/rbtree-utils.o
    [CC]     ctree.o
    [CC]     disk-io.o
    [CC]     extent-tree.o
    [CC]     delayed-ref.o
    [CC]     print-tree.o
    [CC]     free-space-cache.o
    [CC]     root-tree.o
    [CC]     volumes.o
    [CC]     transaction.o
    [CC]     free-space-tree.o
    [CC]     repair.o
    [CC]     inode-item.o
    [CC]     file-item.o
    [CC]     kernel-lib/raid56.o
    [CC]     kernel-lib/tables.o
    [CC]     common/device-scan.o
    [CC]     common/path-utils.o
    [CC]     common/utils.o
    [CC]     libbtrfsutil/subvolume.o
    [CC]     libbtrfsutil/stubs.o
    [AR]     libbtrfs.a
    [CC]     libbtrfsutil/errors.o
    [CC]     libbtrfsutil/filesystem.o
    [CC]     libbtrfsutil/qgroup.o
    [AR]     libbtrfsutil.a
    [LD]     btrfs
    [CC]     mkfs/main.o
    [CC]     mkfs/rootdir.o
    [LD]     mkfs.btrfs
    [CC]     btrfs-map-logical.o
    [LD]     btrfs-map-logical
    [CC]     image/main.o
    [CC]     image/sanitize.o
    [LD]     btrfs-image
    [CC]     btrfs-find-root.o
    [LD]     btrfs-find-root
    [CC]     btrfstune.o
    [LD]     btrfstune
    [CC]     btrfs-select-super.o
    [LD]     btrfs-select-super
    [CC]     convert/main.o
    [CC]     convert/common.o
    [CC]     convert/source-fs.o
    [CC]     convert/source-ext2.o
    [CC]     convert/source-reiserfs.o
    [LD]     btrfs-convert
    [LN]     btrfsck
    [CC]     btrfs-corrupt-block.o
    [LD]     btrfs-corrupt-block
    [LD]     libbtrfs.so.0.1
    [LD]     libbtrfsutil.so.1.1.1
    [LN]     libbtrfs.so.0
    [LN]     libbtrfs.so
    [LN]     libbtrfsutil.so.1
    [LN]     libbtrfsutil.so
Making all in Documentation
    [ASCII]  btrfs-ioctl.xml
    [XMLTO]  btrfs-ioctl.3
    [ASCII]  btrfs-man5.xml
    [XMLTO]  btrfs-man5.5
rm btrfs-man5.xml btrfs-ioctl.xml
    [PY]     libbtrfsutil
In file included from /nix/store/c2n0xp0j3nacr1l17lmrdzwp16ljsvll-python3-3.7.5/include/python3.7m/Python.h:63,
                 from btrfsutilpy.h:27,
                 from error.c:20:
/nix/store/c2n0xp0j3nacr1l17lmrdzwp16ljsvll-python3-3.7.5/include/python3.7m/pyport.h:699:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^~~~~
error: command 'armv7l-unknown-linux-gnueabihf-gcc' failed with exit status 1
make: *** [Makefile:485: libbtrfsutil_python] Error 1
builder for '/nix/store/58gap3r2886bdpcprhnjbxxc9r9iivg1-btrfs-progs-5.3.1-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2
cannot build derivation '/nix/store/li0r3iffiyxmz1bw40rdmfr85bg13fpn-force-path.patch.drv': 1 dependencies couldn't be built

@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@flokli
Copy link
Contributor

flokli commented Jun 4, 2020

This now fails in zstd:

these derivations will be built:
  /nix/store/8qj0ps73vg5qqva1zkrn9szmy94vqwy0-zstd-1.4.5-aarch64-unknown-linux-gnu.drv
  /nix/store/lcnx19n47gzi37ha259v67cnwq023ll3-btrfs-progs-5.6-aarch64-unknown-linux-gnu.drv
building '/nix/store/8qj0ps73vg5qqva1zkrn9szmy94vqwy0-zstd-1.4.5-aarch64-unknown-linux-gnu.drv' on 'ssh://[email protected]'...
unpacking sources
unpacking source archive /nix/store/ksa1p2xrkg3aymdbbqkp1whgdgx8dw24-source
source root is source
patching sources
applying patch /nix/store/g12z5ybwlh1p6dv8jza621qnfvn0fxbl-playtests-darwin.patch
patching file tests/playTests.sh
applying patch /nix/store/dz671cdl6d2p8r8i5aqvscrh91c8hgcv-2163.patch
patching file lib/legacy/zstd_v04.c
updateAutotoolsGnuConfigScriptsPhase
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/qk8fh1inf89rbd5c9d6ydkrpsvn2zycw-zstd-1.4.5-aarch64-unknown-linux-gnu/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/qk8fh1inf89rbd5c9d6ydkrpsvn2zycw-zstd-1.4.5-aarch64-unknown-linux-gnu/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/qk8fh1inf89rbd5c9d6ydkrpsvn2zycw-zstd-1.4.5-aarch64-unknown-linux-gnu/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/qk8fh1inf89rbd5c9d6ydkrpsvn2zycw-zstd-1.4.5-aarch64-unknown-linux-gnu/share/doc/ -DCMAKE_INSTALL_INFODIR=/nix/store/xfm72dlsd9lvsq2qaggkvzflamfydik2-zstd-1.4.5-aarch64-unknown-linux-gnu-bin/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/d22hgjjfcvinfsf439d0qli8js9vcbmm-zstd-1.4.5-aarch64-unknown-linux-gnu-man/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/10b3gzfkpjmvgf7xgr4pzdi2w6a7zr7h-zstd-1.4.5-aarch64-unknown-linux-gnu-dev/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/10b3gzfkpjmvgf7xgr4pzdi2w6a7zr7h-zstd-1.4.5-aarch64-unknown-linux-gnu-dev/include -DCMAKE_INSTALL_SBINDIR=/nix/store/xfm72dlsd9lvsq2qaggkvzflamfydik2-zstd-1.4.5-aarch64-unknown-linux-gnu-bin/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/xfm72dlsd9lvsq2qaggkvzflamfydik2-zstd-1.4.5-aarch64-unknown-linux-gnu-bin/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/qk8fh1inf89rbd5c9d6ydkrpsvn2zycw-zstd-1.4.5-aarch64-unknown-linux-gnu/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_FIND_FRAMEWORK=last -DCMAKE_STRIP=/nix/store/x8f9rbkl7pgnk93cznv07wdaiyi2sabk-aarch64-unknown-linux-gnu-binutils-2.31.1/bin/aarch64-unknown-linux-gnu-strip -DCMAKE_RANLIB=/nix/store/x8f9rbkl7pgnk93cznv07wdaiyi2sabk-aarch64-unknown-linux-gnu-binutils-2.31.1/bin/aarch64-unknown-linux-gnu-ranlib -DCMAKE_AR=/nix/store/x8f9rbkl7pgnk93cznv07wdaiyi2sabk-aarch64-unknown-linux-gnu-binutils-2.31.1/bin/aarch64-unknown-linux-gnu-ar -DCMAKE_C_COMPILER=aarch64-unknown-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-unknown-linux-gnu-g++ -DCMAKE_INSTALL_PREFIX=/nix/store/qk8fh1inf89rbd5c9d6ydkrpsvn2zycw-zstd-1.4.5-aarch64-unknown-linux-gnu -DZSTD_BUILD_SHARED:BOOL=ON -DZSTD_LEGACY_SUPPORT:BOOL=OFF -DZSTD_BUILD_TESTS:BOOL=ON -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_HOST_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_PROCESSOR=x86_64
/nix/store/s8j52cp531jqndrl5aa6y47y99hxc4j0-cmake-3.17.2-aarch64-unknown-linux-gnu/nix-support/setup-hook: line 107: /nix/store/s8j52cp531jqndrl5aa6y47y99hxc4j0-cmake-3.17.2-aarch64-unknown-linux-gnu/bin/cmake: cannot execute binary file: Exec format error
builder for '/nix/store/8qj0ps73vg5qqva1zkrn9szmy94vqwy0-zstd-1.4.5-aarch64-unknown-linux-gnu.drv' failed with exit code 126

I don't really understand why it tries to invoke the aarch64 cmake - it's passed into nativeBuildInputs… 🤔

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2020
@betaboon
Copy link
Contributor

betaboon commented Jun 8, 2020

for me it still fails with the above-mentioned LONG_BIT error.

i was told to cc @FRidh as he might have valuable insight

@Mic92
Copy link
Member

Mic92 commented Jun 8, 2020

It takes the header from x86 instead of arm hence it fails because long is shorter from the looks of it.

@flokli
Copy link
Contributor

flokli commented Jun 18, 2020

Aah, I see - it fails at zstd already when trying via pkgs.pkgsCross.aarch64-multiplatform, but for pkgsCross.armv7l-hf-multiplatform.btrfs-progs, I can reproduce the build failure from above.

@flokli
Copy link
Contributor

flokli commented Jun 18, 2020

Actually, no. pkgs.pkgsCross.aarch64-multiplatform.btrfs and pkgsCross.armv7l-hf-multiplatform.btrfs-progs both fail in zstd.

The btrfs-progs build failure here is another one, only surfacing when you try to build a whole NixOS closure via

pkgs.Cross.{…}.nixos ./path-to-configuration.nix).config.system.build.toplevel

Weird.

@betaboon
Copy link
Contributor

@flokli i can't confirm that building btrfs-progs fails at zstd (see attached log)

nix-build '<nixpkgs>' -A pkgsCross.armv7l-hf-multiplatform.btrfs-progs output.log

<nixpkgs> points to nixos-unstable-channel (at rev: 0a146054bdf6f70f66de4426f84c9358521be31e)

@flokli
Copy link
Contributor

flokli commented Jun 18, 2020

@betaboon try nix-build -A pkgsCross.armv7l-hf-multiplatform.btrfs-progs from a nixpkgs checkout pointing to 1357624 (latest master as of now)

@betaboon
Copy link
Contributor

@flokli on 22c98819ccdf042b30103d827d35644ed0f17831 i can reproduce that it now fails on zstd

@flokli
Copy link
Contributor

flokli commented Jun 20, 2020

@betaboon zstd cross has been fixed by #91177, so now it should be btrfs-progs again ;-)

@Ericson2314
Copy link
Member

The original issue sounds like precisely the sort of thing my pkg-config wrapper we supposed to fix. I bet @matthewbauer's change, unreverted, will get us close.

@Ericson2314 Ericson2314 self-assigned this Jun 20, 2020
@Ericson2314
Copy link
Member

OK this builds for me now after #91177, no changes needed.

@betaboon
Copy link
Contributor

@Ericson2314 i can confirm that this now cross-compiles for pkgsCross.aarch64-multiplatform.
for pkgsCross.armv7l-hf-multiplatform it still fails with #error "LONG_BIT definition appears wrong for platform for me on current master.

@flokli
Copy link
Contributor

flokli commented Jun 24, 2020

I can confirm the same findings, with nixpkgs master at d8d19f2.

  • pkgsCross.aarch64-multiplatform.btrfs-progs succeeds
  • pkgsCross.armv7l-hf-multiplatform.btrfs-progs fails

@flokli flokli reopened this Jun 24, 2020
@flokli flokli changed the title btrfs-progs doesn't cross compile pkgsCross.armv7l-hf-multiplatform.btrfs-progs fails to build Jun 24, 2020
@flokli
Copy link
Contributor

flokli commented Jun 24, 2020

This breaks the minimal cross build, as udisks2 is pulled in by default in the minimal image.

Reasoning on why we usually want udisks: #49270 (comment)

@Thra11
Copy link
Member

Thra11 commented Jul 4, 2020

Possibly related issue: #63043 (problems cross compiling with python, the same LONG_BIT error, and so on) Haven't checked whether #91178 make a difference to it yet.

@Ericson2314
Copy link
Member

I'm thinking it very well might

@Thra11
Copy link
Member

Thra11 commented Jul 5, 2020

@Ericson2314 If you're referring to #91178 making a difference to #63043, I checked and it doesn't.

@lopsided98
Copy link
Contributor

This is fixed by #98915.

@FRidh FRidh closed this as completed Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests