-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
The perl binaries included in the toolchains are not static binaries #54
Comments
I would also be happy to help out with improving the situation but I would need some indication if this is an issue that rules_perl wants to solve. |
@malt3 - I normally review these on the weekend, however, was away from all electronics this last one. This is one of Perl's deficits - wanting to be installed on the whole system. Openssl also surfers from this. Trying to compile these in a hermetical way would bring in most of the Linux kernel. At least that is my first impression - this is why we have Docker. I'm open to any ideas that furthers Perl's first world status in Bazel! How would you proceed? |
I think there are two ways to solve this:
Once we have a fully static binary, using the first approach would be way simpler imo. |
Hi fellow nix user! I wonder if we make it more obvious how perls toolchains is configured and let nix people just give it a nixos attribute instead |
I'm afraid I don't understand what a nixos attribute is and how it would make the perl binaries embedded in the toolchain of rules_perl hermetic. |
So my statement is based on your original quote.
Take this reply with a dismissal if I misunderstand your original statement, I assume here you mean nixOs as in nixOs reproducible builds and deployments If you are (like me) on NixOS you have # Use a fixed version of the nix tree (could also be done more in a default.nix)
nixpkgs_git_repository(
name = "nixpkgs",
revision = "22.05",
sha256 = "0f8c25433a6611fa5664797cd049c80faefec91575718794c701f3b033f2db01",
)
# Grab perl
nixpkgs_package(
name = "perl",
attribute_path = "perl536",
repositories = { "nixpkgs": "@nixpkgs//:default.nix" }
) For what it's worth, we use this in some places at $DAYJOB to bring in complex software we still want to be known fixed versions, but we want to avoid building the entire tool chain from ground zero. Examples of our usage are This wouldn't be a system dep that would be fixed in time and highly hermetic, you would get a nix derivation specific to the build rather than anything you installed in At that point, it might be possible (I have not tested) to use I genuinely understand if you would rather not force nix onto your consumers, but you might consider this for your environment.
I would suggest that a full musl-libc static Perl build is possible, but might be beyond the scope of these rules and the support herein. If there is a known static build / tarball laying about, it might be possible to switch up to that. |
@GregBowyer thanks for this detailed explanation. If at all possible I would like to make the Bazel workflow not depend on nix / Can you maybe elaborate what you mean by this sentence?
This sounds like a possible workaround but I am not sure on what level this will be applied. Do you mean the docker sandbox?
Yes this would be my preferred solution but from searching around, it seems this may not exist yet. I understand that this is beyond the scope. |
Yes the docker sandbox |
I think I'll support my own fork of If you have ideas how a statically linked toolchain could co-exist, please feel free to reach out. |
@andrewkatson i was simply using the example from rules_foreign_cc. I since stopped doing that. |
No problem! Yeah I would use it but its missing some functions that my legacy application uses. So I am going to figure out how to migrate to boringssl or finish my current non |
The perl binaries included in the toolchains are not static binaries. Instead, they link against a number of libraries:
This makes the rules non-hermetic and prevents usage in clean environments like nixOS.
The issue also has been raised with the source of the perl binaries some time ago: skaji/relocatable-perl#13
Some background:
I want to compile openssl hermetically within bazel.
The text was updated successfully, but these errors were encountered: