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

Add support for the x86_64-unknown-linux-musl platform #18

Closed
davidbtadokoro opened this issue Aug 5, 2024 · 0 comments
Closed

Add support for the x86_64-unknown-linux-musl platform #18

davidbtadokoro opened this issue Aug 5, 2024 · 0 comments
Labels
bug Something isn't working properly CI Related to Continuous-Integration pipelines waiting-stable Waiting merging into the master branch

Comments

@davidbtadokoro
Copy link
Collaborator

davidbtadokoro commented Aug 5, 2024

Description:

Rust offers two generic Linux targets: x86_64-unknown-linux-gnu and x86_64-unknown-linux-musl. In a nutshell, -x86_64-unknown-linux-gnu is more compatible with various Linux distributions due to its reliance on the widely used glibc. At the same time, x86_64-unknown-linux-musl produces more portable and self-contained binaries because it includes all necessary libraries within the binary itself.

How to reproduce:

I started trying to support -musl also, as it seemed really plug-n-play along with cargo dist, but encountered failing jobs [1], which seemed to be generated by a cross-compilation problem [2].

[1]: log of the failed job to build for the x86_64-unknown-linux-musl platform.
[2]: Thread reporting similar error shown in log.

Expected behavior:

If possible, we should make it as portable as possible for all Linux systems.

@davidbtadokoro davidbtadokoro added bug Something isn't working properly CI Related to Continuous-Integration pipelines labels Aug 5, 2024
davidbtadokoro added a commit that referenced this issue Aug 7, 2024
To handle HTTP requests, `patch-hub` uses the `reqwest` crate, which
depends on the `openssl` crate. There are two issues related to this
dependency:

  1. When running a pre-compiled release of `patch-hub`, the `openssl`
     lib fails to dynamically link, which resulting in the app crashing
     at start up (issue #19).
  2. When trying to build the `x86_64-unknown-linux-musl` trough the CI
     pipeline defined in `release.yml`, we encounter errors similar to
     the previous point (part of issue #18).

To fix both of these problems, vendor the `openssl` dependency by
explicitly declaring it as a dependency and enabling the `vendored`
feature. This is actually a fairly common practice in the Rust community
when dealing with this dependency (so much it has a plug-n-play flag for
it).

The obvious drawback, is that we are absorving this crate into our
codebase, which results in longer compile times (in my setup,
approximately doubled the time), and bloats our executables.

Closes: #19

Signed-off-by: David Tadokoro <davidbtadokoro@usp.br>
@davidbtadokoro davidbtadokoro added the waiting-stable Waiting merging into the master branch label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly CI Related to Continuous-Integration pipelines waiting-stable Waiting merging into the master branch
Projects
None yet
Development

No branches or pull requests

1 participant