-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
singlejar is not runnable on Alpine Linux #12961
Comments
Interestingly, I checked out the source code and tried building singlejar directly in that alpine environment and it worked, so I'm not sure what's going on with the one that gets used as part of my build. Maybe it's not actually built locally and just downloaded - and if that is the case, is there a way I can build it separately and tell bazel to use that version?
|
The error is I don't understand how this file got removed. It is distributed with java_tools, it has an executable bit set. With Bazel@HEAD you have an option to disable using prebuilt tools. More information on https://docs.bazel.build/versions/master/bazel-and-java.html |
I expect this is because the while the executable exists, its elf interpreter (glibc's dynamic linker) does not exist on alpine. |
Agreed - and given that singlejar does seem to compile and run fine on alpine, using the NONPREBUILT_TOOLCHAIN_CONFIGURATION on the page that comius pointed to sounds like it might be a good option; I'll be trying that later today and will report back. |
I spent some time trying to get this to compile from source on alpine and kept running into issues; it looks like I'll need to wait until either there's a release of the dist archive that includes these changes to try compiling again, or switch to ubuntu. I will try running this in the future once I can get the newer version compiled again and will update the issue then. |
So I dont want to add a whine but this puts me in a bit of a bind. I am using (have to use because reasons) Centos6. Right now this means that I am kinda forced to upgrade everyone (including devs) to bazel@HEAD (and 4.x is _supposed to be LTS right). Is there a way to disable singlejar like ijar, or revert back a bit for bazel 4? |
@GregBowyer There is a way. In Bazel 4.0.0 you need to define your own Difference with Bazel@HEAD is the configuration for non-prebuilt toolchains is already provided |
I had a chance to look into the 4.0.0 route mentioned by @comius, and I was able to get it working on Alpine. I grabbed the default java_toolchain configuration (from the
My build then completed properly on Alpine with the It looks like this should be quite a bit simpler when it's actually released, but this workaround is working for me. |
Yep! |
Description of the problem / feature request:
singlejar_local is not executable on alpine linux.
Feature requests: what underlying problem are you trying to solve with this feature?
Building a jar with resources.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Given the following four files (note that WORKSPACE is empty):
Running the
test-bin
target gives me the following:If I comment out the resources line in the
test-bin
target, I can succesfuly run the target.What operating system are you running Bazel on?
Alpine 3.9
What's the output of
bazel info release
?If
bazel info release
returns "development version" or "(@Non-Git)", tell us how you built Bazel.I built bazel directly on Alpine from source in a docker container; here's the relevant section:
Have you found anything relevant by searching the web?
The only thing I've found is that singlejar used to be a java version, and got moved to a C++ version. Not sure how long this has been a problem though, so whether anything there is relevant I'm not sure.
Any other information, logs, or outputs that you want to share?
The binary is created, it's just not executable.
The text was updated successfully, but these errors were encountered: