treewide: String escape fixes#365186
Conversation
1fffc51 to
591861f
Compare
philiptaron
left a comment
There was a problem hiding this comment.
I was surprised at how few rebuilds there were, but after seeing that many of these were in update scripts, that makes sense.
It's somewhat hilarious seeing the tests for a nasty string get the nasty string wrong.
I agree with the Lix issue that warning in these cases is the right thing to do.
| ] | ||
| ]; | ||
| nasty_string = "\"@\n\\\t^*\b\f\n\0\";'''$"; | ||
| nasty_string = "\"@\n\\\t^*bf\n0\";'''$"; |
There was a problem hiding this comment.
This is especially hilarious because if you look at the expected output, it "correctly" contains b, f and 0. Which means that nobody bothered actually checking it?
I think it would be more interesting if that string actually contained the characters it intended to contain (except the NUL byte, because that horribly breaks Nix …), but I couldn't figure out how to easily put a line feed into a string without actually putting verbatim into the file, so …
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-24.11
git worktree add -d .worktree/backport-365186-to-release-24.11 origin/release-24.11
cd .worktree/backport-365186-to-release-24.11
git switch --create backport-365186-to-release-24.11
git cherry-pick -x 772ad025ecec551be8d09a26514092f5d7b9e740 ac27331127ab250e61442aae10db18aad642bd38 69f9bc37c77029490c81c8813da8c343ed917a9f 62fcc798988975fab297b87345d93919cd6f6389 50a57d5773aeedcca14e98a9d009955a0ce15914 8b344a79c972292d8b5c6426aa90df4bc06f4e9c dfc3657f0f81391b743213794e9f3b1775e1031a 0bf626239109203cd714e740c7bd3dfaa708d00a f9698477df7760f90f40d62a8185abf9da6e58f2 70e7ca4c3dd999edc78ab0ac0785f0eac2b54da3 bd2962950d2ba880bd1f02107ae02e61ecb3a256 6d815298c97fc3ccaef94a166dfa274736fcd0bc e044fed9a9023d457abce3880e7fe99d03be8b6a 160f865b6bc4be9056ff0a6fd853c466aee62c59 515a6a3386fe4b7b7dea97d72f41684d657c8235 591861f2b10f446efb5871d1467b245983b7e829 |
Follow-up to #350296 and #350774. Not only is the string indentation in Nix lang jank, but also the escaping rules. After this, there will still be some invalid escape sequences in Nixpkgs because of #365173.
Issues found by parsing Nixpkgs with https://gerrit.lix.systems/c/lix/+/2310/1
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.