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

cloud-utils: depends on sed being available as gnused #15736

Closed
martijnvermaat opened this issue May 26, 2016 · 7 comments
Closed

cloud-utils: depends on sed being available as gnused #15736

martijnvermaat opened this issue May 26, 2016 · 7 comments

Comments

@martijnvermaat
Copy link
Contributor

martijnvermaat commented May 26, 2016

Issue description

cloud-utils depends on the gnused binary being in $PATH, but stdenv has sed as just sed.

Steps to reproduce

$ nix-shell -p cloud-utils
$ growpart /dev/sda 1
# I assume this fails, reported by jeaye on IRC

Or just:

$ nix-shell -p cloud-utils --run 'gnused --version'
/run/user/1000/nix-shell.x2PKAC/rc: line 1: gnused: command not found

Technical details

  • System: (NixOS: 16.03)
  • Nix version: 1.11.2
  • Nixpkgs version: unstable and master

Cause and proposed solution

In buildPhase, use of sed is replaced by gnused here. I traced that code back to this commit which also includes this line making sed available as gnused, but these are now separated in the codebase.

In amazon-grow-partition, cloud-utils is used in the original context (in initrd) where gnused is still explicitely made available, but of course this doesn't hold when using cloud-utils elsewhere.

It was mentioned on IRC by clever that using absolute paths instead of relying on PATH here would perhaps mess with the closure size of the initrd.

@martijnvermaat
Copy link
Contributor Author

cc @domenkozar as you separated cloud-utils from amazon-grow-partition.

@chris-martin
Copy link
Contributor

Please reopen, this is still a problem in NixOS 17.09.

# growpart /dev/xvda 1
/nix/store/hw5ydc3i92q686sb3yr275qihdhx2m5j-cloud-utils-0.29/bin/.growpart-wrapped: line 257: gnused: command not found
FAILED: gnused failed on dump output

@chris-martin
Copy link
Contributor

There's a workaround here: #22211 (comment)

@orivej
Copy link
Contributor

orivej commented Nov 1, 2017

growpart from the cloud-utils package uses sed not gnused, which is added to the PATH in the wrapper.

@chris-martin
Copy link
Contributor

@orivej I could be mistaken, but I don't think that's the case for the version of cloud-utils currently in NixOS release 17.09.

@domenkozar
Copy link
Member

afaik this wasn't backported

@domenkozar
Copy link
Member

there was a PR in master to fix it, but never backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants