Skip to content
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

fix: Use statically linked coursier binary #20922

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frekw
Copy link

@frekw frekw commented May 14, 2024

This should improve reproducability across different flavours of Linux, especially some more esoteric flavours like Nix, where not all shared libraries reside in /usr/lib.

I'm currently overriding this in known_versions locally but thought the change might be useful to others as well.

The reason why only 2.1.6 is affected is because static builds of coursier doesn't exist for the earlier versions.

This should improve reproducability across different flavours of Linux,
especially some more esoteric flavours like Nix, where not all shared
libraries reside in `/usr/lib`.

I'm currently overriding this in `known_versions` locally but thought
the change might be useful to others as well.

The reason why only 2.1.6 is affected is because static builds of
coursier doesn't exist for the earlier versions.
@huonw
Copy link
Contributor

huonw commented May 15, 2024

Thanks for taking the time to submit a patch.

I note that there's no discussion of any potential downsides in https://get-coursier.io/docs/cli-installation#static-launchers , which surprises me a bit (if there were no downside, why not just use the static one always? 🤔 ).

My vague understanding is that musl has different DNS behaviour and potentially a different performance profile to glibc, both of which could be relevant to Coursier.

Do you know anything about differences and how they might affect Coursier specifically?

From Pants' perspective, it'd be especially good not to break existing users. If a Pants user has "dynamic" coursier working and (automatically) switching to the static builds breaks them, not great!

@huonw huonw added category:new feature category:bugfix Bug fixes for released features and removed category:new feature labels May 15, 2024
@frekw
Copy link
Author

frekw commented May 15, 2024

why not just use the static one always

That was more or less what I was thinking as well 😅 .

My vague understanding is that musl has different DNS behaviour

It's not completely clear to me if they statically link against musl or glibc. musl has had some quite annoying DNS behaviour (only supporting UDP) but IIRC that was fixed a while back: https://www.theregister.com/2023/05/16/alpine_linux_318/.

Regarding performance I think the differences are small enough to be negligible (e.g https://bell-sw.com/blog/alpaquita-linux-performance-the-race-is-on/), especially since coursier will spend most of its time doing networked IO to get all artifacts.

From Pants' perspective, it'd be especially good not to break existing users. If a Pants user has "dynamic" coursier working and (automatically) switching to the static builds breaks them, not great!

I think that's a very fair point. An alternative approach could be to use the statically linked builds, but only doing it for newer versions of coursier (and adding new versions in this PR instead). WDYT?

@huonw
Copy link
Contributor

huonw commented May 15, 2024

I think that's a very fair point. An alternative approach could be to use the statically linked builds, but only doing it for newer versions of coursier (and adding new versions in this PR instead). WDYT?

Yeah, that definitely seems safer, the downsides are more controlled and easier to mitigate 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants