From 35f6644df33a0bcd483f172d6661c465b3c8e623 Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Tue, 10 Feb 2026 20:40:44 +0100 Subject: [PATCH 1/9] feat: bump some golang dependencies Make sure some golang dependencies are up to date --- go.mod | 27 ++++++++++++++------------- go.sum | 25 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 9c417d7e..4e0ee8a7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/rmohr/bazeldnf -go 1.23.0 +go 1.24.0 toolchain go1.24.1 @@ -12,12 +12,12 @@ require ( github.com/sassoftware/go-rpmutils v0.2.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.9.1 - golang.org/x/crypto v0.36.0 + golang.org/x/crypto v0.39.0 sigs.k8s.io/yaml v1.4.0 ) require ( - github.com/bazelbuild/rules_go v0.59.0 + github.com/bazelbuild/rules_go v0.60.0 github.com/jdx/go-netrc v1.0.0 ) @@ -30,29 +30,30 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/mock v1.7.0-rc.1 // indirect github.com/segmentio/fasthash v1.0.3 // indirect - golang.org/x/mod v0.24.0 // indirect - golang.org/x/sync v0.12.0 // indirect - golang.org/x/tools v0.31.0 // indirect + golang.org/x/mod v0.25.0 // indirect + golang.org/x/sync v0.15.0 // indirect + golang.org/x/tools v0.34.0 // indirect google.golang.org/genproto v0.0.0-20250115164207-1a7da9e5054f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect - google.golang.org/grpc v1.67.3 // indirect + google.golang.org/genproto/googleapis/bytestream v0.0.0-20251124214823-79d6a2a48846 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect + google.golang.org/grpc v1.71.0 // indirect google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 // indirect ) require ( github.com/adrg/xdg v0.5.3 github.com/golang/protobuf v1.5.4 // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.18.0 github.com/spf13/pflag v1.0.6 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 - golang.org/x/net v0.37.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/text v0.23.0 // indirect - google.golang.org/protobuf v1.36.3 // indirect + golang.org/x/net v0.41.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.26.0 // indirect + google.golang.org/protobuf v1.36.10 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index c16a642c..44514b2c 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ github.com/bazelbuild/rules_go v0.53.0 h1:u160DT+RRb+Xb2aSO4piN8xhs4aZvWz2UDXCq4 github.com/bazelbuild/rules_go v0.53.0/go.mod h1:xB1jfsYHWlnZyPPxzlOSst4q2ZAwS251Mp9Iw6TPuBc= github.com/bazelbuild/rules_go v0.59.0 h1:RLhOwYIqeMgBpKelHEWTfIPjA37so3oa/rX+/qqq/P4= github.com/bazelbuild/rules_go v0.59.0/go.mod h1:Pn30cb4M513fe2rQ6GiJ3q8QyrRsgC7zhuDvi50Lw4Y= +github.com/bazelbuild/rules_go v0.60.0 h1:apGSxTTrFUyLNvX9NQmF4CbntWAO0/S5eALeVgB/6Qk= +github.com/bazelbuild/rules_go v0.60.0/go.mod h1:CYcohJVxs4n7eftbC39GCqaEJm3E1EME+6QAkGguKoI= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/crillab/gophersat v1.4.0 h1:irf9ajKmNnEURjgPU4oz+ouqIXXLQ59ZNd3NC+hULMc= github.com/crillab/gophersat v1.4.0/go.mod h1:gDzeMEBrqJR20IL9JW25tFHNGLU5+GDeJzr0zpi3mxs= @@ -29,6 +31,7 @@ github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6 github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -90,6 +93,8 @@ golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -97,6 +102,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -104,12 +111,16 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -119,6 +130,8 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -126,6 +139,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -133,20 +148,30 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20250115164207-1a7da9e5054f h1:387Y+JbxF52bmesc8kq1NyYIp33dnxCw6eiA7JMsTmw= google.golang.org/genproto v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:0joYwWwLQh18AOj8zMYeZLjzuqcYTU3/nC5JdCvC3JI= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20251124214823-79d6a2a48846 h1:7FlucM2tFADtEDnIlDrR12KdRqV48B1GSTU1U6uKSiY= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20251124214823-79d6a2a48846/go.mod h1:G3Q0qS3k/oFEmVMddPsSYcFnm2+Mq2XRmxujrtu5hr0= google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.67.3 h1:OgPcDAFKHnH8X3O4WcO4XUc8GRDeKsKReqbQtiCj7N8= google.golang.org/grpc v1.67.3/go.mod h1:YGaHCc6Oap+FzBJTZLBzkGSYt/cvGPFTPxkn7QfSU8s= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 63fde3ec02daf33d5ab39defb066b2830c50bd25 Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Mon, 9 Feb 2026 20:05:33 +0100 Subject: [PATCH 2/9] bazel: use rules_bazel_integration_test for e2e Start using rules_bazel_integration_test to drive unit tests, this initial step allows us to simplify our e2e testing, next commit will let us speed up the build by avoiding rebuilding the toolchain over and over again --- .aspect/bazelrc/BUILD.bazel | 6 ++ .bazelignore | 30 +++++- .bazelrc | 10 +- .github/workflows/action.yml | 6 +- BUILD.bazel | 26 +++++ MODULE.bazel | 24 ++++- Makefile | 57 ++-------- REPO.bazel | 6 ++ bazeldnf/BUILD.bazel | 6 ++ bazeldnf/private/BUILD.bazel | 6 ++ e2e/BUILD.bazel | 199 +++++++++++++++++++++++++++++++++++ internal/BUILD.bazel | 6 ++ tools/BUILD.bazel | 6 ++ 13 files changed, 333 insertions(+), 55 deletions(-) create mode 100644 REPO.bazel create mode 100644 e2e/BUILD.bazel diff --git a/.aspect/bazelrc/BUILD.bazel b/.aspect/bazelrc/BUILD.bazel index bfa2fb35..adf63e80 100644 --- a/.aspect/bazelrc/BUILD.bazel +++ b/.aspect/bazelrc/BUILD.bazel @@ -2,4 +2,10 @@ load("@aspect_bazel_lib//lib:bazelrc_presets.bzl", "write_aspect_bazelrc_presets") +filegroup( + name = "all_files", + srcs = glob(["**"]), + visibility = ["//:__pkg__"], +) + write_aspect_bazelrc_presets(name = "update_aspect_bazelrc_presets") diff --git a/.bazelignore b/.bazelignore index c7ca8d09..13c7fff0 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1 +1,29 @@ -e2e +# make sure we ignore bazel managed directories for e2e tests +e2e/bazel-bzlmod-lock-file-from-args/bazel-bin +e2e/bazel-bzlmod-lock-file-from-args/bazel-out +e2e/bazel-bzlmod-lock-file-from-args/bazel-bazel-bzlmod-lock-file-from-args +e2e/bazel-bzlmod-lock-file-from-args/bazel-testlogs +e2e/bazel-bzlmod-lock-file/bazel-bin +e2e/bazel-bzlmod-lock-file/bazel-out +e2e/bazel-bzlmod-lock-file/bazel-bazel-bzlmod-lock-file +e2e/bazel-bzlmod-lock-file/bazel-testlogs +e2e/bazel-bzlmod-toolchain-from-source-lock-file/bazel-bin +e2e/bazel-bzlmod-toolchain-from-source-lock-file/bazel-out +e2e/bazel-bzlmod-toolchain-from-source-lock-file/bazel-bazel-bzlmod-toolchain-from-source-lock-file +e2e/bazel-bzlmod-toolchain-from-source-lock-file/bazel-testlogs +e2e/bazel-bzlmod-toolchain-from-source/bazel-bin +e2e/bazel-bzlmod-toolchain-from-source/bazel-out +e2e/bazel-bzlmod-toolchain-from-source/bazel-bazel-bzlmod-toolchain-from-source +e2e/bazel-bzlmod-toolchain-from-source/bazel-testlogs +e2e/bazel-bzlmod/bazel-bin +e2e/bazel-bzlmod/bazel-out +e2e/bazel-bzlmod/bazel-bazel-bzlmod +e2e/bazel-bzlmod/bazel-testlogs +e2e/bazel-workspace/bazel-bin +e2e/bazel-workspace/bazel-out +e2e/bazel-workspace/bazel-bazel-workspace +e2e/bazel-workspace/bazel-testlogs +e2e/bzlmod-toolchain-circular-dependencies/bazel-bin +e2e/bzlmod-toolchain-circular-dependencies/bazel-out +e2e/bzlmod-toolchain-circular-dependencies/bazel-bzlmod-toolchain-circular-dependencies +e2e/bzlmod-toolchain-circular-dependencies/bazel-testlogs diff --git a/.bazelrc b/.bazelrc index 3700c9e5..85aebe6e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,12 +1,18 @@ # Import Aspect bazelrc presets -import %workspace%/.aspect/bazelrc/bazel7.bazelrc # will only work in bazel7+ +import %workspace%/.aspect/bazelrc/bazel7.bazelrc import %workspace%/.aspect/bazelrc/convenience.bazelrc import %workspace%/.aspect/bazelrc/correctness.bazelrc import %workspace%/.aspect/bazelrc/debug.bazelrc import %workspace%/.aspect/bazelrc/performance.bazelrc +# Prevent Bazel from treating e2e child workspace BUILD files as packages +common --deleted_packages=e2e/bazel-workspace,e2e/bazel-bzlmod,e2e/bazel-bzlmod-lock-file,e2e/bazel-bzlmod-lock-file-from-args,e2e/bazel-bzlmod-toolchain-from-source,e2e/bazel-bzlmod-toolchain-from-source-lock-file,e2e/bzlmod-toolchain-circular-dependencies + # Specific project flags go here if we have some + +# use prebuilt protoc common --incompatible_enable_proto_toolchain_resolution +common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc # inside the rules project we build from source common --extra_toolchains=//cmd:bazeldnf-host-toolchain @@ -15,6 +21,8 @@ common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc # make sure bazel doesn't complain on hosts without java common --java_runtime_version=remotejdk_21 +test --test_tag_filters=-allowed-to-fail + # Load any settings & overrides specific to the current user from `.bazelrc.user`. # This file should appear in `.gitignore` so that settings are not shared with team members. This # should be last statement in this config so the user configuration is able to overwrite flags from diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index b3ed4e0b..427a3911 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -28,8 +28,10 @@ jobs: repository-cache: true # enable some flags for CI bazelrc: | - import %workspace%/.aspect/bazelrc/ci.bazelrc - import %workspace%/.github/workflows/ci.bazelrc + try-import %workspace%/.aspect/bazelrc/ci.bazelrc + try-import %workspace%/.github/workflows/ci.bazelrc + try-import %workspace%/../../.aspect/bazelrc/ci.bazelrc + try-import %workspace%/../../.github/workflows/ci.bazelrc # keep a cache for MODULE.bazel repos external-cache: true - run: bazelisk build //... && bazelisk test //... diff --git a/BUILD.bazel b/BUILD.bazel index ba608e97..47f9db94 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -15,6 +15,7 @@ gazelle_binary( ) # gazelle:exclude .bazelbsp +# gazelle:exclude e2e/*/* # gazelle:prefix github.com/rmohr/bazeldnf # gazelle:resolve go github.com/bazelbuild/buildtools/build @com_github_bazelbuild_buildtools//build:go_default_library # gazelle:resolve go github.com/bazelbuild/buildtools/edit @com_github_bazelbuild_buildtools//edit:go_default_library @@ -95,3 +96,28 @@ bzl_library( ) # gazelle:exclude deps.bzl + +# Aggregates all parent workspace files so that child workspaces using +# local_path_override(path = "../..") can resolve the full module. +filegroup( + name = "local_repository_files", + srcs = glob( + [ + "*", + ".*", + ], + exclude = [ + "MODULE.bazel.lock", + "REPO.bazel", + ], + ) + [ + "//.aspect/bazelrc:all_files", + "//bazeldnf:all_files", + "//bazeldnf/private:all_files", + "//internal:all_files", + "//tools:all_files", + ], + visibility = [ + "//e2e:__subpackages__", + ], +) diff --git a/MODULE.bazel b/MODULE.bazel index 668ced83..f575ad6c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -88,11 +88,31 @@ use_repo( "bazeldnf_internal_libvirt-libs", ) -bazel_dep(name = "protobuf", version = "33.5", dev_dependency = True) - # deps only needed for the repo internals +bazel_dep(name = "protobuf", version = "33.5", dev_dependency = True) bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.9.0", dev_dependency = True) bazel_dep(name = "aspect_bazel_lib", version = "2.22.5", dev_dependency = True) bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.2", dev_dependency = True) bazel_dep(name = "rules_pkg", version = "1.2.0", dev_dependency = True) bazel_dep(name = "rules_cc", version = "0.2.16", dev_dependency = True) + +# e2e / integration testing +bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = True) +bazel_dep(name = "rules_bazel_integration_test", version = "0.37.1", dev_dependency = True) + +bazel_binaries = use_extension( + "@rules_bazel_integration_test//:extensions.bzl", + "bazel_binaries", + dev_dependency = True, +) +bazel_binaries.download(version = "6.5.0") +bazel_binaries.download(version = "7.6.0") +bazel_binaries.download(version = "8.1.0") +use_repo( + bazel_binaries, + "bazel_binaries", + "bazel_binaries_bazelisk", + "build_bazel_bazel_6_5_0", + "build_bazel_bazel_7_6_0", + "build_bazel_bazel_8_1_0", +) diff --git a/Makefile b/Makefile index 5904670d..df20d4a1 100644 --- a/Makefile +++ b/Makefile @@ -16,66 +16,25 @@ gofmt: gofmt -w pkg/.. cmd/.. e2e-workspace: - @for version in 6.x 7.x; do \ - ( \ - cd e2e/bazel-workspace && \ - echo "Testing $$version in workspace mode" > /dev/stderr && \ - USE_BAZEL_VERSION=$$version bazelisk --batch build //...\ - ) \ - done + bazel test e2e:workspace e2e-bzlmod: - @for version in 7.x 8.x; do \ - ( \ - cd e2e/bazel-bzlmod && \ - echo "Testing $$version with bzlmod" > /dev/stderr && \ - USE_BAZEL_VERSION=$$version bazelisk --batch build //...\ - ) \ - done + bazel test e2e:bzlmod e2e-bazel-bzlmod-lock-file: - @for version in 7.x 8.x; do \ - ( \ - cd e2e/bazel-bzlmod-lock-file && \ - echo "Testing $$version with bzlmod with lock file" > /dev/stderr && \ - USE_BAZEL_VERSION=$$version bazelisk --batch build //...\ - ) \ - done + bazel test e2e:bzlmod-lock-file e2e-bzlmod-build-toolchain: - @for version in 7.x 8.x; do \ - ( \ - cd e2e/bazel-bzlmod-toolchain-from-source && \ - echo "Testing $$version with bzlmod build toolchain" > /dev/stderr && \ - USE_BAZEL_VERSION=$$version bazelisk --batch build //... --incompatible_enable_proto_toolchain_resolution \ - ) \ - done + bazel test e2e:bzlmod-toolchain-from-source e2e-bazel-bzlmod-lock-file-from-args: - @for version in 7.x 8.x; do \ - ( \ - cd e2e/bazel-bzlmod-lock-file-from-args && \ - echo "Testing $$version bzlmod lock file from args" > /dev/stderr && \ - USE_BAZEL_VERSION=$$version bazelisk --batch build //... --incompatible_enable_proto_toolchain_resolution \ - ) \ - done + bazel test e2e:lock-file-from-args e2e-bzlmod-toolchain-circular-dependencies: - @for version in 7.x 8.x; do \ - ( \ - cd e2e/bzlmod-toolchain-circular-dependencies && \ - echo "Testing $$version bzlmod lock file from args" > /dev/stderr && \ - USE_BAZEL_VERSION=$$version bazelisk --batch build //... --incompatible_enable_proto_toolchain_resolution \ - ) \ - done + bazel test e2e:circular-deps - -e2e: e2e-workspace \ - e2e-bzlmod \ - e2e-bzlmod-build-toolchain \ - e2e-bazel-bzlmod-lock-file \ - e2e-bazel-bzlmod-lock-file-from-args \ - e2e-bzlmod-toolchain-circular-dependencies +e2e: + bazel test e2e fmt: gofmt buildifier diff --git a/REPO.bazel b/REPO.bazel new file mode 100644 index 00000000..5a2968d0 --- /dev/null +++ b/REPO.bazel @@ -0,0 +1,6 @@ +"list of directories the top level bazel shouldn't dive into" + +ignore_directories([ + ".git", + "e2e/*/bazel-*", +]) diff --git a/bazeldnf/BUILD.bazel b/bazeldnf/BUILD.bazel index 9095fd50..cdc0950f 100644 --- a/bazeldnf/BUILD.bazel +++ b/bazeldnf/BUILD.bazel @@ -1,6 +1,12 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") load("//bazeldnf/private:resolved_bazeldnf_toolchain.bzl", "resolved_bazeldnf_toolchain") +filegroup( + name = "all_files", + srcs = glob(["**"]), + visibility = ["//:__pkg__"], +) + # this directory contains the public API from bazeldnf, anything on this directory # should be buildable withtout dev dependencies # diff --git a/bazeldnf/private/BUILD.bazel b/bazeldnf/private/BUILD.bazel index c7026ace..d6011e9b 100644 --- a/bazeldnf/private/BUILD.bazel +++ b/bazeldnf/private/BUILD.bazel @@ -1,5 +1,11 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") +filegroup( + name = "all_files", + srcs = glob(["**"]), + visibility = ["//:__pkg__"], +) + bzl_library( name = "toolchains_repo", srcs = ["toolchains_repo.bzl"], diff --git a/e2e/BUILD.bazel b/e2e/BUILD.bazel new file mode 100644 index 00000000..bf284301 --- /dev/null +++ b/e2e/BUILD.bazel @@ -0,0 +1,199 @@ +load("@bazel_binaries//:defs.bzl", "bazel_binaries") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load( + "@rules_bazel_integration_test//bazel_integration_test:defs.bzl", + "bazel_integration_tests", + "default_test_runner", + "integration_test_utils", +) + +WORKSPACE_BAZEL_VERSIONS = [ + "6.5.0", + "7.6.0", +] + +BZLMOD_BAZEL_VERSIONS = [ + "7.6.0", + "8.1.0", +] + +default_test_runner( + name = "test-runner", + bazel_cmds = ["build //..."], +) + +# bazel-workspace: legacy WORKSPACE mode (Bazel 6.x, 7.x) +bazel_integration_tests( + name = "e2e_workspace", + timeout = "short", + bazel_binaries = bazel_binaries, + bazel_versions = WORKSPACE_BAZEL_VERSIONS, + test_runner = ":test-runner", + workspace_files = integration_test_utils.glob_workspace_files("bazel-workspace") + [ + "//:local_repository_files", + ], + workspace_path = "bazel-workspace", +) + +# bazel-bzlmod: basic bzlmod with prebuilt toolchain +bazel_integration_tests( + name = "e2e_bzlmod", + timeout = "short", + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + test_runner = ":test-runner", + workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod") + [ + "//:local_repository_files", + ], + workspace_path = "bazel-bzlmod", +) + +# bazel-bzlmod-lock-file: bzlmod with lock files +bazel_integration_tests( + name = "e2e_bzlmod_lock_file", + timeout = "short", + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + test_runner = ":test-runner", + workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-lock-file") + [ + "//:local_repository_files", + ], + workspace_path = "bazel-bzlmod-lock-file", +) + +# bazel-bzlmod-toolchain-from-source: toolchain built from source +bazel_integration_tests( + name = "e2e_bzlmod_toolchain_from_source", + timeout = "short", + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + test_runner = ":test-runner", + workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-toolchain-from-source") + [ + "//:local_repository_files", + ], + workspace_path = "bazel-bzlmod-toolchain-from-source", +) + +# bazel-bzlmod-toolchain-from-source-lock-file: toolchain from source with lock file +bazel_integration_tests( + name = "e2e_bzlmod_toolchain_from_source_lock_file", + timeout = "short", + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + test_runner = ":test-runner", + workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-toolchain-from-source-lock-file") + [ + "//:local_repository_files", + ], + workspace_path = "bazel-bzlmod-toolchain-from-source-lock-file", +) + +default_test_runner( + name = "lock-file-from-args-runner", + bazel_cmds = [ + "run :bazeldnf -- fetch", + "run @bazeldnf_rpms//:update-lock-file", + "build //...", + ], +) + +bazel_integration_tests( + name = "e2e_lock_file_from_args", + timeout = "short", + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + test_runner = ":lock-file-from-args-runner", + workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-lock-file-from-args") + [ + "//:local_repository_files", + ], + workspace_path = "bazel-bzlmod-lock-file-from-args", +) + +default_test_runner( + name = "test-runner_circular_deps", + bazel_cmds = [ + "run @bazeldnf_rpms//:fetch-repo", + "run @bazeldnf_rpms//:update-lock-file", + "build //...", + ], +) + +bazel_integration_tests( + name = "e2e_circular_deps", + timeout = "short", + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = ALLOWED_TO_FAIL_TAGS, # TODO: drop once the circular dependencies passes + test_runner = ":test-runner_circular_deps", + workspace_files = integration_test_utils.glob_workspace_files("bzlmod-toolchain-circular-dependencies") + [ + "//:local_repository_files", + ], + workspace_path = "bzlmod-toolchain-circular-dependencies", +) + +test_suite( + name = "workspace", + tests = integration_test_utils.bazel_integration_test_names( + "e2e_workspace", + WORKSPACE_BAZEL_VERSIONS, + ), +) + +test_suite( + name = "bzlmod", + tests = integration_test_utils.bazel_integration_test_names( + "e2e_bzlmod", + BZLMOD_BAZEL_VERSIONS, + ), +) + +test_suite( + name = "bzlmod-lock-file", + tests = integration_test_utils.bazel_integration_test_names( + "e2e_bzlmod_lock_file", + BZLMOD_BAZEL_VERSIONS, + ), +) + +test_suite( + name = "bzlmod-toolchain-from-source", + tests = integration_test_utils.bazel_integration_test_names( + "e2e_bzlmod_toolchain_from_source", + BZLMOD_BAZEL_VERSIONS, + ), +) + +test_suite( + name = "circular-deps", + tags = ALLOWED_TO_FAIL_TAGS, # TODO: drop once the circular dependencies passes + tests = integration_test_utils.bazel_integration_test_names( + "e2e_circular_deps", + BZLMOD_BAZEL_VERSIONS, + ), +) + +test_suite( + name = "lock-file-from-args", + tests = integration_test_utils.bazel_integration_test_names( + "e2e_lock_file_from_args", + BZLMOD_BAZEL_VERSIONS, + ), +) + +test_suite( + name = "e2e", + tests = [ + ":workspace", + ":bzlmod", + ":bzlmod-lock-file", + ":bzlmod-toolchain-from-source", + # ":circular-deps", # TODO: uncomment once circular dependencies are fixed + ":lock-file-from-args", + ], +) + +bzl_library( + name = "helpers", + srcs = ["helpers.bzl"], + visibility = ["//visibility:public"], + deps = ["@bazel_skylib//lib:paths"], +) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 815a82a5..0908abbe 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -1,5 +1,11 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") +filegroup( + name = "all_files", + srcs = glob(["**"]), + visibility = ["//:__pkg__"], +) + exports_files(["runner.bash.template"]) bzl_library( diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 7eadf2aa..d67c7fc4 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -1,5 +1,11 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") +filegroup( + name = "all_files", + srcs = glob(["**"]), + visibility = ["//:__pkg__"], +) + bzl_library( name = "integrity", srcs = ["integrity.bzl"], From bb6cdb6a62969353fb078a92d3651b83471f49d8 Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Mon, 9 Feb 2026 21:52:53 +0100 Subject: [PATCH 3/9] feat: e2e build the golang binary only once Make sure that all our e2e tests use a prebuilt golang binary for the host platform and that we don't build it once for each test --- BUILD.bazel | 1 + e2e/BUILD.bazel | 2 +- tools/e2e/BUILD.bazel | 44 +++++++++++++++++++++++++++++++++ tools/e2e/toolchain.BUILD.bazel | 22 +++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tools/e2e/BUILD.bazel create mode 100644 tools/e2e/toolchain.BUILD.bazel diff --git a/BUILD.bazel b/BUILD.bazel index 47f9db94..0fb71a0e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -116,6 +116,7 @@ filegroup( "//bazeldnf/private:all_files", "//internal:all_files", "//tools:all_files", + "//tools/e2e:toolchain", ], visibility = [ "//e2e:__subpackages__", diff --git a/e2e/BUILD.bazel b/e2e/BUILD.bazel index bf284301..5b2bc675 100644 --- a/e2e/BUILD.bazel +++ b/e2e/BUILD.bazel @@ -19,7 +19,7 @@ BZLMOD_BAZEL_VERSIONS = [ default_test_runner( name = "test-runner", - bazel_cmds = ["build //..."], + bazel_cmds = ["build --extra_toolchains=@bazeldnf//tools/e2e/output:toolchain //..."], ) # bazel-workspace: legacy WORKSPACE mode (Bazel 6.x, 7.x) diff --git a/tools/e2e/BUILD.bazel b/tools/e2e/BUILD.bazel new file mode 100644 index 00000000..89476332 --- /dev/null +++ b/tools/e2e/BUILD.bazel @@ -0,0 +1,44 @@ +"Create a toolchain tar archive we can pass as input to the e2e tests" + +load("@aspect_bazel_lib//lib:copy_file.bzl", "copy_file") + +# copy the binary into our target folder +copy_file( + name = "binary-non-win", + src = "//cmd", + out = "output/cmd", + is_executable = True, +) + +copy_file( + name = "binary-win", + src = "//cmd", + out = "output/cmd.exe", + is_executable = True, + target_compatible_with = [ + "@platforms//os:windows", + ], +) + +alias( + name = "binary", + actual = select({ + "@platforms//os:windows": ":binary-win", + "//conditions:default": "binary-non-win", + }), +) + +copy_file( + name = "toolchain-build", + src = "toolchain.BUILD.bazel", + out = "output/BUILD.bazel", +) + +filegroup( + name = "toolchain", + srcs = [ + ":binary", + ":toolchain-build", + ], + visibility = ["//:__pkg__"], +) diff --git a/tools/e2e/toolchain.BUILD.bazel b/tools/e2e/toolchain.BUILD.bazel new file mode 100644 index 00000000..a98ee460 --- /dev/null +++ b/tools/e2e/toolchain.BUILD.bazel @@ -0,0 +1,22 @@ +"Fake BUILD.bazel we will have in the prebuilt toolchain" + +load("@bazeldnf//bazeldnf:toolchain.bzl", "bazeldnf_toolchain") + +alias( + name = "cmd.binary", + actual = select({ + "@platforms//os:windows": "cmd.exe", + "//conditions:default": "cmd", + }), +) + +bazeldnf_toolchain( + name = "bazeldnf_toolchain", + tool = ":cmd.binary", +) + +toolchain( + name = "toolchain", + toolchain = ":bazeldnf_toolchain", + toolchain_type = "@bazeldnf//bazeldnf:toolchain_type", +) From 02df1923df1d02bec6c600dce231fa8f34fbcb2a Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Mon, 9 Feb 2026 21:59:27 +0100 Subject: [PATCH 4/9] feat: make use of prebuilt toolchain for e2e Make sure all of our e2e use a shared prebuilt bazeldnf binary instead of each one building their own, this simplifies our MODULE.bazel for all of our e2e tests considerably as we no longer to keep prebuilt protoc or golang dependencies --- e2e/bazel-bzlmod-lock-file-from-args/.bazelrc | 4 -- .../MODULE.bazel | 36 ---------------- e2e/bazel-bzlmod-lock-file/.bazelrc | 1 - e2e/bazel-bzlmod-lock-file/MODULE.bazel | 41 +------------------ .../.bazelrc | 4 -- .../MODULE.bazel | 1 - .../.bazelrc | 2 - .../MODULE.bazel | 39 ------------------ e2e/bazel-bzlmod/MODULE.bazel | 3 ++ e2e/bazel-workspace/WORKSPACE | 5 --- .../.bazelrc | 4 -- .../MODULE.bazel | 39 ------------------ 12 files changed, 5 insertions(+), 174 deletions(-) diff --git a/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc b/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc index 6b6c94e8..d23479cb 100644 --- a/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc +++ b/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc @@ -7,10 +7,6 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc # Specific project flags go here if we have some common --enable_bzlmod -common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain - -# prebuilt protoc -common --incompatible_enable_proto_toolchain_resolution # Load any settings & overrides specific to the current user from `.bazelrc.user`. # This file should appear in `.gitignore` so that settings are not shared with team members. This diff --git a/e2e/bazel-bzlmod-lock-file-from-args/MODULE.bazel b/e2e/bazel-bzlmod-lock-file-from-args/MODULE.bazel index e5b1f6ba..2c4e7cee 100644 --- a/e2e/bazel-bzlmod-lock-file-from-args/MODULE.bazel +++ b/e2e/bazel-bzlmod-lock-file-from-args/MODULE.bazel @@ -9,32 +9,6 @@ local_path_override( ) bazel_dep(name = "rules_pkg", version = "1.1.0") -bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "rules_go") - -go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.24.1") - -bazel_dep(name = "gazelle", version = "0.47.0") - -go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") -go_deps.from_file(go_mod = "@bazeldnf//:go.mod") -use_repo( - go_deps, - "com_github_adrg_xdg", - "com_github_bazelbuild_buildtools", - "com_github_crillab_gophersat", - "com_github_hashicorp_go_retryablehttp", - "com_github_jdx_go_netrc", - "com_github_klauspost_compress", - "com_github_onsi_gomega", - "com_github_sassoftware_go_rpmutils", - "com_github_sirupsen_logrus", - "com_github_spf13_cobra", - "com_github_ulikunitz_xz", - "io_k8s_sigs_yaml", - "org_golang_x_crypto", - "org_golang_x_exp", -) bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain") bazeldnf_toolchain.register(disable = True) @@ -64,13 +38,3 @@ use_repo( bazeldnf, "bazeldnf_rpms", ) - -bazel_dep(name = "toolchains_protoc", version = "0.6.0", dev_dependency = True) - -protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc", dev_dependency = True) -use_repo(protoc, "toolchains_protoc_hub") - -register_toolchains( - "@toolchains_protoc_hub//:all", - dev_dependency = True, -) diff --git a/e2e/bazel-bzlmod-lock-file/.bazelrc b/e2e/bazel-bzlmod-lock-file/.bazelrc index 0b8b0486..6d22ade3 100644 --- a/e2e/bazel-bzlmod-lock-file/.bazelrc +++ b/e2e/bazel-bzlmod-lock-file/.bazelrc @@ -6,7 +6,6 @@ import %workspace%/../../.aspect/bazelrc/debug.bazelrc import %workspace%/../../.aspect/bazelrc/performance.bazelrc common --enable_bzlmod -common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain # Specific project flags go here if we have some diff --git a/e2e/bazel-bzlmod-lock-file/MODULE.bazel b/e2e/bazel-bzlmod-lock-file/MODULE.bazel index 8774e88a..2b81ef9d 100644 --- a/e2e/bazel-bzlmod-lock-file/MODULE.bazel +++ b/e2e/bazel-bzlmod-lock-file/MODULE.bazel @@ -9,46 +9,9 @@ local_path_override( ) bazel_dep(name = "rules_pkg", version = "1.1.0") -bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "rules_go") -go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.24.1") - -bazel_dep(name = "gazelle", version = "0.47.0") - -go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") -go_deps.from_file(go_mod = "@bazeldnf//:go.mod") -use_repo( - go_deps, - "com_github_adrg_xdg", - "com_github_bazelbuild_buildtools", - "com_github_crillab_gophersat", - "com_github_hashicorp_go_retryablehttp", - "com_github_jdx_go_netrc", - "com_github_klauspost_compress", - "com_github_onsi_gomega", - "com_github_sassoftware_go_rpmutils", - "com_github_sirupsen_logrus", - "com_github_spf13_cobra", - "com_github_ulikunitz_xz", - "io_k8s_sigs_yaml", - "org_golang_x_crypto", - "org_golang_x_exp", -) - -bazel_dep(name = "toolchains_protoc", version = "0.6.0") - -protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc") -protoc.toolchain( - google_protobuf = "com_google_protobuf", - version = "v27.3", -) -use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub") - -register_toolchains( - "@toolchains_protoc_hub//:all", - dev_dependency = True, -) +bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain") +bazeldnf_toolchain.register(disable = True) bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf") bazeldnf.config( diff --git a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc index b54eb05e..0534a87a 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc +++ b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc @@ -8,10 +8,6 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc # Specific project flags go here if we have some common --enable_bzlmod -common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain - -# prebuilt protoc -common --incompatible_enable_proto_toolchain_resolution # Load any settings & overrides specific to the current user from `.bazelrc.user`. # This file should appear in `.gitignore` so that settings are not shared with team members. This diff --git a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/MODULE.bazel b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/MODULE.bazel index a474b152..feb786db 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/MODULE.bazel +++ b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/MODULE.bazel @@ -9,7 +9,6 @@ local_path_override( ) bazel_dep(name = "rules_pkg", version = "1.1.0") -bazel_dep(name = "toolchains_protoc", version = "0.6.0") bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf") bazeldnf.toolchain(disable = True) diff --git a/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc b/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc index 449a334f..d23479cb 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc +++ b/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc @@ -7,8 +7,6 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc # Specific project flags go here if we have some common --enable_bzlmod -common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain -common --incompatible_enable_proto_toolchain_resolution # Load any settings & overrides specific to the current user from `.bazelrc.user`. # This file should appear in `.gitignore` so that settings are not shared with team members. This diff --git a/e2e/bazel-bzlmod-toolchain-from-source/MODULE.bazel b/e2e/bazel-bzlmod-toolchain-from-source/MODULE.bazel index f2d58a37..79a366f7 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source/MODULE.bazel +++ b/e2e/bazel-bzlmod-toolchain-from-source/MODULE.bazel @@ -9,45 +9,6 @@ local_path_override( ) bazel_dep(name = "rules_pkg", version = "1.1.0") -bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "rules_go") - -go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.24.1") - -bazel_dep(name = "gazelle", version = "0.47.0") -bazel_dep(name = "toolchains_protoc", version = "0.6.0") - -protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc") -protoc.toolchain( - google_protobuf = "com_google_protobuf", - version = "v27.3", -) -use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub") - -register_toolchains( - "@toolchains_protoc_hub//:all", - dev_dependency = True, -) - -go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") -go_deps.from_file(go_mod = "@bazeldnf//:go.mod") -use_repo( - go_deps, - "com_github_adrg_xdg", - "com_github_bazelbuild_buildtools", - "com_github_crillab_gophersat", - "com_github_hashicorp_go_retryablehttp", - "com_github_jdx_go_netrc", - "com_github_klauspost_compress", - "com_github_onsi_gomega", - "com_github_sassoftware_go_rpmutils", - "com_github_sirupsen_logrus", - "com_github_spf13_cobra", - "com_github_ulikunitz_xz", - "io_k8s_sigs_yaml", - "org_golang_x_crypto", - "org_golang_x_exp", -) bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain") bazeldnf_toolchain.register(disable = True) diff --git a/e2e/bazel-bzlmod/MODULE.bazel b/e2e/bazel-bzlmod/MODULE.bazel index 7fa1d898..ab2e8fae 100644 --- a/e2e/bazel-bzlmod/MODULE.bazel +++ b/e2e/bazel-bzlmod/MODULE.bazel @@ -8,6 +8,9 @@ local_path_override( path = "../..", ) +bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain") +bazeldnf_toolchain.register(disable = True) + bazel_dep(name = "rules_pkg", version = "1.1.0") bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf") diff --git a/e2e/bazel-workspace/WORKSPACE b/e2e/bazel-workspace/WORKSPACE index 2a61e67f..cafc994f 100644 --- a/e2e/bazel-workspace/WORKSPACE +++ b/e2e/bazel-workspace/WORKSPACE @@ -22,15 +22,10 @@ load("@bazeldnf//bazeldnf:defs.bzl", "rpm") load( "@bazeldnf//bazeldnf:repositories.bzl", "bazeldnf_dependencies", - "bazeldnf_register_toolchains", ) bazeldnf_dependencies() -bazeldnf_register_toolchains( - name = "bazeldnf_prebuilt", -) - rpm( name = "libvirt-devel-11.0.0-1.fc42.x86_64.rpm", sha256 = "dba37bbe57903afe49b5666f1781eb50001baa81af4584b355db0b6a2afad9fa", diff --git a/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc b/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc index 6b6c94e8..d23479cb 100644 --- a/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc +++ b/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc @@ -7,10 +7,6 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc # Specific project flags go here if we have some common --enable_bzlmod -common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain - -# prebuilt protoc -common --incompatible_enable_proto_toolchain_resolution # Load any settings & overrides specific to the current user from `.bazelrc.user`. # This file should appear in `.gitignore` so that settings are not shared with team members. This diff --git a/e2e/bzlmod-toolchain-circular-dependencies/MODULE.bazel b/e2e/bzlmod-toolchain-circular-dependencies/MODULE.bazel index 66d0a26a..89519b22 100644 --- a/e2e/bzlmod-toolchain-circular-dependencies/MODULE.bazel +++ b/e2e/bzlmod-toolchain-circular-dependencies/MODULE.bazel @@ -9,45 +9,6 @@ local_path_override( ) bazel_dep(name = "rules_pkg", version = "1.1.0") -bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "rules_go") - -go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.24.1") - -bazel_dep(name = "gazelle", version = "0.47.0") -bazel_dep(name = "toolchains_protoc", version = "0.6.0") - -protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc") -protoc.toolchain( - google_protobuf = "com_google_protobuf", - version = "v27.3", -) -use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub") - -register_toolchains( - "@toolchains_protoc_hub//:all", - dev_dependency = True, -) - -go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") -go_deps.from_file(go_mod = "@bazeldnf//:go.mod") -use_repo( - go_deps, - "com_github_adrg_xdg", - "com_github_bazelbuild_buildtools", - "com_github_crillab_gophersat", - "com_github_hashicorp_go_retryablehttp", - "com_github_jdx_go_netrc", - "com_github_klauspost_compress", - "com_github_onsi_gomega", - "com_github_sassoftware_go_rpmutils", - "com_github_sirupsen_logrus", - "com_github_spf13_cobra", - "com_github_ulikunitz_xz", - "io_k8s_sigs_yaml", - "org_golang_x_crypto", - "org_golang_x_exp", -) bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain") bazeldnf_toolchain.register(disable = True) From fcbdb9c687647911a48a57bc5630a3ac44e28044 Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Mon, 9 Feb 2026 22:37:57 +0100 Subject: [PATCH 5/9] feat: improve e2e cacheability Make sure changes to MODULE.bazel.lock and lock files don't invalidate the cache --- BUILD.bazel | 13 +++---------- e2e/BUILD.bazel | 52 ++++++++++++++++++++++++++++++++++++++++--------- e2e/helpers.bzl | 22 +++++++++++++++++++++ 3 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 e2e/helpers.bzl diff --git a/BUILD.bazel b/BUILD.bazel index 0fb71a0e..e619f280 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -101,16 +101,9 @@ bzl_library( # local_path_override(path = "../..") can resolve the full module. filegroup( name = "local_repository_files", - srcs = glob( - [ - "*", - ".*", - ], - exclude = [ - "MODULE.bazel.lock", - "REPO.bazel", - ], - ) + [ + srcs = [ + "MODULE.bazel", + "WORKSPACE", "//.aspect/bazelrc:all_files", "//bazeldnf:all_files", "//bazeldnf/private:all_files", diff --git a/e2e/BUILD.bazel b/e2e/BUILD.bazel index 5b2bc675..2615fedc 100644 --- a/e2e/BUILD.bazel +++ b/e2e/BUILD.bazel @@ -6,6 +6,7 @@ load( "default_test_runner", "integration_test_utils", ) +load("helpers.bzl", "glob_workspace_files") WORKSPACE_BAZEL_VERSIONS = [ "6.5.0", @@ -28,8 +29,12 @@ bazel_integration_tests( timeout = "short", bazel_binaries = bazel_binaries, bazel_versions = WORKSPACE_BAZEL_VERSIONS, + tags = ["manual"], test_runner = ":test-runner", - workspace_files = integration_test_utils.glob_workspace_files("bazel-workspace") + [ + workspace_files = glob_workspace_files( + "bazel-workspace", + extra_excludes = ["*/*.json"], + ) + [ "//:local_repository_files", ], workspace_path = "bazel-workspace", @@ -41,8 +46,12 @@ bazel_integration_tests( timeout = "short", bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = ["manual"], test_runner = ":test-runner", - workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod") + [ + workspace_files = glob_workspace_files( + "bazel-bzlmod", + extra_excludes = ["*/*.json"], + ) + [ "//:local_repository_files", ], workspace_path = "bazel-bzlmod", @@ -54,8 +63,9 @@ bazel_integration_tests( timeout = "short", bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = ["manual"], test_runner = ":test-runner", - workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-lock-file") + [ + workspace_files = glob_workspace_files("bazel-bzlmod-lock-file") + [ "//:local_repository_files", ], workspace_path = "bazel-bzlmod-lock-file", @@ -67,8 +77,12 @@ bazel_integration_tests( timeout = "short", bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = ["manual"], test_runner = ":test-runner", - workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-toolchain-from-source") + [ + workspace_files = glob_workspace_files( + "bazel-bzlmod-toolchain-from-source", + extra_excludes = ["*/*.json"], + ) + [ "//:local_repository_files", ], workspace_path = "bazel-bzlmod-toolchain-from-source", @@ -80,8 +94,12 @@ bazel_integration_tests( timeout = "short", bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = ["manual"], test_runner = ":test-runner", - workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-toolchain-from-source-lock-file") + [ + workspace_files = glob_workspace_files( + "bazel-bzlmod-toolchain-from-source-lock-file", + extra_excludes = ["*/*.json"], + ) + [ "//:local_repository_files", ], workspace_path = "bazel-bzlmod-toolchain-from-source-lock-file", @@ -101,8 +119,9 @@ bazel_integration_tests( timeout = "short", bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = ["manual"], test_runner = ":lock-file-from-args-runner", - workspace_files = integration_test_utils.glob_workspace_files("bazel-bzlmod-lock-file-from-args") + [ + workspace_files = glob_workspace_files("bazel-bzlmod-lock-file-from-args") + [ "//:local_repository_files", ], workspace_path = "bazel-bzlmod-lock-file-from-args", @@ -122,9 +141,15 @@ bazel_integration_tests( timeout = "short", bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, - tags = ALLOWED_TO_FAIL_TAGS, # TODO: drop once the circular dependencies passes + tags = [ + "allowed-to-fail", # TODO: drop once the circular dependencies passes + "manual", + ], test_runner = ":test-runner_circular_deps", - workspace_files = integration_test_utils.glob_workspace_files("bzlmod-toolchain-circular-dependencies") + [ + workspace_files = glob_workspace_files( + "bzlmod-toolchain-circular-dependencies", + extra_excludes = ["*/*.json"], + ) + [ "//:local_repository_files", ], workspace_path = "bzlmod-toolchain-circular-dependencies", @@ -132,6 +157,7 @@ bazel_integration_tests( test_suite( name = "workspace", + tags = ["manual"], tests = integration_test_utils.bazel_integration_test_names( "e2e_workspace", WORKSPACE_BAZEL_VERSIONS, @@ -140,6 +166,7 @@ test_suite( test_suite( name = "bzlmod", + tags = ["manual"], tests = integration_test_utils.bazel_integration_test_names( "e2e_bzlmod", BZLMOD_BAZEL_VERSIONS, @@ -148,6 +175,7 @@ test_suite( test_suite( name = "bzlmod-lock-file", + tags = ["manual"], tests = integration_test_utils.bazel_integration_test_names( "e2e_bzlmod_lock_file", BZLMOD_BAZEL_VERSIONS, @@ -156,6 +184,7 @@ test_suite( test_suite( name = "bzlmod-toolchain-from-source", + tags = ["manual"], tests = integration_test_utils.bazel_integration_test_names( "e2e_bzlmod_toolchain_from_source", BZLMOD_BAZEL_VERSIONS, @@ -164,7 +193,10 @@ test_suite( test_suite( name = "circular-deps", - tags = ALLOWED_TO_FAIL_TAGS, # TODO: drop once the circular dependencies passes + tags = [ + "allowed-to-fail", # TODO: drop once the circular dependencies passes + "manual", + ], tests = integration_test_utils.bazel_integration_test_names( "e2e_circular_deps", BZLMOD_BAZEL_VERSIONS, @@ -173,6 +205,7 @@ test_suite( test_suite( name = "lock-file-from-args", + tags = ["manual"], tests = integration_test_utils.bazel_integration_test_names( "e2e_lock_file_from_args", BZLMOD_BAZEL_VERSIONS, @@ -181,6 +214,7 @@ test_suite( test_suite( name = "e2e", + tags = ["manual"], tests = [ ":workspace", ":bzlmod", diff --git a/e2e/helpers.bzl b/e2e/helpers.bzl new file mode 100644 index 00000000..3bc78439 --- /dev/null +++ b/e2e/helpers.bzl @@ -0,0 +1,22 @@ +"A series of helpers for our e2e infrastructure" + +load("@bazel_skylib//lib:paths.bzl", "paths") + +def glob_workspace_files(workspace_path, extra_excludes = []): + """Recursively globs the Bazel workspace files at the specified path. + + Args: + workspace_path: A `string` representing the path to glob. + extra_excludes: Other glob patterns to ignore + + Returns: + A `list` of the files under the specified path ignoring certain Bazel + artifacts (e.g. `bazel-*`). + """ + return native.glob( + [paths.join(workspace_path, "**", "*")], + exclude = [ + paths.join(workspace_path, "bazel-*", "**"), + paths.join(workspace_path, "MODULE.bazel.lock"), + ] + extra_excludes, + ) From 44fbe1de04e508ffb733f30e8eae9b493df5489b Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Tue, 10 Feb 2026 11:24:27 +0100 Subject: [PATCH 6/9] ci: use new e2e setup Drive tests entirely through bazel even on CI. Given we're using setup-bazel in our CI we need a little of a workaround for a bug --- .bazelignore | 4 + .bazelrc | 4 +- .github/workflows/action.yml | 174 +++--------------- BUILD.bazel | 1 + e2e/.bazelrc | 12 ++ e2e/BUILD.bazel | 127 ++++++++----- e2e/bazel-bzlmod-lock-file-from-args/.bazelrc | 9 +- .../repo.yaml | 6 +- e2e/bazel-bzlmod-lock-file/.bazelrc | 10 +- .../.bazelrc | 10 +- .../.bazelrc | 9 +- e2e/bazel-bzlmod/.bazelrc | 9 +- e2e/bazel-workspace/.bazelrc | 7 +- .../.bazelrc | 9 +- e2e/helpers.bzl | 22 +++ e2e/repo-yaml/.bazelrc | 14 ++ e2e/repo-yaml/BUILD.bazel | 5 + e2e/repo-yaml/MODULE.bazel | 9 + 18 files changed, 207 insertions(+), 234 deletions(-) create mode 100644 e2e/.bazelrc create mode 100644 e2e/repo-yaml/.bazelrc create mode 100644 e2e/repo-yaml/BUILD.bazel create mode 100644 e2e/repo-yaml/MODULE.bazel diff --git a/.bazelignore b/.bazelignore index 13c7fff0..8356632e 100644 --- a/.bazelignore +++ b/.bazelignore @@ -27,3 +27,7 @@ e2e/bzlmod-toolchain-circular-dependencies/bazel-bin e2e/bzlmod-toolchain-circular-dependencies/bazel-out e2e/bzlmod-toolchain-circular-dependencies/bazel-bzlmod-toolchain-circular-dependencies e2e/bzlmod-toolchain-circular-dependencies/bazel-testlogs +e2e/repo-yaml/bazel-bin +e2e/repo-yaml/bazel-out +e2e/repo-yaml/bazel-repo-yaml +e2e/repo-yaml/bazel-testlogs diff --git a/.bazelrc b/.bazelrc index 85aebe6e..b3f1e981 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,7 +6,9 @@ import %workspace%/.aspect/bazelrc/debug.bazelrc import %workspace%/.aspect/bazelrc/performance.bazelrc # Prevent Bazel from treating e2e child workspace BUILD files as packages -common --deleted_packages=e2e/bazel-workspace,e2e/bazel-bzlmod,e2e/bazel-bzlmod-lock-file,e2e/bazel-bzlmod-lock-file-from-args,e2e/bazel-bzlmod-toolchain-from-source,e2e/bazel-bzlmod-toolchain-from-source-lock-file,e2e/bzlmod-toolchain-circular-dependencies +# When adding a new e2e test then `bazel run @rules_bazel_integration_test//tools:update_deleted_packages` +# needs to be executed +common --deleted_packages=e2e/bazel-bzlmod,e2e/bazel-bzlmod-lock-file,e2e/bazel-bzlmod-lock-file-from-args,e2e/bazel-bzlmod-toolchain-from-source,e2e/bazel-bzlmod-toolchain-from-source-lock-file,e2e/bazel-workspace,e2e/bzlmod-toolchain-circular-dependencies,e2e/repo-yaml # Specific project flags go here if we have some diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 427a3911..16828905 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -17,8 +17,8 @@ jobs: build-and-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: bazel-contrib/setup-bazel@0.8.5 + - uses: actions/checkout@v6.0.2 + - uses: bazel-contrib/setup-bazel@0.18.0 with: # Avoid downloading Bazel every time. bazelisk-cache: true @@ -34,155 +34,23 @@ jobs: try-import %workspace%/../../.github/workflows/ci.bazelrc # keep a cache for MODULE.bazel repos external-cache: true - - run: bazelisk build //... && bazelisk test //... - - e2e-workspace-matrix: - strategy: - matrix: - version: - - version: 6.x - bazelrc: | - import %workspace%/../../.aspect/bazelrc/bazel6.bazelrc - - version: 7.x - bazelrc: | - import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc - import %workspace%/../../.aspect/bazelrc/bazel6.bazelrc - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Keep a disk-cache - disk-cache: true - # Share repository cache between workflows. - repository-cache: true - # enable some flags for CI - bazelrc: | - import %workspace%/../../.aspect/bazelrc/ci.bazelrc - import %workspace%/../../.github/workflows/ci.bazelrc - ${{ matrix.version.bazelrc }} - - run: cd e2e/bazel-workspace && USE_BAZEL_VERSION=${{ matrix.version.version }} bazelisk build //... - - e2e-bzlmod-matrix: - strategy: - matrix: - version: [7.x, 8.x] - path: - - bazel-bzlmod - - bazel-bzlmod-lock-file - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Keep a disk-cache - disk-cache: true - # Share repository cache between workflows. - repository-cache: true - # enable some flags for CI - bazelrc: | - import %workspace%/../../.aspect/bazelrc/ci.bazelrc - import %workspace%/../../.github/workflows/ci.bazelrc - - run: cd e2e/${{ matrix.path }} && USE_BAZEL_VERSION=${{ matrix.version }} bazelisk build //... - - e2e-bzlmod-build-toolchain-matrix: - strategy: - matrix: - version: [7.x, 8.x] - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Keep a disk-cache - disk-cache: true - # Share repository cache between workflows. - repository-cache: true - # enable some flags for CI - bazelrc: | - import %workspace%/../../.aspect/bazelrc/ci.bazelrc - import %workspace%/../../.github/workflows/ci.bazelrc - - run: cd e2e/bazel-bzlmod-toolchain-from-source && USE_BAZEL_VERSION=${{ matrix.version }} bazelisk build //... - - e2e-repo-yaml: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Keep a disk-cache - disk-cache: true - # Share repository cache between workflows. - repository-cache: true - # enable some flags for CI - bazelrc: | - import %workspace%/.aspect/bazelrc/ci.bazelrc - import %workspace%/.github/workflows/ci.bazelrc - - run: | - export USE_BAZEL_VERSION=7.x - bazelisk run //cmd -- init --fc 41 --output $(pwd)/repo.yaml - bazelisk run //cmd -- fetch --repofile $(pwd)/repo.yaml - bazelisk run //cmd -- resolve --repofile $(pwd)/repo.yaml bash - - e2e-bzlmod-lock-file-from-args: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Keep a disk-cache - disk-cache: true - # Share repository cache between workflows. - repository-cache: true - # enable some flags for CI - bazelrc: | - import %workspace%/../../.aspect/bazelrc/ci.bazelrc - import %workspace%/../../.github/workflows/ci.bazelrc - - run: | - export USE_BAZEL_VERSION=8.x - cd e2e/bazel-bzlmod-lock-file-from-args && bazelisk run :bazeldnf -- fetch && bazelisk run @bazeldnf_rpms//:update-lock-file && bazelisk build ... - - e2e-bzlmod-toolchain-circular-dependencies: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Keep a disk-cache - disk-cache: true - # Share repository cache between workflows. - repository-cache: true - # enable some flags for CI - bazelrc: | - import %workspace%/../../.aspect/bazelrc/ci.bazelrc - import %workspace%/../../.github/workflows/ci.bazelrc - - id: prepare - run: | - export USE_BAZEL_VERSION=8.x - cd e2e/bzlmod-toolchain-circular-dependencies - bazelisk run @bazeldnf_rpms//:fetch-repo - bazelisk run @bazeldnf_rpms//:update-lock-file - - id: test + - id: build + run: bazelisk build //... + - id: unit-tests + run: bazelisk test //... + - id: prepare-e2e-runner + # workaround for https://github.com/bazel-contrib/setup-bazel/issues/108 + # together with our customized default_test_runner + run: cat ~/.bazelrc | grep -v output_base > ~/.bazelrc.clean + - id: e2e-that-should-pass + run: bazelisk test e2e --notest_keep_going + - id: e2e-that-are-allowed-to-fail run: | - export USE_BAZEL_VERSION=8.x - cd e2e/bzlmod-toolchain-circular-dependencies - bazelisk build //... || status=$? - if [ ${status} -ne 0 ]; then - echo "::warning::Optional job failed." - echo "optional_fail=true" >> "${GITHUB_OUTPUT}" - echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" - fi + ret_code=0 + bazel test //e2e --notest_keep_going --test_tag_filters=allowed-to-fail || ret_code=$? + case $ret_code in + 0) echo "All allowed-to-fail tests passed." ;; + 3) echo "::warning::Some allowed-to-fail e2e tests failed or timed out." ;; + 4) echo "No tests matched the allowed-to-fail filter." ;; + *) exit $ret_code ;; + esac diff --git a/BUILD.bazel b/BUILD.bazel index e619f280..fa6997ef 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -104,6 +104,7 @@ filegroup( srcs = [ "MODULE.bazel", "WORKSPACE", + "//:.github/workflows/ci.bazelrc", "//.aspect/bazelrc:all_files", "//bazeldnf:all_files", "//bazeldnf/private:all_files", diff --git a/e2e/.bazelrc b/e2e/.bazelrc new file mode 100644 index 00000000..f17acd97 --- /dev/null +++ b/e2e/.bazelrc @@ -0,0 +1,12 @@ +# if running in GitHub actions with setup-bazel then we need to ignore output_base +# our workflow creates this clean bazelrc file for us +try-import ~/.bazelrc.clean + +# make sure all our tests use the prebuilt toolchain +common --extra_toolchains=@bazeldnf//tools/e2e/output:toolchain + +# Include most of the suggested flags from aspect +import %workspace%/../../.aspect/bazelrc/convenience.bazelrc +import %workspace%/../../.aspect/bazelrc/correctness.bazelrc +import %workspace%/../../.aspect/bazelrc/debug.bazelrc +import %workspace%/../../.aspect/bazelrc/performance.bazelrc diff --git a/e2e/BUILD.bazel b/e2e/BUILD.bazel index 2615fedc..6effc98f 100644 --- a/e2e/BUILD.bazel +++ b/e2e/BUILD.bazel @@ -1,12 +1,10 @@ load("@bazel_binaries//:defs.bzl", "bazel_binaries") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load( "@rules_bazel_integration_test//bazel_integration_test:defs.bzl", "bazel_integration_tests", - "default_test_runner", "integration_test_utils", ) -load("helpers.bzl", "glob_workspace_files") +load("helpers.bzl", "default_test_runner", "glob_workspace_files") WORKSPACE_BAZEL_VERSIONS = [ "6.5.0", @@ -18,23 +16,31 @@ BZLMOD_BAZEL_VERSIONS = [ "8.1.0", ] +DEFAULT_TIMEOUT = "moderate" + default_test_runner( name = "test-runner", - bazel_cmds = ["build --extra_toolchains=@bazeldnf//tools/e2e/output:toolchain //..."], + bazel_cmds = ["build //..."], ) +DEFAULT_TEST_TAGS = [ + "manual", + "requires-network", +] + # bazel-workspace: legacy WORKSPACE mode (Bazel 6.x, 7.x) bazel_integration_tests( name = "e2e_workspace", - timeout = "short", + timeout = DEFAULT_TIMEOUT, bazel_binaries = bazel_binaries, bazel_versions = WORKSPACE_BAZEL_VERSIONS, - tags = ["manual"], + tags = DEFAULT_TEST_TAGS, test_runner = ":test-runner", workspace_files = glob_workspace_files( "bazel-workspace", extra_excludes = ["*/*.json"], ) + [ + ".bazelrc", "//:local_repository_files", ], workspace_path = "bazel-workspace", @@ -43,15 +49,16 @@ bazel_integration_tests( # bazel-bzlmod: basic bzlmod with prebuilt toolchain bazel_integration_tests( name = "e2e_bzlmod", - timeout = "short", + timeout = DEFAULT_TIMEOUT, bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, - tags = ["manual"], + tags = DEFAULT_TEST_TAGS, test_runner = ":test-runner", workspace_files = glob_workspace_files( "bazel-bzlmod", extra_excludes = ["*/*.json"], ) + [ + ".bazelrc", "//:local_repository_files", ], workspace_path = "bazel-bzlmod", @@ -60,12 +67,13 @@ bazel_integration_tests( # bazel-bzlmod-lock-file: bzlmod with lock files bazel_integration_tests( name = "e2e_bzlmod_lock_file", - timeout = "short", + timeout = DEFAULT_TIMEOUT, bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, - tags = ["manual"], + tags = DEFAULT_TEST_TAGS, test_runner = ":test-runner", workspace_files = glob_workspace_files("bazel-bzlmod-lock-file") + [ + ".bazelrc", "//:local_repository_files", ], workspace_path = "bazel-bzlmod-lock-file", @@ -74,15 +82,16 @@ bazel_integration_tests( # bazel-bzlmod-toolchain-from-source: toolchain built from source bazel_integration_tests( name = "e2e_bzlmod_toolchain_from_source", - timeout = "short", + timeout = DEFAULT_TIMEOUT, bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, - tags = ["manual"], + tags = DEFAULT_TEST_TAGS, test_runner = ":test-runner", workspace_files = glob_workspace_files( "bazel-bzlmod-toolchain-from-source", extra_excludes = ["*/*.json"], ) + [ + ".bazelrc", "//:local_repository_files", ], workspace_path = "bazel-bzlmod-toolchain-from-source", @@ -91,15 +100,16 @@ bazel_integration_tests( # bazel-bzlmod-toolchain-from-source-lock-file: toolchain from source with lock file bazel_integration_tests( name = "e2e_bzlmod_toolchain_from_source_lock_file", - timeout = "short", + timeout = DEFAULT_TIMEOUT, bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, - tags = ["manual"], + tags = DEFAULT_TEST_TAGS, test_runner = ":test-runner", workspace_files = glob_workspace_files( "bazel-bzlmod-toolchain-from-source-lock-file", extra_excludes = ["*/*.json"], ) + [ + ".bazelrc", "//:local_repository_files", ], workspace_path = "bazel-bzlmod-toolchain-from-source-lock-file", @@ -108,56 +118,85 @@ bazel_integration_tests( default_test_runner( name = "lock-file-from-args-runner", bazel_cmds = [ - "run :bazeldnf -- fetch", - "run @bazeldnf_rpms//:update-lock-file", + "run :bazeldnf -- fetch --cache-dir $(pwd)/.bazeldnf", + "run @bazeldnf_rpms//:update-lock-file -- --cache-dir $(pwd)/.bazeldnf", "build //...", ], ) bazel_integration_tests( name = "e2e_lock_file_from_args", - timeout = "short", + timeout = DEFAULT_TIMEOUT, bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, - tags = ["manual"], + tags = DEFAULT_TEST_TAGS, test_runner = ":lock-file-from-args-runner", - workspace_files = glob_workspace_files("bazel-bzlmod-lock-file-from-args") + [ + workspace_files = glob_workspace_files( + "bazel-bzlmod-lock-file-from-args", + extra_excludes = ["*/*.json"], + ) + [ + ".bazelrc", "//:local_repository_files", ], workspace_path = "bazel-bzlmod-lock-file-from-args", ) default_test_runner( - name = "test-runner_circular_deps", + name = "test-runner-circular-deps", bazel_cmds = [ - "run @bazeldnf_rpms//:fetch-repo", - "run @bazeldnf_rpms//:update-lock-file", + "run @bazeldnf_rpms//:fetch-repo -- --cache-dir $(pwd)/.bazeldnf", + "run @bazeldnf_rpms//:update-lock-file -- --cache-dir $(pwd)/.bazeldnf", "build //...", ], ) bazel_integration_tests( name = "e2e_circular_deps", - timeout = "short", + timeout = DEFAULT_TIMEOUT, bazel_binaries = bazel_binaries, bazel_versions = BZLMOD_BAZEL_VERSIONS, - tags = [ + tags = DEFAULT_TEST_TAGS + [ "allowed-to-fail", # TODO: drop once the circular dependencies passes - "manual", ], - test_runner = ":test-runner_circular_deps", + test_runner = ":test-runner-circular-deps", workspace_files = glob_workspace_files( "bzlmod-toolchain-circular-dependencies", extra_excludes = ["*/*.json"], ) + [ + ".bazelrc", "//:local_repository_files", ], workspace_path = "bzlmod-toolchain-circular-dependencies", ) +default_test_runner( + name = "test-runner-repo-yaml", + bazel_cmds = [ + "run :bazeldnf -- init --fc 44 --output $(pwd)/repo.yaml", + "run :bazeldnf -- fetch --repofile $(pwd)/repo.yaml --cache-dir $(pwd)/.bazeldnf", + "run :bazeldnf -- resolve --repofile $(pwd)/repo.yaml --cache-dir $(pwd)/.bazeldnf bash", + ], +) + +bazel_integration_tests( + name = "e2e_repo_yaml", + timeout = DEFAULT_TIMEOUT, + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = DEFAULT_TEST_TAGS, + test_runner = ":test-runner-repo-yaml", + workspace_files = glob_workspace_files("repo-yaml") + [ + ".bazelrc", + "//:local_repository_files", + ], + workspace_path = "repo-yaml", +) + +DEFAULT_TEST_SUITE_TAGS = ["manual"] + test_suite( name = "workspace", - tags = ["manual"], + tags = DEFAULT_TEST_SUITE_TAGS, tests = integration_test_utils.bazel_integration_test_names( "e2e_workspace", WORKSPACE_BAZEL_VERSIONS, @@ -166,7 +205,7 @@ test_suite( test_suite( name = "bzlmod", - tags = ["manual"], + tags = DEFAULT_TEST_SUITE_TAGS, tests = integration_test_utils.bazel_integration_test_names( "e2e_bzlmod", BZLMOD_BAZEL_VERSIONS, @@ -175,7 +214,7 @@ test_suite( test_suite( name = "bzlmod-lock-file", - tags = ["manual"], + tags = DEFAULT_TEST_SUITE_TAGS, tests = integration_test_utils.bazel_integration_test_names( "e2e_bzlmod_lock_file", BZLMOD_BAZEL_VERSIONS, @@ -184,7 +223,7 @@ test_suite( test_suite( name = "bzlmod-toolchain-from-source", - tags = ["manual"], + tags = DEFAULT_TEST_SUITE_TAGS, tests = integration_test_utils.bazel_integration_test_names( "e2e_bzlmod_toolchain_from_source", BZLMOD_BAZEL_VERSIONS, @@ -193,9 +232,8 @@ test_suite( test_suite( name = "circular-deps", - tags = [ + tags = DEFAULT_TEST_SUITE_TAGS + [ "allowed-to-fail", # TODO: drop once the circular dependencies passes - "manual", ], tests = integration_test_utils.bazel_integration_test_names( "e2e_circular_deps", @@ -205,29 +243,34 @@ test_suite( test_suite( name = "lock-file-from-args", - tags = ["manual"], + tags = DEFAULT_TEST_SUITE_TAGS, tests = integration_test_utils.bazel_integration_test_names( "e2e_lock_file_from_args", BZLMOD_BAZEL_VERSIONS, ), ) +test_suite( + name = "repo-yaml", + tags = DEFAULT_TEST_SUITE_TAGS, + tests = integration_test_utils.bazel_integration_test_names( + "e2e_repo_yaml", + BZLMOD_BAZEL_VERSIONS, + ), +) + test_suite( name = "e2e", - tags = ["manual"], + tags = DEFAULT_TEST_SUITE_TAGS, tests = [ - ":workspace", ":bzlmod", ":bzlmod-lock-file", ":bzlmod-toolchain-from-source", - # ":circular-deps", # TODO: uncomment once circular dependencies are fixed + ":circular-deps", ":lock-file-from-args", + ":repo-yaml", + ":workspace", ], ) -bzl_library( - name = "helpers", - srcs = ["helpers.bzl"], - visibility = ["//visibility:public"], - deps = ["@bazel_skylib//lib:paths"], -) +# gazelle:exclude helpers.bzl diff --git a/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc b/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc index d23479cb..613fed26 100644 --- a/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc +++ b/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc @@ -1,9 +1,8 @@ # Import Aspect bazelrc presets -try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc -import %workspace%/../../.aspect/bazelrc/convenience.bazelrc -import %workspace%/../../.aspect/bazelrc/correctness.bazelrc -import %workspace%/../../.aspect/bazelrc/debug.bazelrc -import %workspace%/../../.aspect/bazelrc/performance.bazelrc +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/bazel-bzlmod-lock-file-from-args/repo.yaml b/e2e/bazel-bzlmod-lock-file-from-args/repo.yaml index 5948bff3..b5e68978 100644 --- a/e2e/bazel-bzlmod-lock-file-from-args/repo.yaml +++ b/e2e/bazel-bzlmod-lock-file-from-args/repo.yaml @@ -1,9 +1,9 @@ repositories: - arch: x86_64 - metalink: https://mirrors.fedoraproject.org/metalink?repo=fedora-40&arch=x86_64 - name: 40-x86_64-primary-repo + metalink: https://mirrors.fedoraproject.org/metalink?repo=fedora-44&arch=x86_64 + name: 44-x86_64-primary-repo - arch: x86_64 metalink: https://mirrors.fedoraproject.org/metalink?repo=updates-released-f40&arch=x86_64 name: 40-x86_64-update-repo exclude: - - ^libzstd \ No newline at end of file + - ^libzstd diff --git a/e2e/bazel-bzlmod-lock-file/.bazelrc b/e2e/bazel-bzlmod-lock-file/.bazelrc index 6d22ade3..a1ce9ff6 100644 --- a/e2e/bazel-bzlmod-lock-file/.bazelrc +++ b/e2e/bazel-bzlmod-lock-file/.bazelrc @@ -1,9 +1,11 @@ # Import Aspect bazelrc presets try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc -import %workspace%/../../.aspect/bazelrc/convenience.bazelrc -import %workspace%/../../.aspect/bazelrc/correctness.bazelrc -import %workspace%/../../.aspect/bazelrc/debug.bazelrc -import %workspace%/../../.aspect/bazelrc/performance.bazelrc + +# Import Aspect bazelrc presets +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc common --enable_bzlmod diff --git a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc index 0534a87a..613fed26 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc +++ b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc @@ -1,10 +1,8 @@ # Import Aspect bazelrc presets -try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc -import %workspace%/../../.aspect/bazelrc/bazel6.bazelrc -import %workspace%/../../.aspect/bazelrc/convenience.bazelrc -import %workspace%/../../.aspect/bazelrc/correctness.bazelrc -import %workspace%/../../.aspect/bazelrc/debug.bazelrc -import %workspace%/../../.aspect/bazelrc/performance.bazelrc +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc b/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc index d23479cb..613fed26 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc +++ b/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc @@ -1,9 +1,8 @@ # Import Aspect bazelrc presets -try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc -import %workspace%/../../.aspect/bazelrc/convenience.bazelrc -import %workspace%/../../.aspect/bazelrc/correctness.bazelrc -import %workspace%/../../.aspect/bazelrc/debug.bazelrc -import %workspace%/../../.aspect/bazelrc/performance.bazelrc +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/bazel-bzlmod/.bazelrc b/e2e/bazel-bzlmod/.bazelrc index 6d22ade3..2aa73ef3 100644 --- a/e2e/bazel-bzlmod/.bazelrc +++ b/e2e/bazel-bzlmod/.bazelrc @@ -1,9 +1,8 @@ # Import Aspect bazelrc presets -try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc -import %workspace%/../../.aspect/bazelrc/convenience.bazelrc -import %workspace%/../../.aspect/bazelrc/correctness.bazelrc -import %workspace%/../../.aspect/bazelrc/debug.bazelrc -import %workspace%/../../.aspect/bazelrc/performance.bazelrc +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc common --enable_bzlmod diff --git a/e2e/bazel-workspace/.bazelrc b/e2e/bazel-workspace/.bazelrc index 33dee036..e48894e8 100644 --- a/e2e/bazel-workspace/.bazelrc +++ b/e2e/bazel-workspace/.bazelrc @@ -1,8 +1,5 @@ -# Import Aspect bazelrc presets -import %workspace%/../../.aspect/bazelrc/convenience.bazelrc -import %workspace%/../../.aspect/bazelrc/correctness.bazelrc -import %workspace%/../../.aspect/bazelrc/debug.bazelrc -import %workspace%/../../.aspect/bazelrc/performance.bazelrc +# Include our e2e shared config +import %workspace%/../.bazelrc # Specific project flags go here if we have some diff --git a/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc b/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc index d23479cb..613fed26 100644 --- a/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc +++ b/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc @@ -1,9 +1,8 @@ # Import Aspect bazelrc presets -try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc -import %workspace%/../../.aspect/bazelrc/convenience.bazelrc -import %workspace%/../../.aspect/bazelrc/correctness.bazelrc -import %workspace%/../../.aspect/bazelrc/debug.bazelrc -import %workspace%/../../.aspect/bazelrc/performance.bazelrc +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/helpers.bzl b/e2e/helpers.bzl index 3bc78439..16a38bf5 100644 --- a/e2e/helpers.bzl +++ b/e2e/helpers.bzl @@ -1,10 +1,16 @@ "A series of helpers for our e2e infrastructure" load("@bazel_skylib//lib:paths.bzl", "paths") +load( + "@rules_bazel_integration_test//bazel_integration_test:defs.bzl", + _default_test_runner = "default_test_runner", +) def glob_workspace_files(workspace_path, extra_excludes = []): """Recursively globs the Bazel workspace files at the specified path. + Improved from integration_test_utils.glob_workspace_files + Args: workspace_path: A `string` representing the path to glob. extra_excludes: Other glob patterns to ignore @@ -20,3 +26,19 @@ def glob_workspace_files(workspace_path, extra_excludes = []): paths.join(workspace_path, "MODULE.bazel.lock"), ] + extra_excludes, ) + +def default_test_runner(name, bazel_cmds = [], **kwargs): + """GitHub bazel-contrib/setup-bazel action compatible runner + + Args: + name: name of the target + bazel_cmds: list of commands to execute + **kwargs: other arguments to pass to upstream default_test_runner + """ + + bazel_cmds = [ + "--nohome_rc {}".format(x) + for x in bazel_cmds + ] + + _default_test_runner(name = name, bazel_cmds = bazel_cmds, **kwargs) diff --git a/e2e/repo-yaml/.bazelrc b/e2e/repo-yaml/.bazelrc new file mode 100644 index 00000000..613fed26 --- /dev/null +++ b/e2e/repo-yaml/.bazelrc @@ -0,0 +1,14 @@ +# Import Aspect bazelrc presets +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc + +# Specific project flags go here if we have some +common --enable_bzlmod + +# Load any settings & overrides specific to the current user from `.bazelrc.user`. +# This file should appear in `.gitignore` so that settings are not shared with team members. This +# should be last statement in this config so the user configuration is able to overwrite flags from +# this file. See https://bazel.build/configure/best-practices#bazelrc-file. +try-import %workspace%/../../.bazelrc.user diff --git a/e2e/repo-yaml/BUILD.bazel b/e2e/repo-yaml/BUILD.bazel new file mode 100644 index 00000000..7be258c3 --- /dev/null +++ b/e2e/repo-yaml/BUILD.bazel @@ -0,0 +1,5 @@ +load("@bazeldnf//bazeldnf:defs.bzl", "bazeldnf") + +bazeldnf( + name = "bazeldnf", +) diff --git a/e2e/repo-yaml/MODULE.bazel b/e2e/repo-yaml/MODULE.bazel new file mode 100644 index 00000000..1fc34e95 --- /dev/null +++ b/e2e/repo-yaml/MODULE.bazel @@ -0,0 +1,9 @@ +"example MODULE.bazel to test repo.yaml initialization" + +module(name = "repo-yaml") + +bazel_dep(name = "bazeldnf") +local_path_override( + module_name = "bazeldnf", + path = "../..", +) From 5f3540eb81f28b9141f7f9f38f0a8cd6972df0c0 Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Thu, 12 Feb 2026 15:01:22 +0100 Subject: [PATCH 7/9] ci: improve UX give each job in the build and test workflow a meaningful name --- .github/workflows/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 16828905..d84281bc 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -35,16 +35,21 @@ jobs: # keep a cache for MODULE.bazel repos external-cache: true - id: build + name: building repository run: bazelisk build //... - id: unit-tests + name: running unit tests run: bazelisk test //... - id: prepare-e2e-runner + name: preparing for e2e # workaround for https://github.com/bazel-contrib/setup-bazel/issues/108 # together with our customized default_test_runner run: cat ~/.bazelrc | grep -v output_base > ~/.bazelrc.clean - id: e2e-that-should-pass + name: running mandatory e2e tests run: bazelisk test e2e --notest_keep_going - id: e2e-that-are-allowed-to-fail + name: running e2e tests that are allowed to fail run: | ret_code=0 bazel test //e2e --notest_keep_going --test_tag_filters=allowed-to-fail || ret_code=$? From 1fb4a002532675028c99ff42a4392d70f60dc10c Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Mon, 16 Feb 2026 14:15:31 +0100 Subject: [PATCH 8/9] docs: adding CONTRIBUTING.md With the help of Claude I was able to come with a decent contributing doc, of course it needed some cosmetics and modifications, but the result is decent --- CONTRIBUTING.md | 490 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 490 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..23f5bc6a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,490 @@ +# Contributing to bazeldnf + +Thank you for your interest in contributing to bazeldnf! This guide covers the +development workflow for making changes to Go code, Starlark rules, dependency +management, and end-to-end tests. + +## Prerequisites + +- [Bazelisk](https://github.com/bazelbuild/bazelisk) (symlinked as `bazel`) +- Git + +## Project Layout + +``` +bazeldnf/ +├── cmd/ # CLI binary (cobra commands) +├── pkg/ # Go library packages +│ ├── api/ # Core API types +│ ├── bazel/ # BUILD file manipulation +│ ├── ldd/ # Shared library dependency analysis +│ ├── order/ # Package ordering +│ ├── reducer/ # SAT solver wrapper +│ ├── repo/ # DNF/RPM repo fetching and parsing +│ ├── rpm/ # RPM file handling +│ ├── sat/ # SAT solver integration +│ └── xattr/ # Extended attributes +├── bazeldnf/ # Public Starlark API (.bzl files) +│ └── private/ # Private Starlark helpers +├── internal/ # Starlark rule implementations +├── tools/ # Release tooling, version info, integrity checksums +├── e2e/ # End-to-end integration test workspaces +├── MODULE.bazel # Bazel module definition (bzlmod) +├── go.mod / go.sum # Go module dependencies +└── BUILD.bazel # Root build targets (gazelle, buildifier, etc.) +``` + +## Building and Testing + +```sh +# Build everything +bazel build //... + +# Run all unit tests +bazel test //... + +# Run all end-to-end tests that should pass +bazel test e2e + +# Run end-to-end tests that are allowed to fail +bazel test //e2e/... --test_tag_filters=allowed-to-fail +``` + +## Making Changes to Go Code + +The Go source lives in `cmd/` (CLI binary) and `pkg/` (library packages). + +### Workflow + +1. **Make your code changes** in the relevant `cmd/` or `pkg/` package. + +2. **Format your code**: + ```sh + bazel run @rules_go//go -- fmt ./... + ``` + +3. **Regenerate BUILD files** with Gazelle. Bazel BUILD files for Go packages + are managed by Gazelle, so any new files, packages, or import changes + require updating them: + ```sh + bazel run //:gazelle + ``` + +4. **Run unit tests** to verify your changes: + ```sh + bazel test //... + ``` + +### Adding a New Go Package + +If you add a new package under `pkg/` or `cmd/`: + +1. Create the directory and add your `.go` files. +2. Run Gazelle to auto-generate the `BUILD.bazel` file: + ```sh + bazel run //:gazelle + ``` + Gazelle will create the `go_library`, `go_test`, and/or `go_binary` targets + automatically based on your source files. + +### Unit Tests + +Go tests use [gomega](https://onsi.github.io/gomega/) for assertions. Place +test files (`*_test.go`) alongside the code they test. Gazelle will +automatically include them in the generated `go_test` targets. + +## Adding New Go Dependencies + +Go dependencies are managed with standard Go modules and synced to Bazel via +Gazelle and bzlmod. + +1. **Add the dependency**: + ```sh + bazel run @rules_go//go -- get github.com/example/newdep@latest + ``` + This updates `go.mod` and `go.sum`. + +2. **Sync bzlmod `use_repo` declarations**: + ```sh + bazel mod tidy + ``` + This automatically updates the `use_repo` calls in `MODULE.bazel`. + +3. **Regenerate BUILD files**: + ```sh + bazel run //:gazelle + ``` + +4. **Verify the build**: + ```sh + bazel build //... + bazel test //... + ``` + +## Adding New Bazel Dependencies + +Bazel module dependencies are managed in `MODULE.bazel` using bzlmod. + +1. **Add the `bazel_dep`** to `MODULE.bazel`: + ```python + # Use dev_dependency = True if only needed for development/testing + bazel_dep(name = "rules_foo", version = "1.2.3", dev_dependency = True) + ``` + +2. **Sync `use_repo` declarations**: + ```sh + bazel mod tidy + ``` + +3. **Run Gazelle** if the new dependency provides Starlark libraries that + Gazelle should be aware of: + ```sh + bazel run //:gazelle + ``` + +4. **Verify everything builds**: + ```sh + bazel build //... + ``` + +### Dependency Categories + +In `MODULE.bazel`, dependencies are organized as: + +- **Runtime dependencies** (not `dev_dependency`): required by users of + bazeldnf (e.g., `bazel_skylib`, `platforms`, `bazel_features`, `bazel_lib`). + Be conservative adding non-dev dependencies as they affect all consumers. +- **Toolchain build dependencies**: `gazelle` and `rules_go`, needed when + building the toolchain from source. +- **Dev dependencies** (`dev_dependency = True`): only used within this repo + for building, testing, and linting (e.g., `buildifier_prebuilt`, + `rules_bazel_integration_test`). + +## Making Starlark Changes + +Starlark (`.bzl`) files define the Bazel rules, macros, and extensions that +users interact with. + +### File Organization + +| Directory | Purpose | +|---|---| +| `bazeldnf/defs.bzl` | Public API facade (re-exports all user-facing rules) | +| `bazeldnf/extensions.bzl` | Bzlmod module extensions (`bazeldnf_toolchain`, `bazeldnf`) | +| `bazeldnf/toolchain.bzl` | Toolchain rule definition | +| `bazeldnf/repositories.bzl` | WORKSPACE-mode setup functions | +| `bazeldnf/private/` | Private implementation details (lock file helpers, repo rules) | +| `internal/` | Rule implementations (`rpm.bzl`, `rpmtree.bzl`, `bazeldnf.bzl`, `xattrs.bzl`) | + +### Workflow + +1. **Make your `.bzl` changes**. + +2. **Format with buildifier**: + ```sh + bazel run //:buildifier + ``` + +3. **Run Gazelle** to update any `bzl_library` targets if you added or renamed + `.bzl` files: + ```sh + bazel run //:gazelle + ``` + +4. **Run unit tests and e2e tests** to verify nothing is broken: + ```sh + bazel test //... + bazel test e2e + ``` + +### Tips + +- When modifying user-facing rules in `internal/`, update the re-exports in + `bazeldnf/defs.bzl` if adding new symbols. +- If you change the module extension in `bazeldnf/extensions.bzl`, test with + both the lock-file and non-lock-file e2e workspaces. +- The `internal/runner.bash.template` is used to generate runner scripts for + the `bazeldnf` runnable rule. + +## End-to-End Tests + +E2E tests use +[rules_bazel_integration_test](https://github.com/bazel-contrib/rules_bazel_integration_test) +to spin up isolated Bazel workspaces and verify that bazeldnf works correctly +across different Bazel versions and configurations. + +### Existing E2E Test Suites + +| Suite | Directory | Description | +|---|---|---| +| `e2e:bzlmod` | `e2e/bazel-bzlmod/` | Basic bzlmod with prebuilt toolchain | +| `e2e:bzlmod-lock-file` | `e2e/bazel-bzlmod-lock-file/` | Bzlmod with lock file workflow | +| `e2e:bzlmod-toolchain-from-source` | `e2e/bazel-bzlmod-toolchain-from-source/` | Toolchain built from Go source | +| `e2e:lock-file-from-args` | `e2e/bazel-bzlmod-lock-file-from-args/` | Lock file generated from CLI args | +| `e2e:circular-deps` | `e2e/bzlmod-toolchain-circular-dependencies/` | Circular RPM dependency handling | +| `e2e:repo-yaml` | `e2e/repo-yaml/` | CLI `init`/`fetch`/`resolve` workflow | + +### Running E2E Tests + +```sh +# Run all e2e tests +bazel test e2e + +# Run a specific suite +bazel test e2e:bzlmod +bazel test e2e:bzlmod-lock-file +``` + +### Adding a New E2E Test + +#### 1. Create the Workspace Directory + +Create a new directory under `e2e/` with the files for your test workspace: + +``` +e2e/my-new-test/ +├── MODULE.bazel # Module definition, references parent +├── BUILD.bazel # Build targets that exercise your scenario +└── .bazelrc # Required, see below +``` + +#### 2. Update `.bazelignore` and Deleted Packages + +Since e2e workspaces are nested Bazel projects, you must prevent the parent +workspace from traversing into their Bazel output directories, and update the +`--deleted_packages` flags so the parent doesn't treat child `BUILD` files as +its own packages. + +1. **Add `bazel-*` output symlinks to `.bazelignore`**. Append entries for your + new workspace (follow the pattern of existing entries): + ``` + e2e/my-new-test/bazel-bin + e2e/my-new-test/bazel-out + e2e/my-new-test/bazel-my-new-test + e2e/my-new-test/bazel-testlogs + ``` + +2. **Regenerate `--deleted_packages` flags**: + ```sh + bazel run @rules_bazel_integration_test//tools:update_deleted_packages + ``` + This updates the `.bazelrc` files with the correct `--deleted_packages` + entries so the parent workspace ignores `BUILD` files inside child + workspaces. + +#### 3. Create `.bazelrc` + +Every e2e workspace needs a `.bazelrc` that imports shared configs from the +parent repository: + +``` +# Import Aspect bazelrc presets +import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc + +# Include our e2e shared config +import %workspace%/../.bazelrc + +# Specific project flags go here if needed + +# Load any settings & overrides specific to the current user from `.bazelrc.user`. +# This file should appear in `.gitignore` so that settings are not shared with team members. This +# should be last statement in this config so the user configuration is able to overwrite flags from +# this file. See https://bazel.build/configure/best-practices#bazelrc-file. +try-import %workspace%/../../.bazelrc.user +``` + +#### 4. Set Up MODULE.bazel + +Your test workspace must reference the parent repository using +`local_path_override` so that it uses the local (in-development) version of +bazeldnf: + +```python +module(name = "my-new-test") + +bazel_dep(name = "bazeldnf") +local_path_override( + module_name = "bazeldnf", + path = "../..", +) + +# Use bazeldnf extensions as needed +bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf") +# ... configure RPMs, lock files, etc. +``` + +#### 5. Create BUILD Targets + +In your test workspace's `BUILD.bazel`, use the bazeldnf rules to set up the +scenario you want to test: + +```python +load("@bazeldnf//bazeldnf:defs.bzl", "bazeldnf", "rpmtree", "tar2files") + +bazeldnf(name = "bazeldnf") + +rpmtree( + name = "my_rpms", + rpms = ["@some-rpm//rpm"], +) +``` + +#### 6. Register the Test in `e2e/BUILD.bazel` + +Add the integration test definition to `e2e/BUILD.bazel`. Use the existing +`:test-runner` which runs `bazel --nohome_rc build //...` inside the workspace: + +```python +bazel_integration_tests( + name = "e2e_my_new_test", + timeout = DEFAULT_TIMEOUT, + bazel_binaries = bazel_binaries, + bazel_versions = BZLMOD_BAZEL_VERSIONS, + tags = DEFAULT_TEST_TAGS, + test_runner = ":test-runner", + workspace_files = glob_workspace_files("my-new-test") + [ + ".bazelrc", + "//:local_repository_files", + ], + workspace_path = "my-new-test", +) +``` + +If you're developing a new feature which isn't fully ready yet, but it doesn't +add regressions, then you can add `['allowed-to-fail']` to your tags, this will +allow your new feature to be merged incrementally and making the reviewing +process easier. + +If your test needs to run commands beyond `build //...` (e.g., running +`fetch` or `resolve` before building), define a custom test runner: + +```python +default_test_runner( + name = "my-test-runner", + bazel_cmds = [ + "run :bazeldnf -- fetch --cache-dir $(pwd)/.bazeldnf", + "build //...", + ], +) +``` + +#### 7. Add a Test Suite + +Add a test suite so the test can be run by name: + +```python +test_suite( + name = "my-new-test", + tags = DEFAULT_TEST_SUITE_TAGS, + tests = integration_test_utils.bazel_integration_test_names( + "e2e_my_new_test", + BZLMOD_BAZEL_VERSIONS, + ), +) +``` + +In the case you needed to add `allowed-to-fail` to the test tags also add it here. + +And include it in the top-level `e2e` test suite: + +```python +test_suite( + name = "e2e", + tags = DEFAULT_TEST_SUITE_TAGS, + tests = [ + # ... existing suites ... + ":my-new-test", + ], +) +``` + +#### 8. Expose Parent Files + +If your test workspace depends on parent files not already included in +`//:local_repository_files` (defined in the root `BUILD.bazel`), add them to +that filegroup. Each package that needs to be visible must have: + +```python +filegroup( + name = "all_files", + srcs = glob(["**"]), + visibility = ["//:__pkg__"], +) +``` + +#### 9. Verify Everything + +Run your new test to make sure it passes: + +```sh +bazel test e2e:my-new-test +``` + +In the case your tests are allowed to fail then you do + +```sh +bazel test e2e:my-new-test --test_tag_filters=allowed-to-fail +``` + +### Key Concepts for E2E Tests + +- **`local_path_override`**: each child workspace references the parent repo at + `../..`, so it always tests the local development version of bazeldnf. +- **`//:local_repository_files`**: a filegroup in the root `BUILD.bazel` that + aggregates all parent workspace files needed by e2e workspaces. The + integration test framework copies these into the test sandbox. +- **`glob_workspace_files`**: a helper in `e2e/helpers.bzl` that globs all + files in a workspace directory, excluding Bazel output directories + (`bazel-*`) and `MODULE.bazel.lock` files. +- **`--nohome_rc`**: all test runners automatically prepend this flag to + prevent the host's `~/.bazelrc` from interfering with tests. +- **Bazel versions**: bzlmod tests run against `BZLMOD_BAZEL_VERSIONS` (7.6.0, + 8.1.0). + +## Formatting and Linting + +All formatting checks run in CI. Make sure they pass before submitting: + +```sh +# Check Starlark/BUILD formatting (CI runs this) +bazel run //:buildifier.check + +# Check BUILD files are up-to-date (CI runs this) +bazel run //:gazelle.check + +# Auto-fix Starlark formatting +bazel run //:buildifier + +# Regenerate BUILD files +bazel run //:gazelle + +# Format Go code +bazel run @rules_go//go -- fmt ./... +``` + +## CI + +GitHub Actions runs on every push and PR to `main`: + +1. **Linter** (`linter.yaml`): checks buildifier and gazelle formatting. +2. **Main CI** (`action.yml`): builds everything, runs unit tests, then runs + all e2e test suites. +3. **Allowed-to-fail** (`allowed-to-fail.yml`): runs e2e tests tagged as + `allowed-to-fail` (currently the circular dependency tests) and posts a PR + comment if they fail, without blocking the PR. + +## Quick Reference + +| Task | Command | +|---|---| +| Build everything | `bazel build //...` | +| Run unit tests | `bazel test //...` | +| Run all e2e tests | `bazel test e2e` | +| Run specific e2e suite | `bazel test e2e:` | +| Format Go code | `bazel run @rules_go//go -- fmt ./...` | +| Add Go dependency | `bazel run @rules_go//go -- get github.com/...@latest` | +| Sync module repos | `bazel mod tidy` | +| Format Starlark/BUILD | `bazel run //:buildifier` | +| Regenerate BUILD files | `bazel run //:gazelle` | +| Check Starlark formatting | `bazel run //:buildifier.check` | +| Check BUILD files | `bazel run //:gazelle.check` | From 5e2ca561ce47517be2f272be1bf4532e77e01a4d Mon Sep 17 00:00:00 2001 From: Manuel Naranjo Date: Fri, 6 Mar 2026 12:13:40 +0100 Subject: [PATCH 9/9] e2e: fix tests for bzlmod release Make sure we use prebuilt bazeldnf when testing bzlmod releases --- .gitattributes | 2 ++ e2e/bazel-bzlmod-lock-file-from-args/.bazelrc | 2 +- e2e/bazel-bzlmod-lock-file/.bazelrc | 5 +---- e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc | 2 +- e2e/bazel-bzlmod-toolchain-from-source/.bazelrc | 2 +- e2e/bazel-bzlmod/.bazelrc | 2 +- e2e/bazel-workspace/.bazelrc | 2 +- e2e/bzlmod-toolchain-circular-dependencies/.bazelrc | 2 +- e2e/repo-yaml/.bazelrc | 2 +- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitattributes b/.gitattributes index e3d4e3b4..82aee033 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,8 @@ docs/*.md linguist-generated=true # Exclude a bunch of paths to save some disk space e2e/bazel-bzlmod-* export-ignore e2e/bazel-workspace* export-ignore +e2e/.bazelrc export-ignore .github export-ignore pkg/*/testdata export-ignore tools/release export-ignore +REPO.bazel export-ignore diff --git a/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc b/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc index 613fed26..f9d74810 100644 --- a/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc +++ b/e2e/bazel-bzlmod-lock-file-from-args/.bazelrc @@ -2,7 +2,7 @@ import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/bazel-bzlmod-lock-file/.bazelrc b/e2e/bazel-bzlmod-lock-file/.bazelrc index a1ce9ff6..154119a1 100644 --- a/e2e/bazel-bzlmod-lock-file/.bazelrc +++ b/e2e/bazel-bzlmod-lock-file/.bazelrc @@ -1,11 +1,8 @@ -# Import Aspect bazelrc presets -try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc - # Import Aspect bazelrc presets import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc common --enable_bzlmod diff --git a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc index 613fed26..f9d74810 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc +++ b/e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc @@ -2,7 +2,7 @@ import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc b/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc index 613fed26..f9d74810 100644 --- a/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc +++ b/e2e/bazel-bzlmod-toolchain-from-source/.bazelrc @@ -2,7 +2,7 @@ import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/bazel-bzlmod/.bazelrc b/e2e/bazel-bzlmod/.bazelrc index 2aa73ef3..154119a1 100644 --- a/e2e/bazel-bzlmod/.bazelrc +++ b/e2e/bazel-bzlmod/.bazelrc @@ -2,7 +2,7 @@ import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc common --enable_bzlmod diff --git a/e2e/bazel-workspace/.bazelrc b/e2e/bazel-workspace/.bazelrc index e48894e8..a85f3c8a 100644 --- a/e2e/bazel-workspace/.bazelrc +++ b/e2e/bazel-workspace/.bazelrc @@ -1,5 +1,5 @@ # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc # Specific project flags go here if we have some diff --git a/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc b/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc index 613fed26..f9d74810 100644 --- a/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc +++ b/e2e/bzlmod-toolchain-circular-dependencies/.bazelrc @@ -2,7 +2,7 @@ import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod diff --git a/e2e/repo-yaml/.bazelrc b/e2e/repo-yaml/.bazelrc index 613fed26..f9d74810 100644 --- a/e2e/repo-yaml/.bazelrc +++ b/e2e/repo-yaml/.bazelrc @@ -2,7 +2,7 @@ import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc # Include our e2e shared config -import %workspace%/../.bazelrc +try-import %workspace%/../.bazelrc # Specific project flags go here if we have some common --enable_bzlmod