components: dev-infra: can't build project or run dev-app on MacBooks with m1 CPUs
What are you trying to do?
I’ve switched to an m1Max MacBook Pro as my main device now.
I’ve got Bazel 4.2.1 installed locally, but the build seems to be trying to install Bazel 4.0.0 and failing.
- Build the project
- Run the dev-app
What troubleshooting steps have you tried?
Setting my BAZEL
environment variable as discussed in https://github.com/angular/angular/issues/40498#issuecomment-973159023. This fixed Bazel builds for Framework, but not Components.
Reproduction
Steps to reproduce:
- yarn
- yarn build
splaktar-m1max:components splaktar$ yarn build
yarn run v1.22.17
$ ts-node --project scripts/tsconfig.json ./scripts/build-packages-dist.ts
######################################
Building release packages...
######################################
2021/11/18 13:54:15 Downloading https://releases.bazel.build/4.0.0/release/bazel-4.0.0-darwin-arm64...
2021/11/18 13:54:15 could not download Bazel: HTTP GET https://releases.bazel.build/4.0.0/release/bazel-4.0.0-darwin-arm64 failed with error 404
Error: Command failed: bazel query --output=label "attr('tags', '\[.*release-package.*\]', //src/...) intersect kind('.*_package', //src/...)"
at checkExecSyncError (node:child_process:826:11)
at execSync (node:child_process:900:15)
at exec (/Users/splaktar/Git/angular/components/scripts/build-packages-dist.ts:137:26)
at buildReleasePackages (/Users/splaktar/Git/angular/components/scripts/build-packages-dist.ts:69:19)
at performDefaultSnapshotBuild (/Users/splaktar/Git/angular/components/scripts/build-packages-dist.ts:56:10)
at Object.<anonymous> (/Users/splaktar/Git/angular/components/scripts/build-packages-dist.ts:43:3)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module.m._compile (/Users/splaktar/Git/angular/components/node_modules/ts-node/src/index.ts:1310:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Object.require.extensions.<computed> [as .ts] (/Users/splaktar/Git/angular/components/node_modules/ts-node/src/index.ts:1313:12) {
status: 1,
signal: null,
output: [ null, Buffer(0) [Uint8Array] [], null ],
pid: 63907,
stdout: Buffer(0) [Uint8Array] [],
stderr: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
- yarn dev-app
splaktar-m1max:components splaktar$ yarn dev-app
yarn run v1.22.17
$ ibazel run //src/dev-app:devserver
FATAL: Your platform/architecture combination darwin - arm64 is not yet supported.
Follow install instructions at https://github.com/bazelbuild/bazel-watcher/blob/master/README.md to compile for your system.
node:internal/validators:119
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received an instance of Promise
at new NodeError (node:internal/errors:371:5)
at validateString (node:internal/validators:119:11)
at normalizeSpawnArguments (node:child_process:503:3)
at spawn (node:child_process:691:13)
at main (/Users/splaktar/Git/angular/components/node_modules/@bazel/ibazel/index.js:82:18)
at Object.<anonymous> (/Users/splaktar/Git/angular/components/node_modules/@bazel/ibazel/index.js:96:3)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_INVALID_ARG_TYPE'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
- yarn test material/button
splaktar-m1max:components splaktar$ yarn test material/button
yarn run v1.22.17
$ node ./scripts/run-component-tests.js material/button
FATAL: Your platform/architecture combination darwin - arm64 is not yet supported.
Follow install instructions at https://github.com/bazelbuild/bazel-watcher/blob/master/README.md to compile for your system.
node:internal/validators:119
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received an instance of Promise
at new NodeError (node:internal/errors:371:5)
at validateString (node:internal/validators:119:11)
at normalizeSpawnArguments (node:child_process:503:3)
at spawn (node:child_process:691:13)
at main (/Users/splaktar/Git/angular/components/node_modules/@bazel/ibazel/index.js:82:18)
at Object.<anonymous> (/Users/splaktar/Git/angular/components/node_modules/@bazel/ibazel/index.js:96:3)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_INVALID_ARG_TYPE'
}
/Users/splaktar/Git/angular/components/node_modules/shelljs/src/common.js:401
if (config.fatal) throw e;
^
Error: exec: FATAL: Your platform/architecture combination darwin - arm64 is not yet supported.
Follow install instructions at https://github.com/bazelbuild/bazel-watcher/blob/master/README.md to compile for your system.
node:internal/validators:119
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received an instance of Promise
at new NodeError (node:internal/errors:371:5)
at validateString (node:internal/validators:119:11)
at normalizeSpawnArguments (node:child_process:503:3)
at spawn (node:child_process:691:13)
at main (/Users/splaktar/Git/angular/components/node_modules/@bazel/ibazel/index.js:82:18)
at Object.<anonymous> (/Users/splaktar/Git/angular/components/node_modules/@bazel/ibazel/index.js:96:3)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_INVALID_ARG_TYPE'
}
at Object.error (/Users/splaktar/Git/angular/components/node_modules/shelljs/src/common.js:110:27)
at execSync (/Users/splaktar/Git/angular/components/node_modules/shelljs/src/exec.js:102:12)
at Object._exec (/Users/splaktar/Git/angular/components/node_modules/shelljs/src/exec.js:205:12)
at Object.exec (/Users/splaktar/Git/angular/components/node_modules/shelljs/src/common.js:335:23)
at Object.<anonymous> (/Users/splaktar/Git/angular/components/scripts/run-component-tests.js:102:9)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Environment
- Angular: 13.0.1
- CDK/Material: master
- Browser(s): Chrome 95.0.4638.69 (Official Build) (arm64)
- Operating System (e.g. Windows, macOS, Ubuntu): macOS Monterey 12.0.1 (21A559)
- Bazel: 4.2.1- (@non-git)
/opt/local/bin/bazel
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (13 by maintainers)
Also wanted to mention that I will be using M1 only for the next couple of weeks/and potentially months (as I had to move without my Windows machine). So I’m sure we’ll be able to get to this very soon. Still want to mention though that I think the majority of workflows should work. The key really is currently using Bazel globally, and avoiding ibazel (or using a custom build)
Had the same issue @Splaktar. Made it work for me following these steps.
yarn
thenyarn dev-app
first time did somehow fail, started again and it ran throughHope this helps.
If I bump
https://github.com/angular/components/blob/3deca241f994cab5837909a4410256a9e0541cda/package.json#L89
to
0.16.2
, I get farther but now I see this: