summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kelly <mkelly@arista.com>2023-12-19 11:17:08 -0800
committerGitHub <noreply@github.com>2023-12-19 14:17:08 -0500
commita0d0debf671682c27898de152bb691f0360e5517 (patch)
tree9f592b5fd13c2785a88ac94b98f7e96c1fd4d3a6
parent3d32d9f694647955623dbf75173bb2b0e4afeea7 (diff)
downloadbazelbuild-rules_pkg-a0d0debf671682c27898de152bb691f0360e5517.tar.gz
Explicitly set `%{_builddir}` macro (#792)
rules_pkg has baked in the assumption that the value of `%{_builddir}` is going to be `%{_topdir}/BUILD` which is where rpmbuild will `cd` to when being run. When using the built in system rpmbuild in a situation where the value of `%{_builddir}` has been overriden with a custom local macro, this assumption may be broken which will result in internal rpmbuild failures. Because we make this assumption about the value of the macro, we can instead be explicit about what we want the value of `%{_builddir}` to be so as to avoid this problem altogether.
-rw-r--r--pkg/make_rpm.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/make_rpm.py b/pkg/make_rpm.py
index d4bbd96..4ccd750 100644
--- a/pkg/make_rpm.py
+++ b/pkg/make_rpm.py
@@ -357,6 +357,7 @@ class RpmBuilder(object):
args += [
'--define', '_topdir %s' % dirname,
'--define', '_tmppath %s/TMP' % dirname,
+ '--define', '_builddir %s/BUILD' % dirname,
'--bb',
'--buildroot=%s' % buildroot,
] # yapf: disable