Skip to content

Conversation

lukedirtwalker
Copy link
Collaborator

@lukedirtwalker lukedirtwalker commented Jan 8, 2020

By default bazel merges multiple bazelrc as described here:
https://docs.bazel.build/versions/master/guide.html#where-are-the-bazelrc-files
Therefore we just move the CI bazelrc file into the home folder so the remote-cache is applied.


This change is Reviewable

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @lukedirtwalker)

a discussion (no related file):
I personally find confusing so many BAZEL(RC)(CI) --bazel-rc --noworkspace
I would like maybe to have one global bazelrc for both local dev ci?
I suppose bazel ignores the localhost cache if does not exist.

I do no have strong opinion to block it, feel free to merge



Makefile, line 43 at r1 (raw file):

gazelle:
	bazel --bazelrc=${BAZELRC} run //:gazelle -- update -mode=$(GAZELLE_MODE) -index=false -external=external -exclude go/vendor -exclude docker/_build ./go

you can just hard code the BAZELRC value, or someone will overwrite it?


.buildkite/pipeline_buildlint.yml, line 32 at r1 (raw file):

    command:
      - "cp go.mod go.sum go_deps.bzl $$TEST_ARTIFACTS/"
      - make godeps -B

BASELRC=x make godeps instead of env?
or maybe do directly bazel command


.buildkite/pipeline_buildlint.yml, line 39 at r1 (raw file):

    key: go_deps_lint
    env:
      BAZELRC: ".bazelrc_ci --noworkspace_rc"

you insert argument in the the env (something like arg injection attack)

I would have global the --noworkspace and always use the --bazelrc argument

Copy link
Collaborator Author

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 7 files reviewed, 4 unresolved discussions (waiting on @karampok)

a discussion (no related file):

Previously, karampok (Konstantinos) wrote…

I personally find confusing so many BAZEL(RC)(CI) --bazel-rc --noworkspace
I would like maybe to have one global bazelrc for both local dev ci?
I suppose bazel ignores the localhost cache if does not exist.

I do no have strong opinion to block it, feel free to merge

Done.



Makefile, line 43 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

you can just hard code the BAZELRC value, or someone will overwrite it?

Done.


.buildkite/pipeline_buildlint.yml, line 32 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

BASELRC=x make godeps instead of env?
or maybe do directly bazel command

Done.


.buildkite/pipeline_buildlint.yml, line 39 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

you insert argument in the the env (something like arg injection attack)

I would have global the --noworkspace and always use the --bazelrc argument

Done.

@lukedirtwalker lukedirtwalker changed the title CI: Use only bazelrc_ci on CI CI: Use bazelrc_ci always on CI Jan 14, 2020
By default bazel merges multiple bazelrc as described here:
https://docs.bazel.build/versions/master/guide.html#where-are-the-bazelrc-files
On CI we don't care about the diskcache, therefore we use --noworkspace_rc now.

Also use it in more places.
Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 8 of 10 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@lukedirtwalker lukedirtwalker merged commit 974edb2 into scionproto:master Jan 14, 2020
@lukedirtwalker lukedirtwalker deleted the pubBAZELRC branch January 14, 2020 15:03
lukedirtwalker added a commit that referenced this pull request Jan 24, 2020
It seems that if `--disk-cache` with a valid location is present, bazel will ignore `--remote-cache`.
Thus we must override `--disk-cache` to the empty value in the `.bazelrc_ci` file,
so that on the CI only the remote cache is used.

Also switch to using the bazel cache via grpc.

The problem was introduced by #3591
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants