Skip to content

fix: forward process.env to child process - #8777

Merged
Rich-Harris merged 1 commit into
masterfrom
gh-8769
Jan 29, 2023
Merged

Rich-Harris merged 1 commit into
masterfrom
gh-8769

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

closes #8769. no test because i'm in a hurry, but i don't think it needs one honestly — this is fairly self-explanatory code

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@changeset-bot

changeset-bot Bot commented Jan 29, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9d47d1e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Rich-Harris Rich-Harris changed the title forward process.env to child process fix: forward process.env to child process Jan 29, 2023
@Rich-Harris

Copy link
Copy Markdown
Member Author

gonna rush this out since it's a high priority regression

@Rich-Harris
Rich-Harris merged commit 5925832 into master Jan 29, 2023
@Rich-Harris
Rich-Harris deleted the gh-8769 branch January 29, 2023 14:41
@github-actions github-actions Bot mentioned this pull request Jan 29, 2023
teemingc added a commit that referenced this pull request Nov 18, 2026
Fixes "#17617"

Build workers unconditionally replaced the inherited FORCE_COLOR with
'1'. Consequently, setting NO_COLOR caused Node to warn about
conflicting settings during otherwise successful builds, and explicit
color-disable/depth settings were lost.

The forced-color default was introduced with improved diagnostics in
#16374. It still serves a purpose:
worker output does not otherwise retain terminal color detection.
Removing it entirely would regress those diagnostics.

Instead, only add the FORCE_COLOR default when the parent hasn't
disabled colors with a non-empty NO_COLOR, and pass everything the
parent sets through unchanged. An explicit FORCE_COLOR (including 0) is
preserved, and when the parent sets both variables the worker gets both,
so it resolves colors the same way the parent does. An empty NO_COLOR
counts as unset, matching Node and the NO_COLOR spec.

This central change covers route analysis, prerendering, and fallback
generation. It preserves environment inheritance from
#8777, worker_threads compatibility
from #9919, and the
cleanup/exit-handler behavior from
#17135. Regression coverage uses the
existing real-worker fixture rather than mocking worker construction.

- [Ported SvelteLab
reproduction](https://www.sveltelab.dev/#code=N4IgDghgxg1hDmBTAdAKwM4HsB2IBcoAZgJYA2i%2BoUOALotjeviMADras2sjYQC2ibngAE3GMRoBabJknVSmAE6SA7hEXZi2eNwA07TtzCLiANwh0hwmooCuifRy4hTiRemI4r3AAzI-AIx6Bs40AJ5ggviiIHyYACa25MFO3OhQJmCMVmypzvGIpt4uEojCBUUgjobOAEa2ZPHFpqXC9Y0pNUaKhcSIKs2txr39nVzOw5A9xeiupHSS4jTC6GHYUMIAPpvCiFAAFpjCAOTHY4Yg7aTxeDJymAqKxQByAPIA%2BgDCrwAyrwBKAF4AsIWnQ2g1rtwQgBfar5QoAEUQkWwBXWfXQORCFwAArNEPNEBgAPQQeIQLJuSQQWw0TDFAAc-n852c%2BLmdFJS2KAGZkAEBWzuBzCVz0CSwYhJGBSLZ4FpJASicUAOzIflBKo45zKyzRbgAVmQhvVvOFIHCkXSmWcIm4ADYWebtXluFKmRqTdCnDD2H7cDC4eBsGA%2BKolDB0JAoCgwvxSJQQCRyEnqAx6IxmPQFdhEABlGzEKA0EQ2ezsCCkBQqABCkPi6Dw7GEu3QVxu1jsgkDwfQiigSfixB6JaUYSTlLAyH2ND4iYIybIFEX6boDCYeBAAB4AITxTAliJlWfzgB87G3p9IwlIEG0gO49G4F6cV8Q5NfNW3AhoEGEBzqOgiA0I%2BIB0oQkiMtwwgkl%2B4w-iB-68AIYEtP0YBKM4AG0JmYEqMQ8Q0PsgIVMW0oEUR%2By6MIWgSMQVZKlAVaIMCMFwTqiF-sIKGsdwdAAB5SOkLEwWueFpMxyQgLB8GcAApHqiBLDOH7xPJITbiS%2BxqfB261AkYTlBYEBKpyykSDKPQKOSkgUn%2BYGHK4TwgHJNDbsOpgrOE5BgcO0Z3mEIjiRuL6KeZKkGfEYTyVpnl6SSUVhK%2BWnXq%2BIBBroICKJgdKIJuoDDqO9KKBOi4ANSQEgyBKUmKYrlQuEbswV4BGeADqhLUAI1hHPm5kANISKlbWXmAZ4AGrEB4yzbv%2B%2Bw9IQjk0DQYBNiSJJKcgFQkgeUASjyrlbTte0HcNZJnr1wg9OS1g6eUh62AIDAWJ42BaeN7AZUGP1ZYw6YkPAaBYLgi71WmTVZluuQXIgQn0I2xQACRTiS-04ID5wgN1YDLoorxZG9WLRDD4xpEWJZWOWPacHCOIgFoUBygUVgANppAOegxFKyAA8QQPZCAAC6-pfZlJR0LzGP88gUNEMuEMZs1W7EHwmGKMs5KUnQijCIQOV8CcopEqSWtUsotL0scADc7Cq%2BryzACsEUSMIMJ6wbRtKdyEiSqUNt22rWHCE7BQkHmnzS-Abse5ghvHFKAccHmAkO%2BUiCELS8zp%2BHiCR9ggMABSk7K8paE2wis0pSzF8IZs6I9duIXACUbstyL2Awi3tu9jCQA).
Run build:no-color to reproduce the build warning with the pinned
release.

<!--
svelte-triage-bot:feedback-baseline:34a9e93738cd15903cc13bc4509c9647dd9d9238
-->

---------

Co-authored-by: svelte-triage-bot <[email protected]>
Co-authored-by: Tee Ming <[email protected]>

This branch was successfully deployed

2 active deployments
Preview – kit-svelte-dev — 9d47d1e6 Deployed Jan 29, 2023 by vercel[bot]
Preview – kit — 9d47d1e6 Deployed Jan 29, 2023 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

process.env overwritten with { SVELTEKIT_FORK: true } on Netlify

1 participant