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

Escape ${ in strings when printing Nix expressions #4012

Merged
merged 1 commit into from Sep 14, 2020

Conversation

thufschmitt
Copy link
Member

Otherwise the result of the printing can't be parsed back correctly by Nix (because the unescaped ${ will be parsed as the begining of an anti-quotation).

Fix #3989

Otherwise the result of the printing can't be parsed back correctly by
Nix (because the unescaped `${` will be parsed as the begining of an
anti-quotation).

Fix NixOS#3989
@evanjs
Copy link
Member

evanjs commented Sep 14, 2020

Contents of manifest.nix with cargo-cache installed via patched nix:

[ { meta = { available = true; description = "Manage cargo cache (\${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively"; homepage = "https://github.com/matthiaskrgr/cargo-cache"; license = [ { fullName = "Apache License 2.0"; shortName = "asl20"; spdxId = "Apache-2.0"; url = "https://spdx.org/licenses/Apache-2.0.html"; } { fullName = "MIT License"; shortName = "mit"; spdxId = "MIT"; url = "https://spdx.org/licenses/MIT.html"; } ]; maintainers = [ { email = "brightone@protonmail.com"; github = "filalex77"; githubId = 12615679; keys = [ { fingerprint = "F549 3B7F 9372 5578 FDD3 D0B8 A1BC 8428 323E CFE8"; longkeyid = "rsa3072/0xA1BC8428323ECFE8"; } ]; name = "Oleksii Filonenko"; } ]; name = "cargo-cache-0.5.1"; outputsToInstall = [ "out" ]; platforms = [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "mipsel-linux" "i686-linux" "x86_64-linux" "powerpc64le-linux" "riscv32-linux" "riscv64-linux" "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ]; position = "/nix/store/h71m83xyf7xjrks87v9mlsx6jmbmsls9-nixos-20.09pre242769.61525137fd1/nixos/pkgs/development/tools/rust/cargo-cache/default.nix:21"; }; name = "cargo-cache-0.5.1"; out = { outPath = "/nix/store/j191ax7symck00kf1yfy91l5qx9hzhz6-cargo-cache-0.5.1"; }; outPath = "/nix/store/j191ax7symck00kf1yfy91l5qx9hzhz6-cargo-cache-0.5.1"; outputs = [ "out" ]; system = "x86_64-linux"; type = "derivation"; } ]

And more to the point: nix-env -q prints cargo-cache-0.5.1, rather than dying.
I can then use my current version of nix to install anything... after which it fails to parse the now "broken" manifest.nix, which is to be expected.

It seems that everything is working after this patch is applied.

Thank you!!

@edolstra edolstra merged commit 885cc91 into NixOS:master Sep 14, 2020
@edolstra
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Some strings can break manifest.nix
3 participants