Skip to content

Fix test library dirs for single config generators - #270

Merged
mjcarroll merged 1 commit into
ros2:rollingfrom
mjcarroll:mjcarroll/ninja-test-library-dirs
Sep 30, 2026
Merged

mjcarroll merged 1 commit into
ros2:rollingfrom
mjcarroll:mjcarroll/ninja-test-library-dirs

Conversation

@mjcarroll

@mjcarroll mjcarroll commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Description

${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG> only exists under a multi config generator. Ninja writes the libraries directly into the binary directory, so the APPEND_LIBRARY_DIRS entry pointed at a directory that does not exist and test_convert_round_trip_py failed with:

ImportError: DLL load failed while importing rosidl_generator_py_s__rosidl_typesupport_c

It is the only affected test because it turns PATH into DLL directories, which is how Python 3.8+ resolves an extension module's dependencies on Windows. The other tests reach typesupport through the installed package.

Found on ros2/ci#900, which switches Windows CI to Ninja: 46 failures in this test, none of them present in nightly_win_rel, which still builds with the Visual Studio generator. It also affects anyone building ROS 2 on Windows with Ninja today.

Is this user-facing behavior change?

No, test setup only.

Did you use Generative AI?

Yes, Claude Code (Claude Opus 5).

Additional Information

GENERATOR_IS_MULTI_CONFIG reports 0 under Ninja and 1 under Visual Studio 17 2022.

Needed by ros2/ci#900.

CMAKE_CURRENT_BINARY_DIR/$<CONFIG> only exists under a multi config
generator. Ninja writes the libraries directly into the binary directory,
so the PATH entry pointed at a directory that does not exist and
test_convert_round_trip_py failed with

  ImportError: DLL load failed while importing
  rosidl_generator_py_s__rosidl_typesupport_c

That test is the only one affected because it turns PATH into DLL
directories, which is how Python 3.8+ resolves an extension module's
dependencies on Windows.

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
Assisted-by: Claude Code (Claude Opus 5)
@mjcarroll mjcarroll self-assigned this Sep 29, 2026
@mjcarroll

Copy link
Copy Markdown
Member Author

Ninja (ros2/ci#900 scripts): Build Status

Visual Studio: Build Status

@mjcarroll
mjcarroll merged commit b9ed378 into ros2:rolling Sep 30, 2026
3 checks passed
@mjcarroll
mjcarroll deleted the mjcarroll/ninja-test-library-dirs branch September 30, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants