mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 12:57:46 +00:00
[build-utils][cli][go][node][ruby][static-build] Explicitly set PATH when copying env vars (#8532)
On Windows 10 and 11 machines, environment variables are not case sensitive. The system PATH is actually defined as `process.env.Path`, however Node.js kindly handles the case sensitivity and will automatically return the system path when specifying `process.env.PATH`.
When we clone the environment variables via `{ ...process.env }`, we lose the automatic resolving of `Path` to `PATH`. To fix this, we need to explicitly copy the `PATH`.
#### Tests
- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`
#### Code Review
- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
createLambda,
|
||||
debug,
|
||||
walkParentDirs,
|
||||
cloneEnv,
|
||||
} from '@vercel/build-utils';
|
||||
import { installBundler } from './install-ruby';
|
||||
|
||||
@@ -63,12 +64,11 @@ async function bundleInstall(
|
||||
['install', '--deployment', '--gemfile', gemfilePath, '--path', bundleDir],
|
||||
{
|
||||
stdio: 'pipe',
|
||||
env: {
|
||||
...process.env,
|
||||
env: cloneEnv(process.env, {
|
||||
BUNDLE_SILENCE_ROOT_WARNING: '1',
|
||||
BUNDLE_APP_CONFIG: bundleAppConfig,
|
||||
BUNDLE_JOBS: '4',
|
||||
},
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user