Skip to content
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

compiletest: add a proper supports-crate-type: dylib directive #132309

Open
jieyouxu opened this issue Oct 29, 2024 · 1 comment
Open

compiletest: add a proper supports-crate-type: dylib directive #132309

jieyouxu opened this issue Oct 29, 2024 · 1 comment
Labels
A-compiletest Area: The compiletest test runner C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Oct 29, 2024

Apparently needs-dynamic-linking is not equivalent to checking if dylib or cdylib crate types are supported.

  • In compiletest, needs-dynamic-linking performs a check based on target cfg's dynamic_linking field + --print=cfg --target $TARGET.
  • However, target cfg has an additional field only_cdylib which, if dynamic_linking is true, indicates that only cdylib crate type is supported and not dylib.
    /// Whether dynamic linking is available on this target. Defaults to false.
    pub dynamic_linking: bool,
    /// Whether dynamic linking can export TLS globals. Defaults to true.
    pub dll_tls_export: bool,
    /// If dynamic linking is available, whether only cdylibs are supported.
    pub only_cdylib: bool,
    • This is the case for wasm base, dynamic linking is supported but not dylib crate type, only cdylib is supported.
      // we allow dynamic linking, but only cdylibs. Basically we allow a
      // final library artifact that exports some symbols (a wasm module) but
      // we don't allow intermediate `dylib` crate types
      dynamic_linking: true,
      only_cdylib: true,

Originally posted by @jieyouxu in #130860 (comment)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 29, 2024
@jieyouxu jieyouxu added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-compiletest Area: The compiletest test runner E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Oct 29, 2024
@jieyouxu
Copy link
Member Author

Related: #132350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants