mammoth-dawn-85816
08/27/2025, 9:13 PMvite at the moment, because uname can't be found in the pants sandbox. Details in š§µ , can anyone offer advice?mammoth-dawn-85816
08/27/2025, 9:13 PMBUILD in my static website builder subdirectory, Iām getting errors about uname not being findable:
/private/var/folders/cn/x01prt2d69gf01kxxl5_dw_40000gn/T/pants-sandbox-c8MpRY/website/node_modules/.bin/vite: line 4: uname: command not found
Which makes sense, as vite does use `uname`; `website/node_modules/.bin/vite | head -n5`:
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
Iāve tried adding uname as a system_binary (including the pants.backend.experimental.adhoc backend in my pants.toml) but I get the same issue.
My website/BUILD looks like this.
javascript_sources()
package_json(
name="website-package",
scripts=[
node_build_script(
entry_point = "build",
output_directories = ["dist/"],
)
],
dependencies=[":uname"],
)
system_binary(
name="uname",
binary_name="uname",
)
(My package.json includes "script" { "build": "vite build" } , so nothing fancy there)
Iād really appreciate any help, as Iām pretty sure Iām just missing something trivial! š
[edited to include the uname dependencies line, as recommended below!]happy-kitchen-89482
08/27/2025, 9:29 PMsystem_binary target. So set dependencies=[":uname"] in the package_json target perhaps.happy-kitchen-89482
08/27/2025, 9:29 PMmammoth-dawn-85816
08/27/2025, 9:37 PMuname system_binary from being visible to vite. Iāll keep exploring.
(by the by, pants run website:uname does correctly return uname output, so that part is working!)mammoth-dawn-85816
08/27/2025, 10:09 PMpants.backend.build_files.fmt.ruff as a backend (as referenced here), and manually ensuring /usr/bin is in my system_binary_paths (as thatās where my uname is) ā no luck!
[system-binaries]
system_binary_paths = [
"/usr/bin",
"/bin",
"/usr/local/bin",
"/opt/homebrew/bin",
]mammoth-dawn-85816
08/28/2025, 7:51 AMvite to see uname by manually adding to the PATH. adding a dependency to uname as a system_binary and/or setting the paths for system binaries didnāt work (above).
This feels very unlikely to be the ārightā way to do things, but Iām not at all certain that Iām using the system_binary config above correctly. Iād love pointers if Iām misunderstanding!
package_json(
name="website-package",
scripts=[
node_build_script(
entry_point = "build", # this runs "vite build"
output_directories = ["dist/"],
)
],
extra_env_vars=["PATH=/usr/bin"],
)happy-kitchen-89482
08/28/2025, 6:43 PMhappy-kitchen-89482
08/28/2025, 6:44 PMmammoth-dawn-85816
08/28/2025, 8:59 PMmammoth-dawn-85816
08/29/2025, 8:18 AMfiles I needed for my build.
⢠Adding the files dependency hid/removed the uname error
⢠Adding my /usr/bin into the PATH made the uname error go away, which drew my attention to the blocking error.
I think thereās a certain amount of PEBKAC here š
but the uname error from pants seems unexpected, and definitely confused me (a very novice pants user!)mammoth-dawn-85816
08/29/2025, 8:18 AMnvm dance is always a bit weird!