mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
fix: tolerate spaces in nix binary patching
If path to original file contains space (I.e on code insiders, where default data directory is ~/Code - Insiders/), then there is syntax error evaluating src arg. Instead pass path as str, and coerce to path back in nix expression Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
This commit is contained in:
parent
3fdc556632
commit
471795b019
1 changed files with 3 additions and 3 deletions
|
@ -246,10 +246,10 @@ async function patchelf(dest: PathLike): Promise<void> {
|
||||||
},
|
},
|
||||||
async (progress, _) => {
|
async (progress, _) => {
|
||||||
const expression = `
|
const expression = `
|
||||||
{src, pkgs ? import <nixpkgs> {}}:
|
{srcStr, pkgs ? import <nixpkgs> {}}:
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
name = "rust-analyzer";
|
name = "rust-analyzer";
|
||||||
inherit src;
|
src = /. + srcStr;
|
||||||
phases = [ "installPhase" "fixupPhase" ];
|
phases = [ "installPhase" "fixupPhase" ];
|
||||||
installPhase = "cp $src $out";
|
installPhase = "cp $src $out";
|
||||||
fixupPhase = ''
|
fixupPhase = ''
|
||||||
|
@ -262,7 +262,7 @@ async function patchelf(dest: PathLike): Promise<void> {
|
||||||
await fs.rename(dest, origFile);
|
await fs.rename(dest, origFile);
|
||||||
progress.report({ message: "Patching executable", increment: 20 });
|
progress.report({ message: "Patching executable", increment: 20 });
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
const handle = exec(`nix-build -E - --arg src '${origFile}' -o ${dest}`,
|
const handle = exec(`nix-build -E - --argstr srcStr '${origFile}' -o '${dest}'`,
|
||||||
(err, stdout, stderr) => {
|
(err, stdout, stderr) => {
|
||||||
if (err != null) {
|
if (err != null) {
|
||||||
reject(Error(stderr));
|
reject(Error(stderr));
|
||||||
|
|
Loading…
Reference in a new issue