Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: do not run pip install outside the bazel build framework #4647

Merged
merged 11 commits into from
Oct 31, 2024
Merged
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ steps:
- ./tools/licenses.sh /tmp/test-artifacts/licenses
- diff -rNu3 /tmp/test-artifacts/licenses ./licenses/data
- echo "--- gomocks"
- ./tools/gomocks.py diff
- make mocksdiff
- echo "--- antlr"
- rm -rf /tmp/test-artifacts/antlr
- cp -R antlr/ /tmp/test-artifacts/antlr
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all build build-dev dist-deb antlr clean docker-images gazelle go.mod licenses mocks protobuf scion-topo test test-integration write_all_source_files git-version
.PHONY: all build build-dev dist-deb antlr clean docker-images gazelle go.mod licenses mocks mocksdiff protobuf scion-topo test test-integration write_all_source_files git-version

build-dev:
rm -f bin/*
Expand Down Expand Up @@ -88,7 +88,10 @@ protobuf:
chmod 0644 pkg/proto/*/*.pb.go pkg/proto/*/*/*.pb.go

mocks:
tools/gomocks.py
bazel run //tools:gomocks

mocksdiff:
bazel run //tools:gomocks -- diff

gazelle: go_deps.bzl
bazel run //:gazelle --verbose_failures --config=quiet
Expand Down
1 change: 1 addition & 0 deletions tools/gomocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def rule_to_file(rule: str) -> Tuple[str, str]:

def mock_rules() -> List[str]:
bazel = plumbum.local['bazel']
os.chdir(os.environ.get("BUILD_WORKING_DIRECTORY","/nonexistium"))
raw_rules = bazel("query", "filter(\"go_default_mock$\", kind(gomock, //...))")
return raw_rules.splitlines()

Expand Down
2 changes: 1 addition & 1 deletion tools/install_deps
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if which apt-get >& /dev/null; then
elif which yum >& /dev/null; then
"$BASE/env/rhel/deps"
fi
"$BASE/env/pip3/deps"

Loading