Skip to content

Windows builds fail to link C++ static library #107162

@jdm

Description

@jdm

Code

Building the mozjs crate for any Windows target stopped working after #97485. mozjs has a build script that compiles the C++ library SpiderMonkey into js_static.a, which is then linked. Before #97485, these builds worked successfully. Since that PR was merged, CI using nightly and beta toolsets targeting MSVC x86_64 and UWP x86_64 now fail to build with the following error:

error: failed to add native library D:\a\mozjs\mozjs\target\debug\build\mozjs_sys-4062d5cd7cbc7110\out\build/js/src/build\js_static.lib: Unsupported archive identifier

This was first reported in servo/mozjs#327 and servo/mozjs#334.

Version it worked on

2022-12-03 nightly
Rust 1.66 beta

Version with regression

2022-12-04 nightly
Rust 1.67 beta

If you know when this regression occurred, please add a line like below, replacing {channel} with one of stable, beta, or nightly.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.O-windows-msvcToolchain: MSVC, Operating system: WindowsP-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions