Skip to content

Conversation

@naoNao89
Copy link
Contributor

Fixes compilation failures when using BusyBox ar on Windows.

BusyBox's ar doesn't support the -s flag, so we now gracefully fall back to ranlib when ar s fails.

Includes comprehensive test coverage and backward compatible with GNU ar

Fixes #504

@naoNao89 naoNao89 marked this pull request as draft December 17, 2025 19:03
@naoNao89 naoNao89 force-pushed the fix/issue-504-busybox-ar-compatibility branch 5 times, most recently from 9aa36c4 to 0542f93 Compare December 18, 2025 06:37
Fixes compilation failures when using BusyBox ar on Windows (and other
platforms with non-GNU ar implementations).

BusyBox's ar doesn't support the -s flag for symbol table generation.
This change adds graceful fallback behavior:
1. Try ar s first (works with GNU ar and most implementations)
2. If ar s fails, fall back to ranlib (equivalent functionality)
3. If ranlib fails/unavailable, continue without symbol tables
   (acceptable as symbol tables are an optimization, not a requirement)

Includes comprehensive cross-platform test coverage that verifies the
fallback mechanism works correctly.

Fixes rust-lang#504
@naoNao89 naoNao89 force-pushed the fix/issue-504-busybox-ar-compatibility branch from 0542f93 to 6b66492 Compare December 18, 2025 06:58
Add serial_test dependency and use #[serial] attribute to ensure
the busybox_ar_fallback test runs serially, not in parallel with
other tests. This prevents cross-contamination where the custom
ar/ranlib scripts from this test interfere with other tests running
concurrently in CI.

Fixes CI failures where tests tried to write to directories belonging
to other test instances.
@naoNao89 naoNao89 force-pushed the fix/issue-504-busybox-ar-compatibility branch from bddee93 to 7e0ad11 Compare December 18, 2025 07:46
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.

fail to compile because of 'ar crs'

1 participant