Skip to content

Commit 85c7310

Browse files
committed
Add missing --target parameter
1 parent 761def4 commit 85c7310

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ldnp/rpm.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def generate_spec_file(self):
137137
with open(self.context.work_dir / "package.spec", "w") as f:
138138
f.write(rendered)
139139

140-
def generate_rpm(self, out_path: str):
140+
def generate_rpm(self, out_path: str, build_arch: str):
141141
run_command(
142142
[
143143
"rpmbuild",
@@ -158,6 +158,10 @@ def generate_rpm(self, out_path: str):
158158
"--define",
159159
"_build_id_links none",
160160
"-bb",
161+
# specify target explicitly to work around some bug in newer rpmbuild versions
162+
# "error: No compatible architectures found for build"
163+
"--target",
164+
build_arch,
161165
"package.spec",
162166
],
163167
cwd=self.context.work_dir,
@@ -193,7 +197,7 @@ def create_package(self, out_path: str | os.PathLike):
193197
self.copy_data_to_usr()
194198
self.write_ldnp_conf()
195199
self.generate_spec_file()
196-
self.generate_rpm(out_path)
200+
self.generate_rpm(out_path, build_arch)
197201

198202
return out_path
199203

0 commit comments

Comments
 (0)