| commit | 4cf9bb0363d3fcba3b15f79a31601dc28eaa12d1 | [log] [tgz] |
|---|---|---|
| author | Leandro Lovisolo <lovisolo@google.com> | Wed Dec 13 03:15:58 2023 +0000 |
| committer | SkCQ <skcq-be@skia-corp.google.com.iam.gserviceaccount.com> | Wed Dec 13 13:50:11 2023 +0000 |
| tree | 343d2baf773afe7bc98a096373f88e98e42c0f15 | |
| parent | ae6a3a5123762e78185a357ac5d05924a0b733c1 [diff] |
[bazel] //cmd/presbmit/presubmit.go: Run "npm ci" step on CI. In https://skia-review.googlesource.com/c/buildbot/+/787329 I updated Prettier to v3.1.0. Since then, we have seen some (but not all) Housekeeper-OnDemand-Presubmit tasks fail with: npm WARN exec The following package was not found and will be installed: prettier npm ERR! code E451 npm ERR! 451 unknown - GET https://npm.skia.org/skia-infra/prettier/-/prettier-3.1.1.tgz Example: https://task-scheduler.skia.org/job/fybXDSw4BolKQ8FgX6ZP. The reason for this failure is that: - Bazel used to manage the node_modules directory for us, but this has ceased to be true since we upgraded to Bazel 6.0.0. This means we don't get a node_modules directory unless we explicitly create one, e.g. with "npm ci". - The "npx prettier" command first looks for a "prettier" package in node_modules, and if it does not find it, it tries to download the latest "prettier" version, apparently ignoring the exact version specified in //package.json and/or //package-lock.json. - "npx" fails to download "prettier" because the latest version (3.1.1) is too new, and therefore npm-audit-mirror rejects it, hence the 451 error. The solution I've found is to run "npm ci" right before "npx prettier", which ensures we have a node_modules directory. Bug: b/314813928 Change-Id: I2de92c62c82a682afd852f416330766eacfa5e9e Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/789219 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> Auto-Submit: Leandro Lovisolo <lovisolo@google.com>
This repo contains infrastructure code for Skia.
The main source code repository is a Git repository hosted at https://skia.googlesource.com/buildbot.git. It is possible to check out this repository directly with git clone or via go get.
Using git clone allows you to work in whatever directory you want. You will still need to set GOPATH in order to build some apps (recommended to put this in a cache dir). E.g.:
$ cd ${WORKDIR}
$ git clone https://skia.googlesource.com/buildbot.git
$ export GOPATH=${HOME}/.cache/gopath/$(basename ${WORKDIR})
$ mkdir $GOPATH
$ cd buildbot
Almost all applications are built with Bazel, and bazelisk is the recommended tool to ensure you have the right version of bazel installed:
go install github.com/bazelbuild/bazelisk@latest go install github.com/bazelbuild/buildtools/buildifier@latest go install github.com/kisielk/errcheck@latest go install golang.org/x/tools/cmd/goimports@latest go install github.com/mikefarah/yq/v4@latest go install go.chromium.org/luci/client/cmd/...@latest
sudo apt-get install jq
bazelisk build --config=mayberemote //...
bazelisk test --config=mayberemote //...
To update generated code run the following in any directory:
go generate ./...
Install Cloud SDK.
Use this command to run the presubmit tests:
./run_unittests --small