Skip to content

Commit

Permalink
Try #1831:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Nov 20, 2020
2 parents 875ac93 + 99737ab commit 8c91eea
Show file tree
Hide file tree
Showing 15 changed files with 452 additions and 167 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ jobs:
artifact_name: 'wasmer-macos-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
run_integration_tests: true
- build: macos
os: macos-latest
rust: nightly
target: aarch64-apple-darwin
artifact_name: 'wasmer-macos-arm64'
- build: windows
os: windows-latest
rust: 1.46.0
Expand Down Expand Up @@ -83,7 +88,12 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Setup Rust target
run:
echo "\n[build]\ntarget = \"aarch64-apple-darwin\"" >> .cargo/config.toml
if: matrix.target != 'aarch64-apple-darwin' # we just build
- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files
Expand Down Expand Up @@ -131,7 +141,7 @@ jobs:
# echo "LLVM_SYS_100_PREFIX=C:/llvm-10" >> $GITHUB_ENV
# echo "LIBCLANG_PATH=C:/llvm-10/bin/libclang.dll" >> $GITHUB_ENV
- name: Install LLVM (Unix)
if: matrix.os != 'windows-latest'
if: matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin'
run: |
curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.llvm_url }} -L -o llvm.tar.xz
mkdir -p ${{ env.LLVM_DIR }}
Expand All @@ -141,12 +151,19 @@ jobs:
env:
LLVM_DIR: ${{ github.workspace }}/llvm-10
- name: Set up dependencies for Mac OS
run: brew install automake
run: |
brew install automake
if: matrix.os == 'macos-latest'
- run: make test
- name: Build and Test C API
- name: Test
run: |
make test
if: matrix.target != 'aarch64-apple-darwin'
- name: Test C API
run: |
make test-capi
if: matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin' # we can't test yet on Apple Silicon or Windows
- name: Build C API
run: |
make build-capi
if: matrix.os != 'windows-latest'
- name: Build C API on Windows
Expand Down Expand Up @@ -313,7 +330,7 @@ jobs:
asset_path: artifacts/wasmer-linux-amd64/wasmer-linux-amd64.tar.gz
asset_name: wasmer-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac
- name: Upload Release Asset Mac amd64
id: upload-release-asset-mac
uses: actions/upload-release-asset@v1
env:
Expand All @@ -323,6 +340,16 @@ jobs:
asset_path: artifacts/wasmer-macos-amd64/wasmer-darwin-amd64.tar.gz
asset_name: wasmer-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac arm64
id: upload-release-asset-mac
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-macos-amd64/wasmer-darwin-arm64.tar.gz
asset_name: wasmer-darwin-arm64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux aarch64
id: upload-release-asset-linux-aarch64
uses: actions/upload-release-asset@v1
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ ifeq ($(ARCH), aarch64)
endif
endif

ifeq ($(ARCH), arm64)
test_compilers_engines += cranelift-jit
endif

compilers := $(filter-out ,$(compilers))
test_compilers_engines := $(filter-out ,$(test_compilers_engines))

Expand Down
6 changes: 5 additions & 1 deletion examples/engine_cross_compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}

#[test]
#[cfg(not(windows))]
#[cfg(not(any(
windows,
// We don't support yet crosscompilation in macOS with Apple Silicon
all(target_os = "macos", target_arch = "aarch64")
)))]
fn test_cross_compilation() -> Result<(), Box<dyn std::error::Error>> {
main()
}
2 changes: 1 addition & 1 deletion lib/cli/src/commands/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Compile {
if ext != recommended_extension {
warning!("the output file has a wrong extension. We recommend using `{}.{}` for the chosen target", &output_filename, &recommended_extension)
}
},
}
None => {
warning!("the output file has no extension. We recommend using `{}.{}` for the chosen target", &output_filename, &recommended_extension)
}
Expand Down
Loading

0 comments on commit 8c91eea

Please sign in to comment.