nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.33k stars 74 forks source link

[nix develop] user flake compilation, read-only filesystem #415

Closed c4lliope closed 1 month ago

c4lliope commented 1 month ago

During a local flake compilation, some rust process ends in an error; nix log .... displays:

@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/w9lm1rcj1n9h19nrwh6fjjynqd894x8b-base64-0.1.0
source root is base64-0.1.0
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
Compiling 1 file (.ex)
    Updating crates.io index
 Downloading crates ...
  Downloaded lazy_static v1.4.0
error: failed to download replaced source registry `crates-io`

Caused by:
  failed to create directory `/homeless-shelter/.cargo/registry/cache/index.crates.io-6f17d22bba15001f`

Caused by:
  Read-only file system (os error 30)

== Compilation error in file lib/base64.ex ==
** (RuntimeError) calling `cargo metadata` failed.

    (rustler 0.34.0) lib/rustler/compiler/config.ex:81: Rustler.Compiler.Config.metadata!/1
    (rustler 0.34.0) lib/rustler/compiler/config.ex:63: Rustler.Compiler.Config.build/1
    (rustler 0.34.0) lib/rustler/compiler.ex:8: Rustler.Compiler.compile_crate/3
    lib/base64.ex:15: (module)

I guess my only clue is this /homeless-shelter path; does this seem like a nix-on-droid concept? Seems like no searches are going to have any luck, especially because homeless shelters are an emergent gameplay mechanic for the Rust videogame.

I am super perplexed; besides this nix-on-droid seems superb and I hope I can keep up on client contracts as I travel, leaving my main computer back at home in the lab.

t184256 commented 1 month ago

I guess my only clue is this /homeless-shelter path; does this seem like a nix-on-droid concept?

No. There might be many meanings to 'homeless shelter', but here I'm 99% sure this specific /homeless-shelter/ is purely a Nix concept, and it's the path that Nix sets $HOME to during the build process in order to ensure nothing actually uses it. If the derivation tries to, it's doing the wrong thing, so the build fails and the build instructions should be fixed.

So, something broke building of this derivation. Please ensure that the derivation in question can be built with regular Nix running on NixOS or regular Linux. https://hydra.nixos.org might be of help if you don't have access to any other PCs. Then, please report the issue to nixpkgs or wherever it is packaged. Until that's resolved, you can try to either not build it or use an older version of nixpkgs or something.

I'd try building the offending derivation somewhere else myself, but the log is too short and I have no idea what are you building. And base64-0.1.0 is about as searcheable as homeless shelters.

I am super perplexed; besides this nix-on-droid seems superb and I hope I can keep up on client contracts as I travel, leaving my main computer back at home in the lab.

While I'm glad you like it, this issue tracker is for nix-on-droid magic specifically and not for the whole nixpkgs made available through it.

t184256 commented 1 month ago

... or maybe whatever you're building took a wrong turn even earlier, because 0.1.0 version of the base64 crate is 9 years old and almost certainly should not be used in 2024. Anyway, please find out what exactly in your config causes nix-on-droid to build the problematic derivation, find out where does it come from, report the issue there and either fix the issue or stay on the latest working version until it's fixed.