New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shell: make sure proper .env is loaded in script runner #9448
Conversation
❌ @zackradisic 4 files with test failures on linux-x64: |
❌ @Jarred-Sumner 5 files with test failures on bun-darwin-aarch64:
|
❌🪟 @Jarred-Sumner, there are 18 test regressions on Windows x86_64
|
❌ @zackradisic 6 files with test failures on bun-darwin-x64:
|
const { stdout, stderr, exited } = Bun.spawn({ | ||
cmd: [bunExe(), "run", "prod"], | ||
cwd: package_dir, | ||
stdio: ["pipe", "pipe", "pipe"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stdio: ["pipe", "pipe", "pipe"], | |
stdio: ["ignore", "pipe", "pipe"], |
const { stdout, stderr, exited } = Bun.spawn({ | ||
cmd: [bunExe(), "prod"], | ||
cwd: package_dir, | ||
stdio: ["pipe", "pipe", "pipe"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stdio: ["pipe", "pipe", "pipe"], | |
stdio: ["ignore", "pipe", "pipe"], |
await writeFile(join(package_dir, ".env.development"), `AWESOME=development`); | ||
|
||
const { stdout, stderr, exited } = Bun.spawn({ | ||
cmd: [bunExe(), "run", "prod"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd: [bunExe(), "run", "prod"], | |
cmd: [bunExe(), "--shell=bun", "run", "prod"], |
@@ -831,3 +832,61 @@ function sentinelByte(buf: Uint8Array): number { | |||
} | |||
throw new Error("No sentinel byte"); | |||
} | |||
|
|||
test("shell as script runner propagates env vars: bun run <foo>", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be condensed into a test.each
for the bun run
permutation and the non-bun run permutation
I think this bug is actually the shell not loading environment variables, and this fix causes a different bug where it no longer loads .env files in bun run at the right time |
❌ @zackradisic 4 files with test failures on linux-x64-baseline: |
superceded by #9642 |
Closes #9445