Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3400338
add option to autoinstall cargo target
jschwe Sep 2, 2024
3db4ffd
Move rustup target checking and installation to FindRust
jschwe Sep 6, 2024
99304ec
Fix FindRust error message
jschwe Sep 20, 2024
3ec73d8
clang,windows: fix passing link flags when using clang in GNU fronten…
russelltg Oct 8, 2024
1c6974c
Propagate Apple deployment target version from CMake to `cc` (#567)
IgKh Oct 8, 2024
c05ee36
cxxbridge: Add target to regenerate bridge files
Nov 13, 2024
a02953b
Fixed error with CMake due to missing Rustc
obsgolem Nov 19, 2024
b816285
CI: Stop caching the msvc build dir
jschwe Nov 23, 2024
f7ed3bf
Remove target_link_libraries in add_cxxbridge
Nov 19, 2024
27cced0
Add test for circular CXX bridge
Nov 27, 2024
934fee2
cxxbridge: Link to static and shared crate
Nov 27, 2024
4c0d9af
Fix output directory on Multi-Config Generators (#568)
obsgolem Dec 11, 2024
acf97b8
Add release note for #568
jschwe Dec 11, 2024
4628b4d
Minor improvement to release notes
jschwe Dec 11, 2024
6d0b915
Add NO_USES_TERMINAL option
jschwe Dec 15, 2024
b88ec09
Docs: "Cannot find source file" in common_issues
Dec 18, 2024
4b954fa
install cbindgen / cxxbridge with --locked
jschwe Dec 18, 2024
e0bad7c
Add CORROSION_TOOLS_RUST_TOOLCHAIN option
jschwe Dec 29, 2024
a88bc9b
fix: update `FindRust` to work with rustup v1.28.0
rami3l Dec 28, 2024
6be991b
Guard CORROSION_TOOLS_RUST_TOOLCHAIN behind rustup check
jschwe Dec 29, 2024
7f12363
Update release notes for v0.5.1
jschwe Dec 29, 2024
ae40958
cbindgen: Remove accidentally added option
jschwe Jan 1, 2025
573d73b
cbindgen/cxx: Add warnings for unknown arguments
jschwe Jan 1, 2025
caf0aa6
update cbindgen documentation
jschwe Jan 1, 2025
b4376fb
Add manual mode for cbindgen
jschwe Jan 1, 2025
7ac90a9
Add a test for cbindgen manual mode
jschwe Jan 1, 2025
999f93b
Rename cbindgen test
jschwe Jan 1, 2025
3985d57
fix typo in docs
jschwe Jan 4, 2025
52ff696
cxxbridge test: Remove MANIFEST_PATH arg
jschwe Jan 4, 2025
bcc042b
corrosion_install: Fix error when popping arg.
jschwe Jan 11, 2025
c7ddaa6
tests: Move TestFileExists.cmake
jschwe Jan 11, 2025
da1c772
Remove extra separator in path
Jan 9, 2025
113f047
Disable rustup_proxy test if rustup is not installed
jschwe Jan 12, 2025
6b0c1a9
tests: Improve parse_target_triple warning regex.
jschwe Jan 12, 2025
4833136
cbindgen: Fix adding header dependency on cargo-build
jschwe Jan 11, 2025
0c1c611
tests: Add test for installing cbindgen header
jschwe Jan 11, 2025
f783ee8
Improve debug output of TestFileExists
jschwe Jan 12, 2025
fcd8b41
cxx: Consider Rust target and features
jschwe Feb 10, 2025
8bb720a
Build different packages in different folders
Algunenano Feb 20, 2025
ed46536
Make it common for packages in the same workspace
Algunenano Mar 13, 2025
b3bd8ea
Include workspace folder name in cargo_target_dir
Algunenano Mar 26, 2025
c484074
CI: Update gh-pages workflow
jschwe Mar 29, 2025
bf065b8
Adjust default build directory
jschwe Apr 16, 2025
715c235
cbindgen: Fix rare issue with cbindgen failing to find cargo
jschwe Apr 16, 2025
00af456
Remove Rust_ROOT from documentation
jschwe Jun 4, 2025
4eccadd
cbindgen: Fix bindings if rustc is not in path
jschwe Jun 5, 2025
8a4942c
FindRust: Add debug info to unexpected rustc version msg
jschwe Jun 25, 2025
7095450
fix: compiler env vars for cc-rs when using custom target triple
audunhalland Aug 25, 2025
1646d43
Add test for custom target triples
jschwe Sep 21, 2025
256f198
fix: Use dashed version for cc-rs flags
jschwe Sep 21, 2025
4cd0a7a
test: downgrade Cargo.lock
jschwe Sep 21, 2025
e2d0f90
CI: install rust-src component
jschwe Sep 21, 2025
91b2e6a
fixup cargo_target_linker
jschwe Sep 21, 2025
118d8e8
exclude test when cross-compiling
jschwe Sep 21, 2025
769c5af
Add rust binary to custom target test
jschwe Sep 21, 2025
48812df
make bin test compatible with older rust versions
jschwe Sep 21, 2025
2b72943
fix guarding of custom target test
jschwe Sep 21, 2025
6297c82
try min 1.60.0 for custom target test
jschwe Sep 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
path: stable-v0.5
ref: 'stable/v0.5'
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Build mdbook for main branch
working-directory: 'main/doc'
run: mdbook build
Expand Down Expand Up @@ -70,9 +70,9 @@ jobs:
- name: Debug print
run: ls -la main/doc/book/v0.5
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: 'main/doc/book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
with:
toolchain: ${{inputs.rust}}
targets: ${{inputs.target_arch}}-unknown-linux-gnu
components: rust-src
- name: Install Cross Compiler
shell: bash
run: |
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
compiler:
- cl
- clang-cl
- clang
include:
- os: windows-2022
vs_version: vs-2022
Expand All @@ -79,6 +80,10 @@ jobs:
arch: i686
- compiler: clang-cl
arch: aarch64
- compiler: clang
arch: i686
- compiler: clang
arch: aarch64

steps:
- uses: actions/checkout@v4
Expand All @@ -93,6 +98,7 @@ jobs:
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-pc-windows-msvc
components: rust-src
- name: Setup MSVC Development Environment
uses: ilammy/msvc-dev-cmd@v1
with:
Expand Down Expand Up @@ -137,6 +143,7 @@ jobs:
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-pc-windows-gnu
components: rust-src
- name: Configure
run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.generator }}-${{ matrix.arch }}-pc-windows-gnu-${{ matrix.compiler }}"
- name: Run Tests
Expand Down Expand Up @@ -176,6 +183,7 @@ jobs:
with:
toolchain: stable
targets: ${{matrix.arch}}-pc-windows-gnullvm
components: rust-src
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.msystem}}
Expand Down Expand Up @@ -211,6 +219,7 @@ jobs:
with:
toolchain: stable
targets: aarch64-unknown-linux-gnu
components: rust-src
- name: Configure
run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" -DRust_CARGO_TARGET=aarch64-unknown-linux-gnu
- name: Run Tests
Expand Down Expand Up @@ -295,6 +304,7 @@ jobs:
with:
toolchain: ${{matrix.rust}}
targets: ${{matrix.arch}}-apple-darwin
components: rust-src
- name: Configure
run: cmake -S. -Bbuild --log-level=DEBUG -G "${{ matrix.generator }}" "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.arch }}-apple-darwin-${{ matrix.compiler }}"
- name: Run Tests
Expand Down Expand Up @@ -335,12 +345,13 @@ jobs:
- name: Install CMake
uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
with:
cmakeVersion: "~3.22.0"
cmakeVersion: "~3.24.0"
ninjaVersion: "~1.10.0"
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable minus 2 releases
components: rust-src
- name: Configure
run: >
cmake
Expand All @@ -353,6 +364,30 @@ jobs:
working-directory: build
run: ctest --output-on-failure --build-config Debug -j 3 -R "^cxxbridge"

autoinstall_cargo_target:
name: Test Auto-installing Cargo target via rustup
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install CMake
uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
- name: Install Rust
id: install_rust
uses: dtolnay/rust-toolchain@stable
- name: Install Cross Compiler
shell: bash
run: |
echo "::group::apt-install"
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "::endgroup::"
- name: Assert rustup target is not installed
run: rustup show | ( ! grep aarch64)
- name: Configure Corrosion
run: cmake -S. -Bbuild -GNinja -DRust_RUSTUP_INSTALL_MISSING_TARGET=ON --preset "aarch64-unknown-linux-gnu-gcc"
- name: Check rustup target is installed after configuring
run: rustup show | grep aarch64

install:
name: Test Corrosion as a Library
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -383,6 +418,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
components: rust-src
- name: Test Corrosion as installed module
run: >
cmake
Expand Down Expand Up @@ -410,6 +446,7 @@ jobs:
- linux_stage2
- darwin
- test_cxxbridge
- autoinstall_cargo_target
- install
runs-on: ubuntu-latest
# Step copied from: https://github.com/cross-rs/cross/blob/80c9f9109a719ffb0f694060ddc6e371d5b3a540/.github/workflows/ci.yml#L361
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/visual_studio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ jobs:
with:
toolchain: ${{inputs.rust}}
targets: ${{inputs.target_arch}}-pc-windows-msvc
components: rust-src
# The initial configure for MSVC is quite slow, so we cache the build directory
# (including the build directories of the tests) since reconfiguring is
# significantly faster.
- name: Cache MSVC build directory
id: cache-msvc-builddir
uses: actions/cache@v4
with:
path: build
key: ${{ inputs.os }}-${{ inputs.target_arch }}-${{ inputs.rust }}-msvc-${{ inputs.vs_version}}-build
# - name: Cache MSVC build directory
# id: cache-msvc-builddir
# uses: actions/cache@v4
# with:
# path: build
# key: ${{ inputs.os }}-${{ inputs.target_arch }}-${{ inputs.rust }}-msvc-${{ inputs.vs_version}}-build
- name: Configure
run: cmake -S. -Bbuild -DCORROSION_TESTS_KEEP_BUILDDIRS=ON "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "vs-${{ inputs.vs_version }}-${{ inputs.target_arch }}"
- name: Run Tests
Expand Down
12 changes: 12 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@
"name": "ninja-x86_64-pc-windows-msvc-clang-cl",
"inherits": ["ninja", "x86_64-pc-windows-msvc", "clang-cl"]
},
{
"name": "ninja-x86_64-pc-windows-msvc-clang",
"inherits": ["ninja", "x86_64-pc-windows-msvc", "clang"]
},
{
"name": "ninja-i686-pc-windows-msvc-cl",
"inherits": ["ninja", "i686-pc-windows-msvc", "cl", "windows-10-cross"]
Expand All @@ -208,6 +212,10 @@
"name": "ninja-i686-pc-windows-msvc-clang-cl",
"inherits": ["ninja", "i686-pc-windows-msvc", "clang-cl", "windows-10-cross"]
},
{
"name": "ninja-i686-pc-windows-msvc-clang",
"inherits": ["ninja", "i686-pc-windows-msvc", "clang", "windows-10-cross"]
},
{
"name": "ninja-aarch64-pc-windows-msvc-cl",
"inherits": ["ninja", "aarch64-pc-windows-msvc", "cl", "windows-10-cross"]
Expand All @@ -216,6 +224,10 @@
"name": "ninja-aarch64-pc-windows-msvc-clang-cl",
"inherits": ["ninja", "aarch64-pc-windows-msvc", "clang-cl", "windows-10-cross"]
},
{
"name": "ninja-aarch64-pc-windows-msvc-clang",
"inherits": ["ninja", "aarch64-pc-windows-msvc", "clang", "windows-10-cross"]
},
{
"name": "ninja-x86_64-pc-windows-gnullvm",
"inherits": ["ninja", "windows-only", "clang"],
Expand Down
24 changes: 23 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
[v0.4.0 Release notes](#040-lts-2023-06-01) for more details.
- Removed native tooling and the corresponding option `CORROSION_NATIVE_TOOLING`.
Corrosion now always uses pure CMake.
- Fix Corrosion placing artifacts into the wrong directory when:
1. using a Multi-Config Generator (e.g Visual Studio or XCode) AND
2. `OUTPUT_DIRECTORY_<CONFIG>` is not set AND
3. `OUTPUT_DIRECTORY` is set AND
4. `OUTPUT_DIRECTORY` does not contain a generator expression

Corrosion now places artifacts into a `$<CONFIG>` subdirectory of the
specified `OUTPUT_DIRECTORY`. This matches the [documented behavior][doc-cmake-rt-output-dir]
of CMake for regular CMake targets. ([#568]).

### New features

Expand All @@ -14,8 +23,21 @@
the crate-types of Rust libraries (e.g. force building as a staticlib instead of an rlib).
- Support *-windows-gnullvm targets.
- experimental support in corrosion_install for installing libraries and header files
- Add `CORROSION_TOOLS_RUST_TOOLCHAIN` cache variable which allows users to select a different
rust toolchain for compiling build-tools used by corrosion (currently cbindgen and cxxbridge).
This mainly allows using a newer toolchain for such build-tools then for the actual project.

[doc-cmake-rt-output-dir]: https://cmake.org/cmake/help/latest/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.html
[#459]: https://github.com/corrosion-rs/corrosion/pull/459
[#568]: https://github.com/corrosion-rs/corrosion/pull/568

# v0.5.1 (2024-12-29)

### Fixes

- Update FindRust to support `rustup` v1.28.0. Support for older rustup versions is retained,
so updating corrosion quickly is recommended to all rustup users.


# v0.5.0 (2024-05-11)

Expand Down Expand Up @@ -62,7 +84,7 @@

# v0.4.9 (2024-05-01)

### New Features
### New Features

- Automatically detect Rust target for OpenHarmony ([#510]).

Expand Down
Loading
Loading