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

dvtm doesn't build for aarch64 #83575

Closed
petersjt014 opened this issue Mar 28, 2020 · 7 comments
Closed

dvtm doesn't build for aarch64 #83575

petersjt014 opened this issue Mar 28, 2020 · 7 comments
Labels
0.kind: bug 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on

Comments

@petersjt014
Copy link
Member

petersjt014 commented Mar 28, 2020

Describe the bug
Currently dvtm does not build for aarch64 (or armv6l, but I suspect it's due to the same problem).

To Reproduce

[root@blorp:~]# nix build -f channel:nixos-unstable pkgsCross.aarch64-multiplatform.dvtm
# ...
builder for '/nix/store/65pcmdx1q8r544ksfqdwyfhl19whm4r0-dvtm-0.15-aarch64-unknown-linux-gnu.drv' failed with exit cod
e 2; last 10 log lines:
   1636 |    chdir(cwd);
        |    ^~~~~~~~~~
  CC -o dvtm
  installing
  stripping executable
  installing executable file to /nix/store/9li7bag9s8mwrbvpsnjfw5lkg6629yr5-dvtm-0.15-aarch64-unknown-linux-gnu/bin
  installing manual page to /nix/store/9li7bag9s8mwrbvpsnjfw5lkg6629yr5-dvtm-0.15-aarch64-unknown-linux-gnu/share/man/
man1
  installing terminfo description
  /bin/sh: tic: not found
  make: *** [Makefile:59: install] Error 127
[0 built (1 failed), 54 copied (1046.1 MiB), 208.0 MiB DL]
error: build of '/nix/store/65pcmdx1q8r544ksfqdwyfhl19whm4r0-dvtm-0.15-aarch64-unknown-linux-gnu.drv' failed

Additional context
Dvtm still builds just fine on x64:

[root@blorp:~]# uname -a
Linux blorp 5.4.28 #1-NixOS SMP Wed Mar 25 07:26:00 UTC 2020 x86_64 GNU/Linux
[root@blorp:~]# nix-shell -p dvtm
# ...
[nix-shell@blorp:~]# dvtm -v
dvtm-0.15 © 2007-2016 Marc André Tanner

tic is apparently part of ncurses, which is imported in dvtm.nix, so it should be available in the build. The only probable hint is the patch applied within it (because it has something to do with terminfo), but I can't see where the architecture is making a difference.

(probably) relevant: https://linux.die.net/man/5/terminfo

Maintainers
I suspect either @vrthra (the maintainer) or @volth (last editor of the package file) might know what's going on.

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.28, NixOS, 19.09.2324.3be8b459e0b (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.3`
 - channels(root): `"nixos-19.09.2324.3be8b459e0b, nixos-unstable-20.09pre217537.d96bd3394b7"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@petersjt014
Copy link
Member Author

petersjt014 commented Mar 28, 2020

Update: I also tried nix-build nixpkgs.pkgsCross.aarch64-multiplatform.dvtm, which needed an older version of gcc but resulted in the same error. That made me think that it was only the unstable branch's version that had the problem, but then I tried this:

[root@florp:~]# uname -a
Linux florp 5.4.24 #1-NixOS SMP Thu Mar 5 15:43:52 UTC 2020 aarch64 GNU/Linux

[root@florp:~]# nix-shell -p dvtm
these paths will be fetched (0.35 MiB download, 1.65 MiB unpacked):
  /nix/store/3jziflvg7fjsi8jky66k4zcwmiphxwy5-gnumake-4.2.1
  /nix/store/k264gscm2sizks1nxkhh83crnk8vrl9b-hook
  /nix/store/xfcixd8vxx2j4iyvqkhv13qzhap05y0h-gnu-config-2019-04-15
  /nix/store/xvmk53zfxn4pc0s1s9y908320mkf0rqf-stdenv-linux
  /nix/store/ycvn7bxzr2y52f9srwxy2l4228cv6s3m-patchelf-0.9
  /nix/store/ykqn989l6yawb5bxd1dxibwcy444yp5a-bash-interactive-4.4-p23-dev
copying path '/nix/store/ykqn989l6yawb5bxd1dxibwcy444yp5a-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/xfcixd8vxx2j4iyvqkhv13qzhap05y0h-gnu-config-2019-04-15' from 'https://cache.nixos.org'...
# ...

[nix-shell:~]# dvtm -v
dvtm-0.15 © 2007-2016 Marc André Tanner

I already have dvtm installed on my baremetal aarch64 system, and it didn't use that store path (I wouldn't expect it to with nix-shell)--It still downloaded paths like when cross-compiling, yet it worked. I guess it's a problem with cross-compiling?

I'm currently trying to x-compile for armv6l on my aarch machine just to see what happens. e: same error.

Another note: the version called 'dvtm-unstable' has behaved exactly the same in every situation so far.

@veprbl veprbl added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Mar 29, 2020
@petersjt014
Copy link
Member Author

After some debugging/brainstorming in irc and comming across a possible cause, I added 'patchShebangs .' in the postPatch section in dvtm.nix. The docs suggest this can't hurt, but it's also not fixing it. Still not sure why tic seemingly isn't available.

@doronbehar
Copy link
Contributor

  /bin/sh: tic: not found

Weird... ncurses is part of the build inputs and it's the one that provides tic.. Could you show the output of these command on that aarch machine:

ls -l $(nix-build '<nixpkgs>' -A ncurses.dev)/bin/
ls -l $(nix-build '<nixpkgs>' -A ncurses)/bin/
find $(nix-build '<nixos>' -A ncurses) $(nix-build '<nixos>' -A ncurses.dev) -name 'tic'

@petersjt014
Copy link
Member Author

@doronbehar

[root@aarch64-1:~]# ls -l $(nix-build '<nixpkgs>' -A ncurses.dev)/bin/
total 96
-r-xr-xr-x 2 root root 69312 Dec 31  1969 infocmp
lrwxrwxrwx 3 root root    16 Dec 31  1969 ncurses-config -> ncursesw6-config
-r-xr-xr-x 2 root root  6817 Dec 31  1969 ncursesw6-config
-r-xr-xr-x 2 root root 19456 Dec 31  1969 toe

[root@aarch64-1:~]# ls -l $(nix-build '<nixpkgs>' -A ncurses)/bin/
total 188
lrwxrwxrwx 5 root root     3 Nov 18 08:07 captoinfo -> tic
-r-xr-xr-x 2 root root 14632 Nov 18 08:07 clear
lrwxrwxrwx 5 root root     3 Nov 18 08:07 infotocap -> tic
lrwxrwxrwx 3 root root     4 Nov 18 08:07 reset -> tset
-r-xr-xr-x 2 root root 19176 Nov 18 08:07 tabs
-r-xr-xr-x 2 root root 91704 Nov 18 08:07 tic
-r-xr-xr-x 2 root root 25088 Nov 18 08:07 tput
-r-xr-xr-x 2 root root 29360 Nov 18 08:07 tset

[root@aarch64-1:~]# find $(nix-build '<nixos>' -A ncurses) $(nix-build '<nixos>' -A ncurses.dev) -name 'tic'
/nix/store/1h25s1q29sx9ylpmiz81i573h7vzf8yb-ncurses-6.1-20190112/bin/tic

@doronbehar
Copy link
Contributor

Hmm, now I notice you are trying to build it from a different machine and use pkgsCross. My last advice would be to visit: https://nixos.org/nixpkgs/manual/#chap-cross

I'm suspecting that a different *Inputs attribute should be used here:

buildInputs = [ ncurses ];

Besides that linked part of the docs, there's https://nixos.org/nixpkgs/manual/#ssec-stdenv-dependencies which should be even more relevant.

@lheckemann
Copy link
Member

Only nativeBuildInputs end up on PATH, since buildInputs can only run on the host platform (not the build one) — you probably need to put ncurses in both buildInputs and nativeBuildInputs so that you have (1) the library to link against and (2) the tic tool

@doronbehar
Copy link
Contributor

@petersjt014 your issue I believe is fixed in #84415, could you please recheck and close the issue if it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on
Projects
None yet
Development

No branches or pull requests

4 participants