bazelbuild / rules_pkg

Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...)
Apache License 2.0
217 stars 174 forks source link

pkg_rpm cannot build packages targeting anything except the "exec" platform #661

Open nacl opened 1 year ago

nacl commented 1 year ago

In experiments with rpmbuild, we have found that it generally assumes that it is building for the host system (in this case, the "exec" platform) or "noarch". This readily breaks down in the face of cross-compilation, which is supported and commonly used in Bazel.

Determine if there's some RPM macro that can be changed to support this. _target_os? It seems like there would need to be a way to map platform CPU names to what RPM expects them to be.

The setarch command, unfortunately, may not be adequate here, as it doesn't seem to be able to cross non-compatible architectures (e.g. intel <-> arm)

nacl commented 1 year ago

Given that #727 has a repro case, resolving this as a dupe.