-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpmbuild is not supported in bazel images #5429
Comments
/area planter |
@BenTheElder ah ok great, thanks so much for trying and filing this. I wasn't sure if I was doing something wrong, or not running some pre-install stuff. That looks similar to the error I'm getting. If I clone
...and when I run the test in
|
For the second error test-infra currently needs `bazel test -- //...
-//vendor/...` (there is an open issue to get back to `bazel test //...`).
`//` is not a valid target pattern.
Generally you build/test with //... but both k/k and test-infra have bad go
test code in vendor/ so they exclude vendor with: `//... -//vendor/...`
which must come after `--` to disambiguate the flags from the negative
target.
https://docs.bazel.build/versions/master/user-manual.html#target-patterns
The failures with kubernetes make bazel-build are definitely a regression
though, which I am looking into today.
On Nov 9, 2017 10:54, "Leif Madsen" <notifications@github.com> wrote:
@BenTheElder <https://github.com/bentheelder> ah ok great, thanks so much
for trying and filing this. I wasn't sure if I was doing something wrong,
or not running some pre-install stuff. That looks similar to the error I'm
getting. If I clone kubernetes and test-infra, and do the make bazel-build
I get this:
…____[6,748 / 6,952] Creating source manifest for //cmd/kubemark:kubemark
ERROR: /home/lmadsen/src/go/src/k8s.io/kubernetes/build/rpms/BUILD:40:1:
MakeRpm build/rpms/kubernetes-cni-x86_64.rpm failed (Exit 1): make_rpm
failed: error executing command
(cd /home/lmadsen/.cache/bazel/_bazel_lmadsen/ec8246b7f01bf839e9b64a0dc5cd798b/execroot/__main__
&& \
exec env - \
bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/make_rpm
'--name=kubernetes-cni'
'--version=@bazel-out/local-fastbuild/genfiles/build/cni_version'
'--arch=x86_64' '--spec_file=build/rpms/kubernetes-cni.spec'
'--out_file=bazel-out/local-fastbuild/bin/build/rpms/kubernetes-cni-x86_64.rpm'
CHANGELOG.md external/kubernetes_cni/file/cni-plugins-amd64-v0.6.0.tgz)
Use --sandbox_debug to see verbose messages from the sandbox.
Building RPM for kubernetes-cni at
bazel-out/local-fastbuild/bin/build/rpms/kubernetes-cni-x86_64.rpm
Traceback (most recent call last):
File "/home/lmadsen/.cache/bazel/_bazel_lmadsen/ec8246b7f01bf839e9b64a0dc5cd798b/bazel-sandbox/8130683712985612099/execroot/__main__/bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/make_rpm.runfiles/__main__/../bazel_tools/tools/build_defs/pkg/make_rpm.py",
line 228, in <module>
main(FLAGS(sys.argv))
File "/home/lmadsen/.cache/bazel/_bazel_lmadsen/ec8246b7f01bf839e9b64a0dc5cd798b/bazel-sandbox/8130683712985612099/execroot/__main__/bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/make_rpm.runfiles/__main__/../bazel_tools/tools/build_defs/pkg/make_rpm.py",
line 223, in main
return builder.Build(FLAGS.spec_file, FLAGS.out_file)
File "/home/lmadsen/.cache/bazel/_bazel_lmadsen/ec8246b7f01bf839e9b64a0dc5cd798b/bazel-sandbox/8130683712985612099/execroot/__main__/bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/make_rpm.runfiles/__main__/../bazel_tools/tools/build_defs/pkg/make_rpm.py",
line 214, in Build
status = self.CallRpmBuild(dirname)
File "/home/lmadsen/.cache/bazel/_bazel_lmadsen/ec8246b7f01bf839e9b64a0dc5cd798b/bazel-sandbox/8130683712985612099/execroot/__main__/bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/make_rpm.runfiles/__main__/../bazel_tools/tools/build_defs/pkg/make_rpm.py",
line 182, in CallRpmBuild
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
____Elapsed time: 125.915s, Critical Path: 5.13s
Makefile:544: recipe for target 'bazel-build' failed
make: *** [bazel-build] Error 1
...and when I run the test in test-infra...
lmadsen rover ~ … test-infra master $
./planter/planter.sh bazel test //
Unable to find image 'gcr.io/k8s-testimages/planter:0.7.0-1' locally
Trying to pull repository gcr.io/k8s-testimages/planter ...
sha256:1f4b619036072a7342df0ec9eb5fea3d9e3a564fe7e86c3f87266b33567c3a84:
Pulling from gcr.io/k8s-testimages/planter
c20dc0c5afeb <http://gcr.io/k8s-testimages/planterc20dc0c5afeb>: Pull complete
7d45c8fbd867: Pull complete
b35ea3e7d4eb: Pull complete
4ab96b2ab340: Pull complete
101f36dc9c48: Pull complete
b90ae78a37c0: Pull complete
Digest: sha256:1f4b619036072a7342df0ec9eb5fea3d9e3a564fe7e86c3f87266b33567c3a84
Status: Downloaded newer image for gcr.io/k8s-testimages/planter:0.7.0-1
.
ERROR: the empty string is not a valid target.
____Elapsed time: 0.195s
ERROR: Couldn't start the build. Unable to run tests.
lmadsen rover ~ … test-infra master ERROR $ pwd
/home/lmadsen/src/go/src/k8s.io/test-infra
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA4Bq-snBf63xA3hWAaWNLCNUrt6IE_Kks5s00pPgaJpZM4QYaU2>
.
|
It seems the def CallRpmBuild(self, dirname):
"""Call rpmbuild with the correct arguments."""
args = [
'rpmbuild',
'--define',
'_topdir %s' % dirname,
'--define',
'_tmppath %s/TMP' % dirname,
'--bb',
self.spec_file,
]
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
|
Next steps imho are:
|
@leifmadsen in the meantime: |
@BenTheElder instead of calling |
Possibly? We're not actually calling it directly per se (one of the stock rules "pkg_rpm" is doing this internally), and bazel does actually sandbox the call quite a bit. Unfortunately though unlike say, the go compiler toolchain, it is depending on For now I think we're going to tweak CI and planter to support rpmbuild but I'd really prefer we didn't have default targets that depend on external tooling as much as possible |
#5456 has a fix for planter, changes to CI will follow after doing a little bit more local testing. |
RPM tooling is in the planter image, I'll get these building in CI soonish |
It appears
make bazel-build
works fine on my linux workstation against k/k master, but inside planter it does not now. It looks like something changed with packaging for the images.The text was updated successfully, but these errors were encountered: