DavHau / nix-portable

Nix - Static, Permissionless, Installation-free, Pre-configured
MIT License
828 stars 31 forks source link

ion shell does not build #16

Closed DieracDelta closed 2 years ago

DieracDelta commented 3 years ago

I know this is a bit of a long shot, but any ideas why this fails for me? I started up a ubuntu:latest docker container, wgetted the latest release of nix-portable, then ran ./nix-portable nix build github:gytis-ivaskevicius/ion-shell#ion-shellac -L -v. This builds until it hits the following error:

ion-shell-vendor.tar.gz> error: failed to sync
ion-shell-vendor.tar.gz> Caused by:
ion-shell-vendor.tar.gz>   failed to copy over vendored sources for: ab_glyph_rasterizer v0.1.4
ion-shell-vendor.tar.gz> Caused by:
ion-shell-vendor.tar.gz>   failed to create directory `ion-shell-vendor.tar.gz/ab_glyph_rasterizer`
ion-shell-vendor.tar.gz> Caused by:
ion-shell-vendor.tar.gz>   File exists (os error 17)
ion-shell-vendor.tar.gz> Traceback (most recent call last):
ion-shell-vendor.tar.gz>   File "/nix/store/l2c8c8jpnic6csbqsdlwi71yb4j7q4zi-cargo-vendor-normalise/bin/.cargo-vendor-normalise-wrapped", line 42, in <module>
ion-shell-vendor.tar.gz>     main()
ion-shell-vendor.tar.gz>   File "/nix/store/l2c8c8jpnic6csbqsdlwi71yb4j7q4zi-cargo-vendor-normalise/bin/.cargo-vendor-normalise-wrapped", line 17, in main
ion-shell-vendor.tar.gz>     assert list(data.keys()) == ["source"]
ion-shell-vendor.tar.gz> AssertionError

Any idea what to make of this? This builds on x8664 linux. In any case this project is very cool! Thanks for putting in the time and effort to make this functional.

matu3ba commented 3 years ago

This could be the associated issue: https://discourse.nixos.org/t/does-cargo-tooling-pick-up-wrong-crate-name-or-is-it-just-me/2769 The functionality of cargo-vendor was upstreamed to cargo itself: https://github.com/alexcrichton/cargo-vendor

I dont find a file with an assert in line number 17 in the upstream cargo, so it looks at least like some of the dependencies of nix-portable need an update. However I am quite new to nix, so I dont know how to investigate how cargo is invoked.

TODO: run the whole thing with ./nix-portable nix build . -L. This command is missing from the README.

matu3ba commented 3 years ago

At least in a virtual machine with instantOS install (Arch derivate) on 5.10.32-1-lts x86_64 I get an infinite loop with NP_DEBUG=1 ../nix-portable nix build &> debug.log when bwrap tries to --bind a bunch of folders (I guess for read-write access or to duplicate the content?).

With only using ../nix-portable nix build compilation works, but somehow only uses 1 CPU core, which is very slow.

It would be great, if this would "simply work" to let people test CIs. Unfortunately I dont have this experience. As of now, it feels more like a "Proof of Concept" (it is generally working).

matu3ba commented 3 years ago

For nixOS newcomers there is also missing 1. a super-simple nix intro with examples to copy (ideally as link to the official wiki for flakes), 2. a simple guide what stuff works and is tested and what doesnt (link to CI would also work here).

DavHau commented 3 years ago

Any idea what to make of this? This builds on x8664 linux. In any case this project is very cool! Thanks for putting in the time and effort to make this functional.

I just tested and this error only happens when proot is used as runtime. Sadly inside a standard docker container only proot works, since no userns are available.

This could be the associated issue: https://discourse.nixos.org/t/does-cargo-tooling-pick-up-wrong-crate-name-or-is-it-just-me/2769

I don't think the linked issue is related. The error of the current issue looks quite different:

failed to create directory `ion-shell-vendor.tar.gz/ab_glyph_rasterizer`

At least in a virtual machine with instantOS install (Arch derivate) on 5.10.32-1-lts x86_64 I get an infinite loop with NP_DEBUG=1 ../nix-portable nix build &> debug.log when bwrap tries to --bind a bunch of folders (I guess for read-write access or to duplicate the content?).

If you could provide some more information, like what exactly you are building etc, that would be helpful. Also we should track this problem in a separate issue.

For nixOS newcomers there is also missing 1. a super-simple nix intro with examples to copy (ideally as link to the official wiki for flakes)

Including a link to the official wiki is a good idea. We shouldn't duplicate any standard nix stuff here.

  1. a simple guide what stuff works and is tested and what doesnt (link to CI would also work here).

There is already Drawbacks / Considerations and Missing Features in the readme. We could add a point Known Issues.

matu3ba commented 3 years ago

If you could provide some more information, like what exactly you are building etc, that would be helpful. Also we should track this problem in a separate issue.

I tried to reproduce this issue inside a virtual machine and wanted to get the logs. However the logs showed at last bubblewrap trying to --bind a bunch of folders, which looks like it never finished. I wanted to clarify first how things are tested and if something is known to (not) work inside virtual machines. [I wanted a "clean" test environment, so that nix-portable doesnt default to my system installed nix]

Including a link to the official wiki is a good idea. We shouldn't duplicate any standard nix stuff here.

I like https://serokell.io/blog/practical-nix-flakes (was featured in NixOS weekly) and https://nixos.wiki/wiki/Flakes What other languages/build systems do have tutorials/guides? Is there a collection site of those? The nixOS wiki is unfortunately very much unfinished.

There is already Drawbacks / Considerations and Missing Features in the readme. We could add a point Known Issues.

LGTM.

DavHau commented 3 years ago

It should definitely work inside a VM. Nix-portable is continuously tested on VMs of multiple well known distros. But this has nothing to do with the current issue. If you're still interested in getting support for your distro fixed, please open a new issue for it. Thanks.