Skip to content

Commit

Permalink
Merge branch 'main' into faster-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeMathWalker committed Sep 22, 2024
2 parents 7ea7aa7 + 4565811 commit e617916
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
name: "Build CLIs ${{ matrix.target }} (${{ matrix.os }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-pc-windows-msvc
Expand Down Expand Up @@ -64,6 +65,21 @@ jobs:
uses: actions-rust-lang/[email protected]
with:
cache-workspaces: "./libs -> ./target"
components: llvm-tools-preview
- name: Install linker (Windows)
if: ${{ matrix.os == 'windows-2022' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-binutils
- name: Install linker (Linux)
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
sudo apt-get update
sudo apt-get install lld clang
- name: Install linker (MacOS)
if: ${{ matrix.os == 'macos-12' || matrix.os == 'macos-14' }}
run: |
brew install llvm
- name: Build CLI
run: |
cd libs
Expand Down Expand Up @@ -215,9 +231,23 @@ jobs:
- name: Install Rust stable toolchain
uses: actions-rust-lang/[email protected]
with:
components: rustfmt
components: rustfmt, llvm-tools-preview
rustflags: ""
cache-workspaces: "./libs -> ./target"
- name: Install linker (Windows)
if: ${{ matrix.os == 'windows-2022' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-binutils
- name: Install linker (Linux)
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
sudo apt-get update
sudo apt-get install lld clang
- name: Install linker (MacOS)
if: ${{ matrix.os == 'macos-12' || matrix.os == 'macos-14' }}
run: |
brew install llvm
- name: Download pavex CLI artifact
uses: actions/download-artifact@v4
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/libs/ui_test_envs2
/libs/target
/libs/vendor
/libs/.cargo
/doc_examples/tutorial_envs/
/doc_examples/**/target
/examples/**/vendor
Expand Down
20 changes: 20 additions & 0 deletions libs/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# On Windows
# ```
# cargo install -f cargo-binutils
# rustup component add llvm-tools-preview
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[target.x86_64-pc-windows-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

# On Linux:
# - Ubuntu, `sudo apt-get install lld clang`
# - Arch, `sudo pacman -S lld clang`
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]

# On MacOS, `brew install llvm` and follow steps in `brew info llvm`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld"]
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
22 changes: 22 additions & 0 deletions libs/pavex_test_runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,28 @@ impl TestData {
toml::to_string(&cargo_toml)?.as_bytes(),
)?;

let cargo_config = toml! {
[build]
incremental = false

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[target.x86_64-pc-windows-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld"]
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
};
let dot_cargo_folder = self.runtime_directory.join(".cargo");
fs_err::create_dir_all(&dot_cargo_folder)?;
persist_if_changed(
&dot_cargo_folder.join("config.toml"),
toml::to_string(&cargo_config)?.as_bytes(),
)?;

let main_rs = format!(
r##"use app_{}::blueprint;
use pavex_cli_client::{{Client, config::Color}};
Expand Down

0 comments on commit e617916

Please sign in to comment.