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 June 15, 2022 03:39
@jbedard jbedard requested a review from alan-agius4 June 15, 2022 03:39
@jbedard jbedard force-pushed the yarn-private-cache branch 2 times, most recently from 4498874 to 260710e Compare June 15, 2022 22:42
@@ -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

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

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 This PR is targeted for the next minor release label Jun 16, 2022
@jbedard jbedard force-pushed the yarn-private-cache branch 2 times, most recently from d07a4d6 to 6d8af93 Compare June 16, 2022 16:26
@@ -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

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 June 16, 2022 20:21
@jbedard
Copy link
Contributor Author

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 June 24, 2022 23:18
@jbedard
Copy link
Contributor Author

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 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 clydin July 7, 2022 06:15
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jul 7, 2022
@alan-agius4 alan-agius4 merged commit 01b4ad8 into angular:main Jul 7, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants