GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(schematics): use a POSIX path for the Cloud Run main.js entry by fr-esco · Pull Request #3274 · angular/angularfire

Conversation

@fr-esco

@fr-esco fr-esco commented Oct 7, 2022 •
edited by armando-navarro
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description

Running ng deploy from Windows with the Cloud Run SSR option writes the generated run/package.json entry paths with backslashes ("main": "dist\\my-project\\server\\main.js"), which the Linux-based Cloud Run runtime cannot resolve. This PR builds that path with forward slashes explicitly, since the target runtime is always Linux regardless of the deploying machine.

The branch originally also added shell: true to the deploy runner, fixing spawn gcloud ENOENT on Windows. That half was dropped when the branch was brought current with main:

  • The package-manager commands now route through cross-spawn, which resolves the platform executable on Windows. The gcloud calls still use plain spawn, so the spawn gcloud ENOENT half of spawn gcloud ENOENT #3098 is not fixed by this PR.
  • The deploy hardening work relies on arguments not passing through shell parsing, so reintroducing a shell would undo part of it.

Refs #3098


Original author notes (2022):

Checklist

  • Issue number for this PR: spawn gcloud ENOENT #3098
  • Docs included?: No
  • Test units included?: No
  • In a clean directory, yarn install, yarn test run successfully? Yes

Description

Running the deploy schematic on Windows:

  1. Child processes that need gcloud cannot properly locate it;
  2. The path to main.js is printed escaped by \\ instead of /, even though target runtime is Linux based.

Code sample

N. A.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fr-esco added 3 commits October 7, 2022 15:38
@fr-esco
fix(schematics): deploy - give child processes proper access to env v…
9337c7d
…ars (angular#3098)
@fr-esco
fix(schematics): deploy - fix path to main.js (angular#3098)
6836b4d
@fr-esco
Merge branch 'master' into fix-3098
d817a7f
davideast
davideast reviewed Jun 23, 2023
View reviewed changes

@davideast davideast left a comment

Copy link
Copy Markdown
Collaborator

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.

@fr-esco Thank you so much and our apologies for taking so long to get to it. Since this is an older PR and there are a lot of merging PRs in flight it's going to take a bit to get this tested and merged so hang tight.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@davideast
Merge branch 'master' into fix-3098
1c6d5e5
@davideast davideast self-assigned this Jun 23, 2023
@davideast
Merge branch 'master' into fix-3098
9de9945
keshavlingala
keshavlingala approved these changes Sep 20, 2024
View reviewed changes
@armando-navarro
Merge branch 'main' into fix-3098
86d4fd0
Resolves the spawnAsync conflict by taking main's side: the runner now
receives command and args separately through cross-spawn, which handles
the Windows executable resolution that shell: true addressed, and a
shell would reintroduce the argument parsing the injection fixes
removed. The main.js path fix carries through unchanged.
@armando-navarro armando-navarro changed the title Fix #3098 fix(schematics): use a POSIX path for the Cloud Run main.js entry Aug 18, 2026
@armando-navarro armando-navarro added bump: patch Size of the change: a fix or docs change that reaches users comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen. labels Aug 18, 2026
@armando-navarro

armando-navarro commented Aug 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Sorry this sat for so long. I picked this up to land it with your authorship: I merged current main into your branch, and the two halves of your fix went different ways.

  • The main.js path fix carries through unchanged and is the whole diff now. It is still a real bug on today's main.
  • The shell: true half was dropped in the merge. The recent injection hardening moved the package-manager commands to cross-spawn and depends on arguments not being shell-parsed. The gcloud spawns still bypass cross-spawn today, so the ENOENT you originally hit is not fixed by this PR and needs its own follow-up.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@armando-navarro
armando-navarro requested review from tyler-reitz and removed request for tyler-reitz August 18, 2026 05:52
armando-navarro
armando-navarro approved these changes Aug 18, 2026
View reviewed changes
@armando-navarro
armando-navarro merged commit 73acea7 into angular:main Aug 18, 2026
24 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@armando-navarro armando-navarro mentioned this pull request Aug 18, 2026
spawn gcloud ENOENT #3098
Open
@armando-navarro armando-navarro added this to the 21.0.0-rc.1 milestone Oct 1, 2026
@armando-navarro armando-navarro mentioned this pull request Oct 9, 2026
Backport ten fixes to 20.1.x for 20.1.1 #3798
Merged
@armando-navarro armando-navarro added the backport: 20.1.x Cherry-pick onto the 20.1.x branch for a 20.1 patch release label Oct 9, 2026
armando-navarro added a commit that referenced this pull request Oct 10, 2026
@fr-esco @armando-navarro
fix(schematics): use a POSIX path for the Cloud Run main.js entry (#3274
68a874c
)

Running ng deploy from Windows with the Cloud Run SSR option wrote the
generated run/package.json entry paths with backslashes, which the
Linux-based Cloud Run runtime cannot resolve. The manifest path is now
built with forward slashes explicitly, since the target runtime is
Linux regardless of the deploying machine.

Fixes #3098

Co-authored-by: Armando Navarro <[email protected]>
(cherry picked from commit 73acea7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@davideast davideast davideast left review comments
@armando-navarro armando-navarro armando-navarro approved these changes
+1 more reviewer
@keshavlingala keshavlingala keshavlingala approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@davideast davideast

Labels

backport: 20.1.x Cherry-pick onto the 20.1.x branch for a 20.1 patch release bump: patch Size of the change: a fix or docs change that reaches users comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Milestone

21.0.0-rc.1

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@fr-esco @armando-navarro @davideast @keshavlingala
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.