Virtual-environments: Update bazelisk on macOS

Created on 30 Apr 2020  Â·  13Comments  Â·  Source: actions/virtual-environments

Tool information

  • Tool name: bazelisk
  • Tool license: Apache-2.0
  • Add or update? Update
  • Desired version: latest
  • Approximate size:

Area for Triage:
Apple

Question, Bug, or Feature?:
Bug / Feature

Virtual environments affected

  • [x] macOS 10.15
  • [ ] Ubuntu 16.04 LTS
  • [ ] Ubuntu 18.04 LTS
  • [ ] Windows Server 2016 R2
  • [ ] Windows Server 2019

Description

From my comment, https://github.com/actions/virtual-environments/issues/221#issuecomment-621817210

On macOS, please install bazelisk via homebrew, not via node/npm.

Why?

For now, if one installs bazel via brew install bazel, it generates the following error:

2020-04-30T12:26:11.9301010Z Error: The `brew link` step did not complete successfully
2020-04-30T12:26:11.9361170Z The formula built, but is not symlinked into /usr/local
2020-04-30T12:26:11.9361370Z Could not symlink bin/bazel
2020-04-30T12:26:11.9361480Z Target /usr/local/bin/bazel
2020-04-30T12:26:11.9361560Z already exists. You may want to remove it:
2020-04-30T12:26:11.9362920Z   rm '/usr/local/bin/bazel'
2020-04-30T12:26:11.9363100Z 
2020-04-30T12:26:11.9363260Z To force the link and overwrite all conflicting files:
2020-04-30T12:26:11.9364150Z   brew link --overwrite bazel
2020-04-30T12:26:11.9364270Z 
2020-04-30T12:26:11.9364440Z To list all files that would be deleted:
2020-04-30T12:26:11.9365270Z   brew link --overwrite --dry-run bazel
2020-04-30T12:26:11.9365370Z 
2020-04-30T12:26:11.9365530Z Possible conflicting files are:
2020-04-30T12:26:11.9366390Z /usr/local/bin/bazel -> /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk.js
2020-04-30T12:26:13.2173180Z ==> Caveats
2020-04-30T12:26:13.2173510Z Bash completion has been installed to:
2020-04-30T12:26:13.2173670Z   /usr/local/etc/bash_completion.d
2020-04-30T12:26:13.2173780Z 
2020-04-30T12:26:13.2173910Z zsh completions have been installed to:
2020-04-30T12:26:13.2175140Z   /usr/local/share/zsh/site-functions
2020-04-30T12:26:13.2175340Z ==> Summary

In macOS CI scripts, I think it's a typical workflow of installing bazel via brew, and it should not cause a conflict because of pre-installed bazelisk.

Packages Scripting and command line macOS feature request

All 13 comments

/cc @maxim-lobanov
/cc @YannisAgiomyrgiannakis who requested bazelisk in #221.

Thank you for logging this issue.
@soonho-tri , any ideas, will it cause regression for someone if we switch from npm installation to brew? Like use-cases that worked previously and will stop to work after switching.

But bazel is also presented in the image and bazelisk can be used to download newer bazle versions, so we should consider that scenario too.

@soonho-tri , any ideas, will it cause regression for someone if we switch from npm installation to brew? Like use-cases that worked previously and will stop to work after switching.

Have no idea. Bazelisk is mainly written in go and python, and I do not understand why it should be installed via npm.

bazelisk is a derived tool from bazel. It does not make sense if it interferes the installation of bazel. I would say that you can only provide bazel and ask users to install bazelisk by themselves if they want. brew install bazelisk takes only around 5 sec (including brew update time).

Ideally (meaning by design), bazelisk should not interfere with a
pre-installed version of bazel, but -yet- this is google software we are
talking about. :)

On Fri, May 1, 2020 at 8:25 AM Soonho Kong notifications@github.com wrote:

@soonho-tri https://github.com/soonho-tri , any ideas, will it cause
regression for someone if we switch from npm installation to brew? Like
use-cases that worked previously and will stop to work after switching.

Have no idea. Bazelisk is mainly written in go and python, and I do not
understand why it should be installed via npm.

bazelisk is a derived tool from bazel. It does not make sense if it
interferes the installation of bazel. I would say that you can only
provide bazel and ask users to install bazelisk by themselves if they
want. brew install bazelisk takes only around 5 sec (including brew update
time).

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/actions/virtual-environments/issues/812#issuecomment-622282382,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFZFII3RUN2CBMVCU6E5JULRPJ2PDANCNFSM4MVSLFXQ
.

--
best regards,
Yannis

I do not think there is an issue in bazel or bazelisk.

When bazelisk is installed via npm, it installed bazel at /usr/local/bin. When brew install bazel is run, it tries to install bazel at the same location, found an existing file, and exit with a warning.

@soonho-tri The simplest way here is to install both of the tools via brew, you're right.
brew install bazelisk
brew install bazel

@miketimofeev , agreed.

Is there a way I can make a PR to make this change? https://github.com/actions/virtual-environments/tree/master/images/macos only includes README.md file. I guess the image is not part of this repo?

@soonho-tri yeah, unfortunately, macOS image generation isn't open-sourced yet. I'll prepare PR with the changes in the private repo and let you know when the image is deployed.
Thanks!

@soonho-tri The changes will be deployed next week(approx 05/13 – 05/14)

@miketimofeev , thank you!

@soonho-tri the image has been deployed. Could you check everything is fine now, please?

Confirmed. Thanks for the update, @miketimofeev .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tnze picture Tnze  Â·  4Comments

orj picture orj  Â·  4Comments

shogo82148 picture shogo82148  Â·  3Comments

ethomson picture ethomson  Â·  4Comments

mcooley picture mcooley  Â·  3Comments