-
Notifications
You must be signed in to change notification settings - Fork 613
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
fix(c3): ensure shell scripts work on Windows #4445
Conversation
🦋 Changeset detectedLatest commit: c06c331 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6982999562/npm-package-wrangler-4445 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6982999562/npm-package-wrangler-4445 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6982999562/npm-package-wrangler-4445 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6982999562/npm-package-miniflare-4445 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6982999562/npm-package-cloudflare-pages-shared-4445 Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4445 +/- ##
==========================================
+ Coverage 75.44% 75.45% +0.01%
==========================================
Files 240 240
Lines 12851 12851
Branches 3309 3309
==========================================
+ Hits 9695 9697 +2
+ Misses 3156 3154 -2 |
cb792c0
to
c6a9957
Compare
@RamIdeas pinging you since you've introduces the use of shell-quote generally I think 🙂 |
4381160
to
8dbce2d
Compare
301c5a4
to
36b52d5
Compare
I don't think this is the best solution for the issue. Enforcing the use of argv-style arrays across the codebase is a DX decision and subjective, so I'm not commenting on this specifically. Notably this only considers commands/args authored within the codebase. So even if we enforce argv-style arrays, there are still encoding issues when accepting command strings as env vars (still end up s We could (a) still use shell-quote in those few cases (i.e. much less use of the lib) or (b) we could account for the |
36b52d5
to
e894e77
Compare
Previously we only deleted Pages projects - in fact we were trying to delete the Hono (non-Pages) Worker as a Pages project. Now we delete the project based on its type.
- do not use bash-style environment variable setting in Docusaurus scripts - do not run TTY interactive e2e tests on Windows
…ll environment variable
These e2e test workers and projects should be cleaned up as part of the normal test completion. But if the test crashes they may be left orphaned. This change ensures that we do not clean up projects to early while they are still being used.
Previously we were reusing folders after clearing them when retrying a failed test. But this could lead to problems, especially on Windows where clearing out the folder did not always work.
This commit uses environment variables to tell package managers to put cached files in a local directory rather than a global shared one, which can cause problems with race conditions when running multiple installs at the same time.
It is a false optimization to cancel jobs that are likely to pass when another job flakes out.
These jobs tend to flake out and are not providing much of a useful signal.
Reenable when #4241 lands and improves reliability of this test.
C3 often outputs log messages to the user of commands that are being executed. Users tend to cut and paste these into their terminal to run themselves. This makes sure that these are likely to just work went pasted into their shell.
3ee51d5
to
aed7c14
Compare
Our use of
shell-quote
was causing problems on Windows where it was escaping character (such as@
) by placing a backslash in front. This made Windows think that such path arguments, were at the root.For example,
npm install -D @cloudflare/workers-types
was being converted tonpm install -D \@cloudflare/workers-types
, which resulted in errors like:Now we just rely directly on the Node.js
spawn
API to avoid any shell quoting concerns. This has resulted in a slightly less streamlined experience for people writing C3 plugins, but has the benefit that the developer doesn't have to worry about quoting spawn arguments.Fixes #4282
Fixes #4425
Fixes #4342
Author has addressed the following: