Build Script "scripts/build-launcher.ps1" Does not Support a Project or User Path That has Spaces #349

Open
opened 2026-12-01 16:33:20 +00:00 by github-bot · 0 comments
Owner

@⁠WesternSpace on GitHub · 2026-12-01 16:32 UTC · original

This is an issue related to the build script scripts/build-launcher.ps1, not Foxhound itself.

When attempting to build Foxhound with the build script, it can fail to build the project since the script is not designed to support project or user paths that have spaces in them. The solution is to use CARGO_ENCODED_RUSTFLAGS with the cargo build command.

A solution to the problem can be found below:

# The layer, built here so that no path of this PC is left in the program (the compiler writes source paths
# into it for its error messages): into a target folder of its own, so the usual one keeps its build.
$sep = [char]0x1f
$env:CARGO_ENCODED_RUSTFLAGS = "--remap-path-prefix=$($env:USERPROFILE)=~${sep}--remap-path-prefix=$repo=.${sep}-C${sep}target-cpu=x86-64-v3"
Push-Location $repo
# (cargo writes its progress to the error stream: that must not end this script)
$ErrorActionPreference = 'Continue'
try { & cargo build --profile dist --locked -p victory --target-dir (Join-Path $repo 'target\dist'); $built = $LASTEXITCODE }
finally { Pop-Location; Remove-Item Env:CARGO_ENCODED_RUSTFLAGS; $ErrorActionPreference = 'Stop' }

The solution was created with the help of the Grok AI assistant.

**@⁠WesternSpace** on GitHub · 2026-12-01 16:32 UTC · [original](https://github.com/readmet3xt-lab/foxhound/issues/349) This is an issue related to the build script `scripts/build-launcher.ps1`, **not** Foxhound itself. When attempting to build Foxhound with the build script, it can fail to build the project since the script is not designed to support project or user paths that have spaces in them. The solution is to use `CARGO_ENCODED_RUSTFLAGS` with the `cargo build` command. A solution to the problem can be found below: ```powershell # The layer, built here so that no path of this PC is left in the program (the compiler writes source paths # into it for its error messages): into a target folder of its own, so the usual one keeps its build. $sep = [char]0x1f $env:CARGO_ENCODED_RUSTFLAGS = "--remap-path-prefix=$($env:USERPROFILE)=~${sep}--remap-path-prefix=$repo=.${sep}-C${sep}target-cpu=x86-64-v3" Push-Location $repo # (cargo writes its progress to the error stream: that must not end this script) $ErrorActionPreference = 'Continue' try { & cargo build --profile dist --locked -p victory --target-dir (Join-Path $repo 'target\dist'); $built = $LASTEXITCODE } finally { Pop-Location; Remove-Item Env:CARGO_ENCODED_RUSTFLAGS; $ErrorActionPreference = 'Stop' } ``` _The solution was created with the help of the Grok AI assistant._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 16:33:20 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.