Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Install musl-tools #102

Open
2 of 3 tasks
npmccallum opened this issue Aug 25, 2020 · 3 comments
Open
2 of 3 tasks

Install musl-tools #102

npmccallum opened this issue Aug 25, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@npmccallum
Copy link

npmccallum commented Aug 25, 2020

Do the checklist before filing an issue:

(I don't speak TypeScript...)

Motivation

When setting up the toolchain for any target that ends in -linux-musl, please apt install musl-tools as part of the toolchain setup. Rust dependencies that use cc to compile C code will expect musl-gcc to be installed.

Workflow example

No changes needed.

Additional context

musl-gcc is a thin wrapper around GCC that sets things up for compilation on musl. Many Rust packages require it to be installed when building for any musl target.

@npmccallum npmccallum added the enhancement New feature or request label Aug 25, 2020
facebook-github-bot pushed a commit to facebook/relay that referenced this issue Jan 19, 2022
Summary:
This PR attempts to fix #3725 and #3739.

A new target `x86_64-unknown-linux-musl` has been added to `ci.yml` along with the additional `musl-tools` package (can be removed in the future when [this issue](actions-rs/toolchain#102) is resolved) and the `hyper-tls/vendored` feature which allow to build openssl-sys package for the new target.

I ended up with building directly on GitHub Action VM without custom docker image because it allows to implement it just as a new target in matrix. Building in docker image requires a [separated job](https://github.com/ch1ffa/relay/blob/1c4651ff81cb901a487e4d9ca0a719058833f5a0/.github/workflows/ci.yml#L133).

[detect-libc](https://www.npmjs.com/package/detect-libc) is using for detecting correct platform.

Compiled binary has been tested inside `node:alpine` image. I'm not sure how to test it in the Bazel Sandbox, maybe it is better to ask the issue author.

Pull Request resolved: #3754

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

**Static Docs Preview: relay**
|[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/1642521860/relay/)|

|**Modified Pages**|

Reviewed By: kassens

Differential Revision: D33622425

Pulled By: alunyov

fbshipit-source-id: 8c16074f2d15fd400ad657cd2497fde85b54ef6d
likebreath added a commit to likebreath/cloud-hypervisor that referenced this issue Feb 11, 2022
With enabling the `vendered-openssl` feature, we can now cross-build the
`test_infra` crate for  "musl" and "aarch64" targets. In this way, we
can remove the `test_infra` crate from the "exclude" list, so that this
crate can be checked and processed by "cargo clippy" and "cargo fmt".

More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

As 'musl-gcc' is required, this commit also installs the `musl-tools`
package for our "build" github action on the musl target [1].

[1] actions-rs/toolchain#102

Signed-off-by: Bo Chen <[email protected]>
likebreath added a commit to likebreath/cloud-hypervisor that referenced this issue Feb 14, 2022
With enabling the `vendered-openssl` feature, we can now cross-build the
`test_infra` crate for  "musl" and "aarch64" targets. In this way, we
can remove the `test_infra` crate from the "exclude" list, so that this
crate can be checked and processed by "cargo clippy" and "cargo fmt".

More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

As 'musl-gcc' is required, this commit also installs the `musl-tools`
package for our "build" github action on the musl target [1].

[1] actions-rs/toolchain#102

Signed-off-by: Bo Chen <[email protected]>
likebreath added a commit to likebreath/cloud-hypervisor that referenced this issue Feb 16, 2022
With enabling the `vendered-openssl` feature, we can now cross-build the
`test_infra` crate for  "musl" and "aarch64" targets. In this way, we
can remove the `test_infra` crate from the "exclude" list, so that this
crate can be checked and processed by "cargo clippy" and "cargo fmt".

More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

As 'musl-gcc' is required, this commit also installs the `musl-tools`
package for our "build" github action on the musl target [1].

[1] actions-rs/toolchain#102

Signed-off-by: Bo Chen <[email protected]>
likebreath added a commit to likebreath/cloud-hypervisor that referenced this issue Feb 17, 2022
With enabling the `vendered-openssl` feature, we can now cross-build the
`test_infra` crate for  "musl" and "aarch64" targets. In this way, we
can remove the `test_infra` crate from the "exclude" list, so that this
crate can be checked and processed by "cargo clippy" and "cargo fmt".

More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

As 'musl-gcc' is required, this commit also installs the `musl-tools`
package for our "build" github action on the musl target [1].

[1] actions-rs/toolchain#102

Signed-off-by: Bo Chen <[email protected]>
rbradford pushed a commit to cloud-hypervisor/cloud-hypervisor that referenced this issue Feb 17, 2022
With enabling the `vendered-openssl` feature, we can now cross-build the
`test_infra` crate for  "musl" and "aarch64" targets. In this way, we
can remove the `test_infra` crate from the "exclude" list, so that this
crate can be checked and processed by "cargo clippy" and "cargo fmt".

More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

As 'musl-gcc' is required, this commit also installs the `musl-tools`
package for our "build" github action on the musl target [1].

[1] actions-rs/toolchain#102

Signed-off-by: Bo Chen <[email protected]>
rbradford added a commit to rbradford/cloud-hypervisor that referenced this issue Mar 3, 2022
Needed since:

commit 0ab4097
Author: Bo Chen <[email protected]>
Date:   Thu Feb 10 18:29:53 2022 -0800

    test_infra: Enable cross-build for "musl" and "aarch64" targets

    With enabling the `vendered-openssl` feature, we can now cross-build the
    `test_infra` crate for  "musl" and "aarch64" targets. In this way, we
    can remove the `test_infra` crate from the "exclude" list, so that this
    crate can be checked and processed by "cargo clippy" and "cargo fmt".

    More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

    As 'musl-gcc' is required, this commit also installs the `musl-tools`
    package for our "build" github action on the musl target [1].

    [1] actions-rs/toolchain#102

    Signed-off-by: Bo Chen <[email protected]>

Signed-off-by: Rob Bradford <[email protected]>
rbradford added a commit to cloud-hypervisor/cloud-hypervisor that referenced this issue Mar 3, 2022
Needed since:

commit 0ab4097
Author: Bo Chen <[email protected]>
Date:   Thu Feb 10 18:29:53 2022 -0800

    test_infra: Enable cross-build for "musl" and "aarch64" targets

    With enabling the `vendered-openssl` feature, we can now cross-build the
    `test_infra` crate for  "musl" and "aarch64" targets. In this way, we
    can remove the `test_infra` crate from the "exclude" list, so that this
    crate can be checked and processed by "cargo clippy" and "cargo fmt".

    More details can be found: https://docs.rs/openssl/latest/openssl/#vendored

    As 'musl-gcc' is required, this commit also installs the `musl-tools`
    package for our "build" github action on the musl target [1].

    [1] actions-rs/toolchain#102

    Signed-off-by: Bo Chen <[email protected]>

Signed-off-by: Rob Bradford <[email protected]>
@hoijui
Copy link

hoijui commented Mar 25, 2022

Any comments on this?
Is this wanted, and just waiting for someone to implement it?

@vojtechkral
Copy link

vojtechkral commented May 20, 2022

Yes, I would think so.
For building against musl libs statically it seems musl-tools are required.
Right now I install them using this:

- uses: awalsh128/cache-apt-pkgs-action@v1
  with:
    packages: musl-tools # provides musl-gcc
    version: 1.0

so, not and insurmountable problem, but still would be nice to have them out of the box with actions-rs IMO.

@AraHaan
Copy link

AraHaan commented Jul 19, 2022

Wait, so those musl tools would also allow cmake to cross compile for it with CMakePresets.json as well right?

I found this issue when I need to be able to compile some C code in github actions for these presets:

  • linux-x86 (probably end of life so I am ok if I must remove linux-x86 from my presets)
    • musl and rhel versions of this (probably also end of life and probably safe to remove from my presets)
  • linux-x64
    • musl and rhel versions of this
  • linux-arm
    • musl and rhel versions of this
  • linux-arm64
    • musl and rhel versions of this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Development

No branches or pull requests

4 participants