Skip to content
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

use private yarn pkg cache, ensure private npm/yarn bin always on path #23372

Merged
merged 4 commits into from Jul 7, 2022

Conversation

jbedard
Copy link
Contributor

@jbedard jbedard commented Jun 14, 2022

No description provided.

@jbedard jbedard marked this pull request as ready for review Jun 15, 2022
@jbedard jbedard requested a review from alan-agius4 Jun 15, 2022
@jbedard jbedard force-pushed the yarn-private-cache branch 2 times, most recently from 4498874 to 260710e Compare Jun 15, 2022
@@ -1,15 +1,17 @@
import { mkdir, writeFile } from 'fs/promises';
import { join } from 'path';
import { getGlobalVariable } from '../utils/env';
import { getGlobalVariable, setGlobalVariable } from '../utils/env';

/**
* Configure npm to use a unique sandboxed environment.
*/
export default async function () {
const tempRoot: string = getGlobalVariable('tmp-root');
Copy link
Collaborator

@alan-agius4 alan-agius4 Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the configured based on the package manager is used?

Copy link
Contributor Author

@jbedard jbedard Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The packages being tested (cli + yarn + npm) are all installed using npm before running the tests so I think we always need both (see 100-global-cli.ts).

@alan-agius4 alan-agius4 added the target: minor label Jun 16, 2022
@jbedard jbedard force-pushed the yarn-private-cache branch 2 times, most recently from d07a4d6 to 6d8af93 Compare Jun 16, 2022
@@ -13,5 +13,6 @@ export default async function () {
console.log(` ${envName}: ${process.env[envName]!.replace(/[\n\r]+/g, '\n ')}`);
});

await exec('which', 'ng', 'yarn', 'npm');
Copy link
Contributor Author

@jbedard jbedard Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit adding this line to ensure the correct ng/yarn/npm are being used. You can omit that commit if you don't think it's useful.

@jbedard jbedard force-pushed the yarn-private-cache branch 2 times, most recently from 4805a3b to 9af75cd Compare Jun 16, 2022
@jbedard
Copy link
Contributor Author

@jbedard jbedard commented Jun 17, 2022

Currently the esbuild tests are failing when the main project npm install occurs, but only on the npm+esbuild test and not the normal npm test.

    - Installing packages (npm)...
    npm WARN old lockfile 
    npm WARN old lockfile The package-lock.json file was created with an old version of npm,
    npm WARN old lockfile so supplemental metadata must be fetched from the registry.
    npm WARN old lockfile 
    npm WARN old lockfile This is a one-time fix-up, please be patient...

then what seems like every package outputs:

    npm WARN old lockfile Error: ENOENT: no such file or directory, open '/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/abab/package.json'

Any ideas? Why would esbuild change anything regarding the npm install?

EDIT: this seems to be after cac7b14

@jbedard jbedard force-pushed the yarn-private-cache branch 6 times, most recently from b2110d8 to 6278612 Compare Jun 24, 2022
@jbedard
Copy link
Contributor Author

@jbedard jbedard commented Jun 25, 2022

FWIW that esbuild job randomly switches between the error I listed above and:

  The esbuild browser application builder ('browser-esbuild') is currently experimental.
  The 'budgets' option is currently unsupported by this experimental builder and will be ignored.
  The 'extractLicenses' option is currently unsupported by this experimental builder and will be ignored.
  The 'fileReplacements' option is currently unsupported by this experimental builder and will be ignored.
  ✘ [ERROR] [plugin angular-compiler] Cannot resolve type entity i1.CommonModule to symbol
    This error came from the "onStart" callback registered here:
      node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:165:18:
        165 │             build.onStart(async () => {
            ╵                   ~~~~~~~
      at setup (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:165:19)
      at async handlePlugins (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:893:11)
  ✘ [ERROR] [plugin angular-compiler] Invalid plugin execution order
      node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:236:23:
        236 │                 assert.ok(fileEmitter, 'Invalid plugin execution ...
            ╵                        ^
      at /mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:236:24
      at callback (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:989:34)
      at handleRequest (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:717:36)
      at handleIncomingPacket (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:764:7)
      at Socket.readFromStdout (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:640:7)
      at Socket.emit (events.js:315:20)
      at addChunk (internal/streams/readable.js:309:12)
      at readableAddChunk (internal/streams/readable.js:284:9)
      at Socket.Readable.push (internal/streams/readable.js:223:10)
      at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
    This error came from the "onLoad" callback registered here:
      node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:234:18:
        234 │             build.onLoad({ filter: compilerOptions.allowJs ? /\.[...
            ╵                   ~~~~~~
      at setup (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:234:19)
      at async handlePlugins (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:893:11)
  ✘ [ERROR] [plugin angular-compiler] Invalid plugin execution order
      node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:236:23:
        236 │                 assert.ok(fileEmitter, 'Invalid plugin execution ...
            ╵                        ^
      at /mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:236:24
      at callback (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:989:34)
      at handleRequest (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:717:36)
      at handleIncomingPacket (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:764:7)
      at Socket.readFromStdout (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:640:7)
      at Socket.emit (events.js:315:20)
      at addChunk (internal/streams/readable.js:309:12)
      at readableAddChunk (internal/streams/readable.js:284:9)
      at Socket.Readable.push (internal/streams/readable.js:223:10)
      at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
    This error came from the "onLoad" callback registered here:
      node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:234:18:
        234 │             build.onLoad({ filter: compilerOptions.allowJs ? /\.[...
            ╵                   ~~~~~~
      at setup (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin.js:234:19)
      at async handlePlugins (/mnt/ramdisk/e2e-esbuild/e2e-test/test-project/node_modules/esbuild/lib/main.js:893:11)
      at ChildProcess.<anonymous> (/home/circleci/ng/tests/legacy-cli/e2e/utils/process.ts:112:20)
      at ChildProcess.emit (events.js:315:20)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

EDIT: this seems to be after cac7b14

@jbedard
Copy link
Contributor Author

@jbedard jbedard commented Jun 25, 2022

I'm going to drop cac7b14 for now so we can get the rest merged.

@jbedard jbedard requested a review from alan-agius4 Jun 25, 2022
@jbedard jbedard requested a review from clydin Jul 7, 2022
clydin
clydin approved these changes Jul 7, 2022
@alan-agius4 alan-agius4 added the action: merge label Jul 7, 2022
@alan-agius4 alan-agius4 merged commit 01b4ad8 into angular:main Jul 7, 2022
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge target: minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants