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

proot-termux: init at 20190505 (termux fork of proot) #65831

Closed
wants to merge 1 commit into from

Conversation

jorsn
Copy link
Member

@jorsn jorsn commented Aug 3, 2019

Motivation for this change

proot-termux is needed in some situations to install nix using proot.
This is due to some bug related to file moving, probably to the system call
renameat2. This is also reported in the nixos wiki.

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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @wavewave @makefu @veprbl @dtzWill

proot-termux is needed in some situations to install nix using proot
because of some bug related to file moving, probably the system call
`renameat2`. This is also reported in the nixos wiki [1].

[1]: https://nixos.wiki/wiki/Nix_Installation_Guide#PRoot
@matthewbauer
Copy link
Member

Latest proot should have this support. It was added in proot-me/proot@7ac3387.

@veprbl
Copy link
Member

veprbl commented Aug 5, 2019

cc @symphorien who added the mention of the fork to the wiki. I guess the wiki page can be updated to recommend building proot from the master instead of using outdated static binaries.

@symphorien
Copy link
Member

Sorry, I don't use nix on proot anymore, but maybe @jorsn can test if upstream proot master works well ?

@jorsn
Copy link
Member Author

jorsn commented Aug 6, 2019

For me proot master doesn't work well: There is an error during the installation of nix when moving files stating a file doesn't exist. Since the issue with renameat2 is fixed in master (i related it because it has to do with file moving) i investigated it a bit and according to the logs if i run proot with verbosity 5 and use 'mv -v', it might have to do with localization files, but it could also just be additional errors when mv tries to localize an error message. So all i can say for sure now is that there is an unknown error i haven't been able to track down, and compiling proot statically with debugging symbols seems to recompile a whole lot of libs.

The termux fork of proot just works so far.

@@ -0,0 +1,23 @@
{ proot, stdenv, fetchFromGitHub, ... }@args:
Copy link
Member

Choose a reason for hiding this comment

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

Never use ... or @args in nixpkgs package definitions

# Enable overriding of proot arguments via proot-termux.override.
# Proot is not a function of `proot`, so this must be filtered out.
vanilla = proot.override
(stdenv.lib.filterAttrs (n: _: n != "proot") args);
Copy link
Member

Choose a reason for hiding this comment

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

No need to do this override dance, just use proot directly below

# Proot is not a function of `proot`, so this must be filtered out.
vanilla = proot.override
(stdenv.lib.filterAttrs (n: _: n != "proot") args);
in vanilla.overrideAttrs (old: {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
in vanilla.overrideAttrs (old: {
in proot.overrideAttrs (old: {

meta.homepage = https://github.com/termux/proot;
meta.description = "Termux fork of proot, a user-space implementation of "
+ "chroot, mount --bind and binfmt_misc";
meta.maintainers = [ stdenv.lib.maintainers.jorsn ] ++ old.meta.maintainers;
Copy link
Member

Choose a reason for hiding this comment

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

Use this (and fill out the platforms and license fields as well)

{
  meta = {
    homepage = ...;
    description = ...;
    maintainers = ...;
    platforms = ...;
    license = ...;
  };
}

@jorsn
Copy link
Member Author

jorsn commented Oct 13, 2019

Closing, since this is on the border of really being relevant, the issue addressed is hopefully not permanent anyways and I have no time to investigate it deeply.

I instead added a hint to the wiki page about the file-does-not-exist-error.

@jorsn jorsn closed this Oct 13, 2019
@jorsn jorsn deleted the proot-termux branch October 13, 2019 00:35
@jorsn jorsn restored the proot-termux branch October 13, 2019 00:36
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