adventurous-rain-63973
01/03/2024, 4:43 PMpyright
to work on a considerable list of files, basically what I get when I run pants check ::
. The problem has to be related to ARG_MAX
since I get flaky results on different architectures: for instance, it gets through on macOS, but not on Linux. It complains about npi-cli
not being able to read the complete list form stdin
.
In our configuration, we used a workaround consisting in a piped combination of pants list
and xargs
, but it's far from an ideal solution since it less reliable, and it breaks the use of pants cache. By looking at the current implementation, I found out that pyright
is called as NodeJSToolRequest
command.
Do you have any recommendation for this? I wonder whether it would be possible to split NodeJSToolRequest
into multiple requests, or if this would break how Pants is intended to work.better-van-82973
01/03/2024, 4:57 PMgetconf ARG_MAX
adventurous-rain-63973
01/03/2024, 5:05 PM$ getconf ARG_MAX
1048576
$ gxargs --show-limits < /dev/null
Your environment variables take up 6817 bytes
POSIX upper limit on argument length (this system): 1039711
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 1032894
Size of command buffer we are actually using: 131072
Maximum parallelism (--max-procs must be no greater): 2147483647
Linux:
$ getconf ARG_MAX
2097152
$ gxargs --show-limits < /dev/null
Your environment variables take up 2010 bytes
POSIX upper limit on argument length (this system): 2093094
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2091084
Size of command buffer we are actually using: 131072
Maximum parallelism (--max-procs must be no greater): 2147483647
I might actually be wrong.adventurous-rain-63973
01/03/2024, 5:30 PMnpm ERR! Cannot read properties of undefined (reading 'stdin')
better-van-82973
01/03/2024, 7:02 PMstdin
variable is undefined for whatever reason - my guess is that it’s due to the type of shell you’re using:
https://stackoverflow.com/questions/76194360/npm-err-cannot-read-properties-of-undefined-reading-stdin-when-using-git-ba
https://github.com/nodejs/help/issues/4138adventurous-rain-63973
01/03/2024, 8:15 PMxargs
and different sizes, and it starts to break only after a certain threshold...better-van-82973
01/03/2024, 8:28 PMadventurous-rain-63973
01/03/2024, 9:20 PMadventurous-rain-63973
01/03/2024, 10:08 PMpnpm
and it appears that it works. This for the configuration in `pants.toml`:
[nodejs]
package_manager = "pnpm"
[nodejs.package_managers]
pnpm = "8.14.0"
It gives me a warning though, I believe to print the name of the executable:
._pnpm_home/store/v3/tmp/dlx-19116/node_modules/.bin/pyright: line 4: uname: command not found
early-umbrella-56089
01/17/2025, 8:02 AMuname
error. Thanks!