From 93524fb595d528dbc4ee1bc1a71097c5f63ca4fb Mon Sep 17 00:00:00 2001 From: Be Wilson Date: Sun, 28 Jan 2024 20:54:39 -0600 Subject: [PATCH] move cc-test & gen-windows-sys-binding into workspace put these helper crates inside a new dev-tools directory to make it obvious what their purpose is --- .github/workflows/main.yml | 22 ++++++++----------- Cargo.toml | 6 +++++ {cc-test => dev-tools/cc-test}/Cargo.toml | 2 +- {cc-test => dev-tools/cc-test}/build.rs | 0 {cc-test => dev-tools/cc-test}/src/NMakefile | 0 {cc-test => dev-tools/cc-test}/src/aarch64.S | 0 .../cc-test}/src/aarch64.asm | 0 {cc-test => dev-tools/cc-test}/src/armv7.S | 0 {cc-test => dev-tools/cc-test}/src/bar1.c | 0 {cc-test => dev-tools/cc-test}/src/bar2.c | 0 {cc-test => dev-tools/cc-test}/src/baz.cpp | 0 .../cc-test}/src/compile_error.c | 0 {cc-test => dev-tools/cc-test}/src/cuda.cu | 0 {cc-test => dev-tools/cc-test}/src/dummy.c | 0 {cc-test => dev-tools/cc-test}/src/expand.c | 0 {cc-test => dev-tools/cc-test}/src/foo.c | 0 {cc-test => dev-tools/cc-test}/src/i686.S | 0 {cc-test => dev-tools/cc-test}/src/i686.asm | 0 .../cc-test}/src/include/foo.h | 0 {cc-test => dev-tools/cc-test}/src/lib.rs | 0 {cc-test => dev-tools/cc-test}/src/msvc.c | 0 .../cc-test}/src/opt_linkage.c | 0 .../cc-test}/src/riscv64gc.S | 0 {cc-test => dev-tools/cc-test}/src/windows.c | 0 {cc-test => dev-tools/cc-test}/src/x86_64.S | 0 {cc-test => dev-tools/cc-test}/src/x86_64.asm | 0 {cc-test => dev-tools/cc-test}/tests/all.rs | 0 .../cc-test}/tests/output.rs | 0 .../gen-windows-sys-binding}/Cargo.toml | 6 +---- .../gen-windows-sys-binding}/src/main.rs | 0 .../gen-windows-sys-binding}/windows_sys.list | 0 31 files changed, 17 insertions(+), 19 deletions(-) rename {cc-test => dev-tools/cc-test}/Cargo.toml (91%) rename {cc-test => dev-tools/cc-test}/build.rs (100%) rename {cc-test => dev-tools/cc-test}/src/NMakefile (100%) rename {cc-test => dev-tools/cc-test}/src/aarch64.S (100%) rename {cc-test => dev-tools/cc-test}/src/aarch64.asm (100%) rename {cc-test => dev-tools/cc-test}/src/armv7.S (100%) rename {cc-test => dev-tools/cc-test}/src/bar1.c (100%) rename {cc-test => dev-tools/cc-test}/src/bar2.c (100%) rename {cc-test => dev-tools/cc-test}/src/baz.cpp (100%) rename {cc-test => dev-tools/cc-test}/src/compile_error.c (100%) rename {cc-test => dev-tools/cc-test}/src/cuda.cu (100%) rename {cc-test => dev-tools/cc-test}/src/dummy.c (100%) rename {cc-test => dev-tools/cc-test}/src/expand.c (100%) rename {cc-test => dev-tools/cc-test}/src/foo.c (100%) rename {cc-test => dev-tools/cc-test}/src/i686.S (100%) rename {cc-test => dev-tools/cc-test}/src/i686.asm (100%) rename {cc-test => dev-tools/cc-test}/src/include/foo.h (100%) rename {cc-test => dev-tools/cc-test}/src/lib.rs (100%) rename {cc-test => dev-tools/cc-test}/src/msvc.c (100%) rename {cc-test => dev-tools/cc-test}/src/opt_linkage.c (100%) rename {cc-test => dev-tools/cc-test}/src/riscv64gc.S (100%) rename {cc-test => dev-tools/cc-test}/src/windows.c (100%) rename {cc-test => dev-tools/cc-test}/src/x86_64.S (100%) rename {cc-test => dev-tools/cc-test}/src/x86_64.asm (100%) rename {cc-test => dev-tools/cc-test}/tests/all.rs (100%) rename {cc-test => dev-tools/cc-test}/tests/output.rs (100%) rename {gen-windows-sys-binding => dev-tools/gen-windows-sys-binding}/Cargo.toml (55%) rename {gen-windows-sys-binding => dev-tools/gen-windows-sys-binding}/src/main.rs (100%) rename {gen-windows-sys-binding => dev-tools/gen-windows-sys-binding}/windows_sys.list (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c5ed61457..ac4c6f43b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,11 +86,9 @@ jobs: sudo apt-get update sudo apt-get install g++-multilib if: matrix.build == 'linux32' - - run: cargo test ${{ matrix.no_run }} - - run: cargo test ${{ matrix.no_run }} --features parallel - - run: cargo test ${{ matrix.no_run }} --manifest-path cc-test/Cargo.toml --target ${{ matrix.target }} - - run: cargo test ${{ matrix.no_run }} --manifest-path cc-test/Cargo.toml --target ${{ matrix.target }} --features parallel - - run: cargo test ${{ matrix.no_run }} --manifest-path cc-test/Cargo.toml --target ${{ matrix.target }} --release + - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} + - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release + - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel check-tvos: name: Test aarch64-apple-tvos @@ -104,11 +102,9 @@ jobs: rustup component add rust-src --toolchain nightly rustup default nightly shell: bash - - run: cargo test -Z build-std=std --no-run --target aarch64-apple-tvos - - run: cargo test -Z build-std=std --no-run --features parallel --target aarch64-apple-tvos - - run: cargo test -Z build-std=std --no-run --manifest-path cc-test/Cargo.toml --target aarch64-apple-tvos - - run: cargo test -Z build-std=std --no-run --manifest-path cc-test/Cargo.toml --target aarch64-apple-tvos --features parallel - - run: cargo test -Z build-std=std --no-run --manifest-path cc-test/Cargo.toml --target aarch64-apple-tvos --release + - run: cargo test -Z build-std=std --no-run --workspace --target aarch64-apple-tvos + - run: cargo test -Z build-std=std --no-run --workspace --target aarch64-apple-tvos --release + - run: cargo test -Z build-std=std --no-run --workspace --target aarch64-apple-tvos --features parallel cuda: name: Test CUDA support @@ -126,7 +122,7 @@ jobs: - name: Test 'cudart' feature shell: bash run: | - PATH="/usr/local/cuda/bin:$PATH" cargo test --manifest-path cc-test/Cargo.toml --features test_cuda + PATH="/usr/local/cuda/bin:$PATH" cargo test --manifest-path dev-tools/cc-test/Cargo.toml --features test_cuda msrv: name: MSRV @@ -147,8 +143,8 @@ jobs: run: cargo +nightly update -Zminimal-versions - name: Cache downloaded crates since 1.53 is really slow in fetching uses: Swatinem/rust-cache@v2 - - run: cargo check --lib - - run: cargo check --lib --all-features + - run: cargo check --lib -p cc + - run: cargo check --lib -p cc --all-features clippy: name: Clippy diff --git a/Cargo.toml b/Cargo.toml index 9e646aa64..720a76daa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,3 +28,9 @@ parallel = [] [dev-dependencies] tempfile = "3" + +[workspace] +members = [ + "dev-tools/cc-test", + "dev-tools/gen-windows-sys-binding", +] diff --git a/cc-test/Cargo.toml b/dev-tools/cc-test/Cargo.toml similarity index 91% rename from cc-test/Cargo.toml rename to dev-tools/cc-test/Cargo.toml index 66f2d0144..cc7747eb6 100644 --- a/cc-test/Cargo.toml +++ b/dev-tools/cc-test/Cargo.toml @@ -11,7 +11,7 @@ doctest = false test = false [build-dependencies] -cc = { path = ".." } +cc = { path = "../.." } which = "^4.0" [features] diff --git a/cc-test/build.rs b/dev-tools/cc-test/build.rs similarity index 100% rename from cc-test/build.rs rename to dev-tools/cc-test/build.rs diff --git a/cc-test/src/NMakefile b/dev-tools/cc-test/src/NMakefile similarity index 100% rename from cc-test/src/NMakefile rename to dev-tools/cc-test/src/NMakefile diff --git a/cc-test/src/aarch64.S b/dev-tools/cc-test/src/aarch64.S similarity index 100% rename from cc-test/src/aarch64.S rename to dev-tools/cc-test/src/aarch64.S diff --git a/cc-test/src/aarch64.asm b/dev-tools/cc-test/src/aarch64.asm similarity index 100% rename from cc-test/src/aarch64.asm rename to dev-tools/cc-test/src/aarch64.asm diff --git a/cc-test/src/armv7.S b/dev-tools/cc-test/src/armv7.S similarity index 100% rename from cc-test/src/armv7.S rename to dev-tools/cc-test/src/armv7.S diff --git a/cc-test/src/bar1.c b/dev-tools/cc-test/src/bar1.c similarity index 100% rename from cc-test/src/bar1.c rename to dev-tools/cc-test/src/bar1.c diff --git a/cc-test/src/bar2.c b/dev-tools/cc-test/src/bar2.c similarity index 100% rename from cc-test/src/bar2.c rename to dev-tools/cc-test/src/bar2.c diff --git a/cc-test/src/baz.cpp b/dev-tools/cc-test/src/baz.cpp similarity index 100% rename from cc-test/src/baz.cpp rename to dev-tools/cc-test/src/baz.cpp diff --git a/cc-test/src/compile_error.c b/dev-tools/cc-test/src/compile_error.c similarity index 100% rename from cc-test/src/compile_error.c rename to dev-tools/cc-test/src/compile_error.c diff --git a/cc-test/src/cuda.cu b/dev-tools/cc-test/src/cuda.cu similarity index 100% rename from cc-test/src/cuda.cu rename to dev-tools/cc-test/src/cuda.cu diff --git a/cc-test/src/dummy.c b/dev-tools/cc-test/src/dummy.c similarity index 100% rename from cc-test/src/dummy.c rename to dev-tools/cc-test/src/dummy.c diff --git a/cc-test/src/expand.c b/dev-tools/cc-test/src/expand.c similarity index 100% rename from cc-test/src/expand.c rename to dev-tools/cc-test/src/expand.c diff --git a/cc-test/src/foo.c b/dev-tools/cc-test/src/foo.c similarity index 100% rename from cc-test/src/foo.c rename to dev-tools/cc-test/src/foo.c diff --git a/cc-test/src/i686.S b/dev-tools/cc-test/src/i686.S similarity index 100% rename from cc-test/src/i686.S rename to dev-tools/cc-test/src/i686.S diff --git a/cc-test/src/i686.asm b/dev-tools/cc-test/src/i686.asm similarity index 100% rename from cc-test/src/i686.asm rename to dev-tools/cc-test/src/i686.asm diff --git a/cc-test/src/include/foo.h b/dev-tools/cc-test/src/include/foo.h similarity index 100% rename from cc-test/src/include/foo.h rename to dev-tools/cc-test/src/include/foo.h diff --git a/cc-test/src/lib.rs b/dev-tools/cc-test/src/lib.rs similarity index 100% rename from cc-test/src/lib.rs rename to dev-tools/cc-test/src/lib.rs diff --git a/cc-test/src/msvc.c b/dev-tools/cc-test/src/msvc.c similarity index 100% rename from cc-test/src/msvc.c rename to dev-tools/cc-test/src/msvc.c diff --git a/cc-test/src/opt_linkage.c b/dev-tools/cc-test/src/opt_linkage.c similarity index 100% rename from cc-test/src/opt_linkage.c rename to dev-tools/cc-test/src/opt_linkage.c diff --git a/cc-test/src/riscv64gc.S b/dev-tools/cc-test/src/riscv64gc.S similarity index 100% rename from cc-test/src/riscv64gc.S rename to dev-tools/cc-test/src/riscv64gc.S diff --git a/cc-test/src/windows.c b/dev-tools/cc-test/src/windows.c similarity index 100% rename from cc-test/src/windows.c rename to dev-tools/cc-test/src/windows.c diff --git a/cc-test/src/x86_64.S b/dev-tools/cc-test/src/x86_64.S similarity index 100% rename from cc-test/src/x86_64.S rename to dev-tools/cc-test/src/x86_64.S diff --git a/cc-test/src/x86_64.asm b/dev-tools/cc-test/src/x86_64.asm similarity index 100% rename from cc-test/src/x86_64.asm rename to dev-tools/cc-test/src/x86_64.asm diff --git a/cc-test/tests/all.rs b/dev-tools/cc-test/tests/all.rs similarity index 100% rename from cc-test/tests/all.rs rename to dev-tools/cc-test/tests/all.rs diff --git a/cc-test/tests/output.rs b/dev-tools/cc-test/tests/output.rs similarity index 100% rename from cc-test/tests/output.rs rename to dev-tools/cc-test/tests/output.rs diff --git a/gen-windows-sys-binding/Cargo.toml b/dev-tools/gen-windows-sys-binding/Cargo.toml similarity index 55% rename from gen-windows-sys-binding/Cargo.toml rename to dev-tools/gen-windows-sys-binding/Cargo.toml index 6a4787b6b..a1ef503cd 100644 --- a/gen-windows-sys-binding/Cargo.toml +++ b/dev-tools/gen-windows-sys-binding/Cargo.toml @@ -1,12 +1,8 @@ [package] name = "gen-windows-sys-binding" version = "0.0.0" -edition = "2021" +edition = "2018" publish = false [dependencies] windows-bindgen = "0.49" - -# Prevent this from interfering with workspaces -[workspace] -members = ["."] diff --git a/gen-windows-sys-binding/src/main.rs b/dev-tools/gen-windows-sys-binding/src/main.rs similarity index 100% rename from gen-windows-sys-binding/src/main.rs rename to dev-tools/gen-windows-sys-binding/src/main.rs diff --git a/gen-windows-sys-binding/windows_sys.list b/dev-tools/gen-windows-sys-binding/windows_sys.list similarity index 100% rename from gen-windows-sys-binding/windows_sys.list rename to dev-tools/gen-windows-sys-binding/windows_sys.list