-
Notifications
You must be signed in to change notification settings - Fork 217
pkg_rpm build fails if the source paths contain whitespaces #732
Copy link
Copy link
Closed
Description
While experimenting with pkg_rpm I noticed the rpmbuild will fail to create the package if the source paths (files, symbolic links, directories) contain whitespaces in their paths. Consider the following example:
$ tree test
test
├── BUILD.bazel
├── foo bar
└── foobarload("@rules_pkg//pkg:mappings.bzl", "pkg_files", "pkg_mkdirs", "pkg_mklink")
load("@rules_pkg//pkg:rpm.bzl", "pkg_rpm")
pkg_files(
name = "files",
srcs = [
"foo bar",
"foobar",
],
)
pkg_mklink(
name = "symlinks",
link_name = "sym link",
target = "/foobar",
)
pkg_mkdirs(
name = "directories",
dirs = ["dire ctory"],
)
pkg_rpm(
name = "test",
package_name = "test",
srcs = [
# Comment out sources and observe failing behavior
":directories",
":files",
":symlinks",
],
description = "description",
license = "license",
release = "0",
summary = "summary",
version = "0.0.0",
)
The above will fail with the following error message (stops at first error):
Error calling rpmbuild:
Executing(%install): /bin/sh -e /tmp/tmpqxx5wk6d/TMP/rpm-tmp.B9Hhpr
+ umask 022
+ cd /tmp/tmpqxx5wk6d/BUILD
+ /bin/rm -rf /tmp/tmpqxx5wk6d/BUILDROOT
+ /bin/mkdir -p /tmp/tmpqxx5wk6d
+ /bin/mkdir /tmp/tmpqxx5wk6d/BUILDROOT
+ install -d /tmp/tmpqxx5wk6d/BUILDROOT//dire ctory
+ dirname /foo bar
+ install -d /tmp/tmpqxx5wk6d/BUILDROOT// .
+ cp dev/foo bar /tmp/tmpqxx5wk6d/BUILDROOT//foo bar
cp: target 'bar' is not a directory
error: Bad exit status from /tmp/tmpqxx5wk6d/TMP/rpm-tmp.B9Hhpr (%install)
RPM build errors:
Bad exit status from /tmp/tmpqxx5wk6d/TMP/rpm-tmp.B9Hhpr (%install)
No RPM file created.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels