Closed Splaktar closed 2 years ago
As stated offline:
Though:
just a summary of what I found already when I worked with M1
Any news on this issue?
@pkirchniawy nope, I still get the same errors as above when using the latest master
. Since this is my primary machine, I consider this to be a P1 rather than a P3.
I went to the link in the error, but I'm not familiar enough with ibazel
to build it locally like @devversion did. It would be helpful if we could have some specific steps for that in this issue or in our developer docs.
I guess that this might be the specific steps that need to be done to use your own locally built ibazel
on an m1 mac:
https://github.com/bazelbuild/bazel-watcher/blob/master/README.md#compiling-yourself
Unfortunately, that didn't work for me as the local build failed since the rules_proto
404'd and it doesn't seem to like my bazel 4.2.1 installation:
Starting local Bazel server and connecting to it...
WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/9e4c622ba8c2178b71420ed3d14fb8874beee3a5.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
INFO: Analyzed target //ibazel:ibazel (65 packages loaded, 7364 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_splaktar/8fee38e85ee44a13c2ac34d7c1f24c9d/external/com_github_fsnotify_fsevents/BUILD.bazel:3:11: GoCompilePkg external/com_github_fsnotify_fsevents/darwin_amd64_stripped/fsevents%/github.com/fsnotify/fsevents.a failed: (Exit 1): builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix darwin_amd64 -src external/com_github_fsnotify_fsevents/fsevents.go -src ... (remaining 31 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
xcrun: error: can't exec '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_bazel/bazel/work/bazelwrap/cc' (errno=No such file or directory)
Error in child process '/usr/bin/xcrun'. 71
compilepkg: error running subcommand: exit status 2
Target //ibazel:ibazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 62.041s, Critical Path: 3.16s
INFO: 50 processes: 24 internal, 26 darwin-sandbox.
FAILED: Build did NOT complete successfully
$ bazel --version
bazel 4.2.1- (@non-git)
What version of bazel does this build expect? It seems like others are using 4.2.1 in other issues, so I think that this version might be okay?
It looks like this ibazel
piece is blocked by
These issues (and an associated issue in a dependency) have been open since November 2021 and there doesn't appear to be anyone working on them.
There is a PR open against bazel-watcher to add m1 mac support: https://github.com/bazelbuild/bazel-watcher/pull/496. It could use some reviews.
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)
I was able to build ibazel locally based on the pr branch, but when running ´yarn dev-app´ it is still using ibazel from the npm package installed. Even after setting ibazel into the PATH and running the dev-app script directly in the terminal it shows me zsh: command not found: ibazel
.
echo $PATH gives me this paths: /Users/user/Code/m1-bazel-watcher/bazel-bin/ibazel/ /Users/user/Code/m1-bazel-watcher/bazel-bin/ibazel/darwin_arm64_pure_stripped
Any suggestions?
@pkirchniawy you could run ibazel directly. e.g. ibazel run //src/dev-app:devserver
@pkirchniawy you could run ibazel directly. e.g.
ibazel run //src/dev-app:devserver
Thanks! I've already tried that. But ibazel is not a valid command. After compiling it locally, I struggle with setting the PATH right. (https://github.com/bazelbuild/bazel-watcher#compiling-yourself). So when I type ibazel run, it tells me command not found: ibazel.
interesting, that indicates that ibazel
is not part of the PATH
properly. I don't know to what you have set the PATH
, but usually it should include a path pointing to the directory containing the ibazel
executable binary.
echo $PATH gives me this paths: /Users/user/Code/m1-bazel-watcher/bazel-bin/ibazel/ /Users/user/Code/m1-bazel-watcher/bazel-bin/ibazel/darwin_arm64_pure_stripped
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:
$ yarn dev-app
yarn run v1.22.17
$ ibazel run //src/dev-app:devserver
iBazel [1:57PM]: You are using an experimental filesystem watcher. If you would like to disable that, please set the environment variable
IBAZEL_USE_LEGACY_WATCHER=1
iBazel [1:57PM]: Error getting Bazel info exit status 2
iBazel [1:57PM]: Querying for files to watch...
iBazel [1:57PM]: Error getting Bazel info exit status 2
Error finding remote repositories directory: exit status 2
iBazel [1:57PM]: Error getting Bazel info exit status 2
Error finding remote repositories directory: exit status 2
iBazel [1:57PM]: Running //src/dev-app:devserver
Loading:
Loading: 0 packages loaded
ERROR: Failed to load Starlark extension '@npm//@bazel/protractor:package.bzl'.
Cycle in the workspace file detected. This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
- @npm
- @nodejs_darwin_arm64
This could either mean you have to add the '@nodejs_darwin_arm64' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file.
ERROR: cycles detected during target parsing
INFO: Elapsed time: 0.120s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
iBazel [1:57PM]: Error running Bazel exit status 1
error Command failed with exit code 4.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Had the same issue @Splaktar. Made it work for me following these steps.
yarn
then yarn dev-app
first time did somehow fail, started again and it ran throughHope this helps.
I'm trying to make a change to https://github.com/angular/components/pull/24657. However, yarn test mdc-chips
errors out:
$ yarn test mdc-chips
yarn run v1.22.17
$ node ./scripts/run-component-tests.js mdc-chips
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.
Based on @kevinpauer 's comment above I tried manually updating @bazel/ibazel
to 0.16.2
in package.json
, then ran yarn
, then tried yarn test mdc-chips
again, with a different error:
$ yarn test mdc-chips
yarn run v1.22.17
$ node ./scripts/run-component-tests.js mdc-chips
iBazel [5:08PM]: You are using an experimental filesystem watcher. If you would like to disable that, please set the environment variable
IBAZEL_USE_LEGACY_WATCHER=1
iBazel [5:08PM]: Error getting Bazel info exit status 1
iBazel [5:08PM]: Querying for files to watch...
iBazel [5:08PM]: Error getting Bazel info exit status 1
Error finding remote repositories directory: exit status 1
iBazel [5:08PM]: Error getting Bazel info exit status 1
Error finding remote repositories directory: exit status 1
iBazel [5:08PM]: Testing //src/material-experimental/mdc-chips:unit_tests_chromium
2022/06/27 17:08:20 Downloading https://releases.bazel.build/4.0.0/release/bazel-4.0.0-darwin-arm64...
2022/06/27 17:08:20 could not download Bazel: HTTP GET https://releases.bazel.build/4.0.0/release/bazel-4.0.0-darwin-arm64 failed with error 404
iBazel [5:08PM]: Build error: exit status 1
I'm unsure how to proceed from here.
@RobertAKARobin thx for the details. I think your branch is outdated and would need a rebase. We updated both the bazel-watcher and Bazel already to an M1 compatible version.
That worked, thanks!
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.
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.
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:
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. (/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.
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. (/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. (/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.