-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: "multiple rules generate" with Ninja Multiconfig in CROSS_CONFIG mode #491
Comments
Are you setting any of the |
In the original project I found this problem, yes. |
Thanks for the report! I think know where the issue is and hope I can find a bit of time and fix it before the end of the week. |
@xTachyon Could you test if #492 fixes your main issue? It's not a complete fix, since if the user sets |
It's another error now!
Edit: it seems only the Debug folder is populated, the Release folder is empty when that command executes. |
Could you share the test project you created? |
I believe the only relevant part of the project is the cmake:
The rust lib is just a staticlib which exports a symbol, which main.cpp uses. I could share a zip with all the files if you want. |
Hmm, that doesn't sound very different from our |
I've done a bit of investigating and tried out multiple different things, but it turns out this one is actually quite hard to fix. I think I could perhaps work around the issue by creating per-config dummy output files, and using those files to specify the appropriate dependencies, but it requires a bit of refactoring. |
Current Behavior
Building a simple project which imports a rust static lib fails to build when invoking ninja.
Expected Behavior
The build works.
Steps To Reproduce
Environment
CMake configure log with Debug log-level
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using Corrosion 0.4.99.99 with CMake 3.27.4 and the
Ninja Multi-Config
Generator-- Rust Toolchain: nightly-x86_64-unknown-linux-gnu
-- Rust toolchain nightly-x86_64-unknown-linux-gnu
-- Rust toolchain path /home/x/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu
-- Rust Target: x86_64-unknown-linux-gnu
-- Parsed Target triple: arch: x86_64, vendor: unknown, OS: linux, env: gnu
-- Parsed Target triple: arch: x86_64, vendor: unknown, OS: linux, env: gnu
-- Determining required link libraries for target x86_64-unknown-linux-gnu
-- Required static libs for target x86_64-unknown-linux-gnu: gcc_s;util;rt;pthread;m;dl;c
-- Found Rust: /home/x/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc (found version "1.74.0")
-- Cargo target x86_64-unknown-linux-gnu is an official target-triple
-- Installed targets: aarch64-apple-darwin;aarch64-unknown-linux-gnu;arm-unknown-linux-gnueabi;armv7-unknown-linux-gnueabihf;i586-unknown-linux-gnu;i686-pc-windows-gnu;i686-pc-windows-msvc;i686-unknown-linux-gnu;powerpc64-unknown-linux-gnu;riscv64gc-unknown-linux-gnu;wasm32-unknown-unknown;x86_64-pc-windows-msvc;x86_64-unknown-linux-gnu
-- Note: the following keywords passed to corrosion_import_crate had no associated value(s): FLAGS
-- Found 1 targets in package the_rust_lib
-- TARGET the_rust_lib produces byproducts libthe_rust_lib.a;;
-- Corrosion created the following CMake targets: the_rust_lib
-- Output directory property (target the_rust_lib): ARCHIVE_OUTPUT_DIRECTORY dir: output_directory-NOTFOUND
-- Setting IMPORTED_LOCATION_DEBUG for target the_rust_lib-static to
/home/x/y/repos/mytest/build/libthe_rust_lib.a
.-- Setting IMPORTED_LOCATION_RELEASE for target the_rust_lib-static to
/home/x/y/repos/mytest/build/libthe_rust_lib.a
.-- Setting IMPORTED_LOCATION_RELWITHDEBINFO for target the_rust_lib-static to
/home/x/y/repos/mytest/build/libthe_rust_lib.a
.-- Setting IMPORTED_LOCATION for target the_rust_lib-static to
/home/x/y/repos/mytest/build/libthe_rust_lib.a
.-- Adding command to copy byproducts
libthe_rust_lib.a
to $<$CONFIG:Debug:/home/x/y/repos/mytest/build>$<$CONFIG:Release:/home/x/y/repos/mytest/build>$<$CONFIG:RelWithDebInfo:/home/x/y/repos/mytest/build>/libthe_rust_lib.a-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/x/y/repos/mytest/build
CMake Build step log
Change Dir: '/home/x/y/repos/mytest/build'
Run Build Command(s): /usr/bin/ninja -v
ninja: error: CMakeFiles/impl-Debug.ninja:128: multiple rules generate libthe_rust_lib.a
The text was updated successfully, but these errors were encountered: