Skip to content

Commit

Permalink
Add build for linux-musl target (#3754)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ch1ffa authored and facebook-github-bot committed Jan 19, 2022
1 parent c844a5b commit f1435c3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ jobs:
strategy:
matrix:
target:
- target: x86_64-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
build-name: relay
artifact-name: relay-compiler-linux-x64
packages: musl-tools
features: vendored
- target: x86_64-apple-darwin
os: macos-latest
build-name: relay
Expand Down Expand Up @@ -120,11 +122,14 @@ jobs:
run: yarn gulp setCompilerMainVersion
env:
RELEASE_COMMIT_SHA: ${{ github.sha }}
- name: Install packages
if: matrix.target.os == 'ubuntu-latest' && matrix.target.packages
run: sudo apt install ${{ matrix.target.packages }} -y
- uses: actions-rs/cargo@v1
with:
command: build
# add --locked back when we have a better way to ensure it's up to date
args: --manifest-path=compiler/Cargo.toml --release --target ${{ matrix.target.target }}
args: --manifest-path=compiler/Cargo.toml --release --target ${{ matrix.target.target }} ${{ matrix.target.features && '--features' }} ${{ matrix.target.features }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target.artifact-name }}
Expand Down
10 changes: 10 additions & 0 deletions compiler/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions compiler/crates/persist-query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ serde = { version = "1.0.126", features = ["derive", "rc"] }
serde_json = { version = "1.0.64", features = ["float_roundtrip", "unbounded_depth"] }
thiserror = "1.0.29"
url = "2.2.2"

[features]
vendored = ["hyper-tls/vendored"]

0 comments on commit f1435c3

Please sign in to comment.