-
Notifications
You must be signed in to change notification settings - Fork 200
pkg_rpm: Specify _topdir for install stanza #763
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
Conversation
If we don't specify the _topdir as part of the install-from path we can't seem to find the correct files to install when using a set of rules like: pkg_filegroup( name = "my_filegroup", srcs = [ "//some/label:foo", ], prefixs = "/usr/bin", ) pkg_rpm( name = "rpm", ... srcs = [ ":my_filegroup", ], ) Adding '%{{_topdir}/BUILD/' as a prefix to the source path seems to solve this problem.
01c66c9
to
45b0ff2
Compare
Can you add a test for this and explain more clearly what is failing? |
I'll try to rig up a test for this tomorrow and also provide more details. The tl;dr was that it couldn't find the expected inputs in the relative path, but putting the prefix in place means it becomes an absolute path and can be resolved. |
Still working through adding a test for this, but figured I'd provide a bit more detail as to what the failure (and my rules) look like. I'm using https://github.com/bazelbuild/examples/tree/main/cpp-tutorial/stage1 as a simple scaffold for verifying the failure. My rules are as follows:
Root BUILD:
in WORKSPACE I'm configuring things with:
Where @rules_pkg is just pointing at a fresh clone of rules_pkg in my local worktree. When I run
|
|
That would be my expectation and with this PR it actually correctly points to it because the path ceases to be relative. When you take the example repo and apply my BUILD + WORKSPACE setup what do you get? Also, missed part of my WORKSPACE the correct variant also includes:
|
Take a look at #770 I tried to prove your change works, but it failed in new and unexpected ways. |
After a bit of thrashing around with the Fedora docker image it seems like I got this working and it's using rpmbuild 4.18.1 - I'll see if I can upgrade rpmbuild in my build environment to determine if this also happens there. Secondary to this, should there be a minimum version check for the version of rpmbuild being used? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks reasonable. However, I noticed that @aiuto requested a test for this. Were you able to create one? Also, could you ping me again when CI is green?
If we don't specify the _topdir as part of the install-from path we can't seem to find the correct files to install when using a set of rules like:
Adding
%{{_topdir}/BUILD/
as a prefix to the source path seems to solve this problem.