-
Notifications
You must be signed in to change notification settings - Fork 248
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
make install fails when --prefix needs to be an absolute path #823
Comments
Funnily enough I was trying to come up with something very similar - my use case was to set the install_prefix to be under |
Great, thank you! |
Arrived to this bug because I was going to report something similar, but I think it fits here. What I'm trying to do is build some software with Bazel and later zip up the results and generate an installable "package". But this is bound to be very problematic because these rules confuse the prefix with The reason is that the installation prefix is often used in the built code to refer to paths in an absolute manner. The installation prefix, thus, must remain unmodified and refer to the "target" location, such as Think of it this way: if you are configuring with
Which will then result in a file structure like the following:
The artifacts will have the correct paths built into them, but the file layout will be created in a temporary location inside the execroot that can later be distributed in some fashion. |
@jsharpe Yeah, that's a problem (that not all packages properly respect I think the default in these rules should be to rely on I don't have an /immediate/ need to fix this, but the issue may come to bite us back not too long after, at which point I might attempt a fix and it'd be good to know what the right path forward is :) |
I also just ran into this issue with the same use case as @jmmv, I'm trying to build a package and redistribute it outside of bazel. I can see the difficulty of using |
I am trying to build nginx from sources. With nginx, it is fairly standard to set
--prefix
to an absolute path. For example, the default value is/usr/local/nginx
.http://nginx.org/en/docs/configure.html
If I try to use
install_prefix
to do this, rules_foreign_cc still appends$$BUILD_TMPDIR$$
to my install_prefix. This will make nginx think its config and such are in /some/long/bazel/tmpdir/usr/local/nginx.It seems that the correct tool to use in this case is DESTDIR. I want to be able to set --prefix like any other arg I pass to configure, then use DESTDIR to install it in the tmp dir.
Here is a patch that seems to accomplish what I want:
https://gist.github.com/aptenodytes-forsteri/99f84a715b481db59442cde579c432b1
Here is an example of building nginx from sources:
cc: @alexeagle
The text was updated successfully, but these errors were encountered: