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

Updating plan9port #47067

Merged
merged 1 commit into from Oct 8, 2018
Merged

Updating plan9port #47067

merged 1 commit into from Oct 8, 2018

Conversation

bbarker
Copy link
Contributor

@bbarker bbarker commented Sep 20, 2018

Motivation for this change

To update plan9port (2+ years since last update on nixpkgs)

cc @ftrvxmtrx @KoviRobi

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@bbarker
Copy link
Contributor Author

bbarker commented Sep 23, 2018

I can confirm that this also seems to be an issue building what is in master, so, it has nothing to do with my change. Just do nix-env -f /home/brandon/workspace/nixpkgs -iA plan9port for whatever version of nixpkgs you have. I guess, ideally, to reproduce this we'd want to use the same commit # that was used when the package was originally built.

@bbarker
Copy link
Contributor Author

bbarker commented Sep 23, 2018

Could be this works on NixOS, so far I've only tried on Ubuntu.

@bbarker
Copy link
Contributor Author

bbarker commented Sep 23, 2018

@samueldr confirmed this was working on NixOS; the issue seems to be that it wouldn't build on Ubuntu for me, nor would the original version before this PR. However, the binaries seem to run without issue.

Original note on my build issues on Ubuntu:

Certain key programs are not being built (acme for instance, the whole reason most people want this package most likely :-)).

I do see some suspicious looking messages during the build:


shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libmp/port/mpadd.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libmp/port/mpexp.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libmp/port/mptouv.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libmp/port/mpdigdiv.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libmp/port/mptoui.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libregexp/regerror.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libregexp/regcomp.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libregexp/regsub.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libregexp/regexec.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libregexp/regaux.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libregexp/rregexec.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libregexp/rregsub.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libcomplete/complete.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libgeometry/matrix.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libgeometry/quaternion.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libgeometry/arith3.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libgeometry/transform.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libgeometry/tstack.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libgeometry/qball.o
wrong ELF type
shrinking /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/src/libbin/bin.o
wrong ELF type
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/bin 
patching script interpreter paths in /nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20
/nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/mac/9term.app/Contents/MacOS/9term: interpreter directive changed from "/bin/bash" to "/nix/store/czx8vkrb9jd
gjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/bash"                                                                                                                                       
/nix/store/sf0gcfpm12b10cmw9zsh4shhi2vd3c3s-plan9port-2018-09-20/plan9/mac/Plumb.app/Contents/MacOS/plumb: interpreter directive changed from "/bin/bash" to "/nix/store/czx8vkrb9jd

@KoviRobi
Copy link
Contributor

Could you post the command that built those .o files with the wrong type (or perhaps the whole build log)? I wonder if it is something along the lines of those being build by plan9port's make command, which autodetects the compiler to be the Ubuntu one, which is perhaps compiling 32/64-bit binaries for your system, which uses a 64/32-bit Nix (wild guess here)

@bbarker
Copy link
Contributor Author

bbarker commented Sep 23, 2018

@KoviRobi , here is my build log: https://gist.github.com/bbarker/a875119308731ca8d13cf59a132fc09e - still not sure what is causing the ELF issue as the only gcc in my container comes from Nix. But it looks like the issue with missing graphical binaries may be related to X11 includes.

@KoviRobi
Copy link
Contributor

It builds for me too, without any problems (on NixOS), but I suspect the problem you might have is from

* Compiler version:
        gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3) 

in your log (there is a shell file called 9c, which might need to be patched) [unless Nix on other distributions uses the distribution's compiler]. Unsure why you have a problem with X11/Xlib.h, when the default.nix includes libX11. Also, if you are building fontsrv, you can probably just remove the fontsrv.patch

@bbarker
Copy link
Contributor Author

bbarker commented Sep 25, 2018

@KoviRobi

I got quite a bit further with the commit I pushed, but ultimately it still fails:

>>> cd /tmp/nix-build-plan9port-2018-09-20.drv-0/plan9port-a82a8b6/src/cmd/rio; mk all
9l -o o.rio client.o color.o cursor.o error.o event.o grab.o key.o main.o manage.o menu.o rio.o -L/nix/store/9xp35nsxrf959vnv2lf170xhfxn951b6-libXt-1.1.5-dev/include/lib/ -lXext -lX11
/usr/bin/x86_64-linux-gnu-ld: cannot find -lXext
/usr/bin/x86_64-linux-gnu-ld: cannot find -lX11
collect2: error: ld returned 1 exit status
mk: 9l -o o.rio ...  : exit status=exit(1)
mk: for i in ...  : exit status=exit(1)
mk: for i in ...  : exit status=exit(1)

What helped was adding more of the libs to LOCAL.config, but, seems like that isn't being used in the above link command.

As for gcc, I think that may just be a funny way it is reporting both gcc and OS together, since I have:

[nix-shell:acme]$ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[nix-shell:acme]$ which gcc
/nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0/bin/gcc

Also, may have found another issue that may warrant opening a separate issue to track if you can confirm; I can't seem to get ssam to work at all; always get this error:

$ echo "foo" | 9 ssam 's/foo/bar/'
rc (/nix/store/7wq4afwhl5fd8ghfigv8qxsbd5widhpv-plan9port-2016-04-18/plan9/bin/rc): null list in concatenation

@Ekleog
Copy link
Member

Ekleog commented Oct 7, 2018

(triage) If I read correctly, this PR updates plan9port, works on as many platforms as the previous version of plan9port did, and fails with the same error as the previous plan9port did on other platforms. If so, maybe we can merge that and open an issue / another PR to solve the remaining issues? :)

@GrahamcOfBorg build plan9port

@bbarker If I read correctly, the change to the BUGGERED line in https://github.com/NixOS/nixpkgs/pull/47067/files#diff-9ed5354c1be372c549bf762e4b21f484 is now a no-op, and this patch could thus be simplified? :)

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: plan9port

Partial log (click to expand)

wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
/nix/store/f407ng9di3bkap90k8jggnid1fh31cr0-plan9port-2018-09-20

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: plan9port

Partial log (click to expand)

/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/bin/kill: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/INSTALL: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/lib/git/commit-msg.hook: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/configure: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/dist/isum: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/dist/addsrclinks: interpreter directive changed from "/usr/bin/env perl" to "/nix/store/hjn5kq7yq18z31ajq7lfd6imjwz21lh6-perl-5.28.0/bin/perl"
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/dist/fixurls: interpreter directive changed from "/usr/bin/env perl" to "/nix/store/hjn5kq7yq18z31ajq7lfd6imjwz21lh6-perl-5.28.0/bin/perl"
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20/plan9/dist/buildmk: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20...
/nix/store/0xqg59q720y4l0ym8w5ih4nhclcr67w6-plan9port-2018-09-20

@bbarker
Copy link
Contributor Author

bbarker commented Oct 7, 2018

@Ekleog This sounds like a good plan. I removed the fontsrv patch. I'll create a new issue summarizing what is here after merge; hopefully I'll get some time to continue working on it in the coming weeks. Feel free to squash and merge this one.

@samueldr
Copy link
Member

samueldr commented Oct 8, 2018

@GrahamcOfBorg build plan9port

I want to see the CI output for darwin.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: plan9port

Partial log (click to expand)

wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
/nix/store/nrz6qgbp261z3gv5rdbqy3mglyg24qab-plan9port-2018-09-20

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: plan9port

Partial log (click to expand)

/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/bin/kill: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/INSTALL: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/lib/git/commit-msg.hook: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/configure: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/dist/isum: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/dist/addsrclinks: interpreter directive changed from "/usr/bin/env perl" to "/nix/store/hjn5kq7yq18z31ajq7lfd6imjwz21lh6-perl-5.28.0/bin/perl"
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/dist/fixurls: interpreter directive changed from "/usr/bin/env perl" to "/nix/store/hjn5kq7yq18z31ajq7lfd6imjwz21lh6-perl-5.28.0/bin/perl"
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20/plan9/dist/buildmk: interpreter directive changed from "/bin/sh" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20...
/nix/store/dh0afmlvyayc7cil4ccwqqsq1qm8396w-plan9port-2018-09-20

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: plan9port

Partial log (click to expand)

/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/bin/B: interpreter directive changed from "/bin/sh" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/sh"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/configure: interpreter directive changed from "/bin/sh" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/sh"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/dist/isum: interpreter directive changed from "/bin/sh" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/sh"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/dist/buildmk: interpreter directive changed from "/bin/sh" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/sh"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/mac/Plumb.app/Contents/MacOS/plumb: interpreter directive changed from "/bin/bash" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/bash"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/mac/9term.app/Contents/MacOS/9term: interpreter directive changed from "/bin/bash" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/bash"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/lib/git/commit-msg.hook: interpreter directive changed from "/bin/sh" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/sh"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/src/cmd/9660/mk9660.sh: interpreter directive changed from "/bin/sh" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/sh"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20/plan9/src/libregexp/cvt: interpreter directive changed from "/bin/sh" to "/nix/store/f2lp21azk4w88f17zgf4mji64agb18ga-bash-4.4-p23/bin/sh"
/nix/store/hdc61vgv1v6r7wxcg5yag7aib6zbb0g1-plan9port-2018-09-20

Copy link
Member

@samueldr samueldr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbarker confirm that the squashed commit looks fine (especially with the commit message):

This is what I would merge. Everything I did locally worked fine. Both acme and sam started. 9term too, with rc. I don't know more about plan9 and plan9port to judge, but I think this is plenty.

@bbarker
Copy link
Contributor Author

bbarker commented Oct 8, 2018

Thanks @samueldr , looks good and sounds good to me as well, though I'm certainly not a plan9 expert either. Once a build hits a channel I'll test the binaries (since I can't build them all yet).

@samueldr samueldr changed the title WIP: updating plan9port Updating plan9port Oct 8, 2018
@samueldr samueldr merged commit 4643428 into NixOS:master Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants