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

cstore_impl dependency format linkage sometimes unknown #65890

Closed
pnkfelix opened this issue Oct 28, 2019 · 4 comments
Closed

cstore_impl dependency format linkage sometimes unknown #65890

pnkfelix opened this issue Oct 28, 2019 · 4 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

spawned off of #64872

The match input here (on line 245):

let formats = tcx.dependency_formats(LOCAL_CRATE);
let remove_generics = formats.iter().any(|(_ty, list)| {
match list.get(def_id.krate.as_usize() - 1) {
Some(Linkage::IncludedFromDylib) | Some(Linkage::Dynamic) => true,
_ => false,
}
});

sometimes returns None

Its not yet clear to me under which scenarios that happens. But when it does happen, the dependency may be (re)exported from a static or a dynamic crate. This is probably a sign that the logic here needs to be revised in some way (assuming that the information in question is available somewhere in the data structures; otherwise, we'll need to try to add it).

In any case, this issue is to log the problem, so that I can link to it from any tests I encounter that were previously assuming that the -Z share-generics optimization would always fire in this scenario.

@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 28, 2019
@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 28, 2019

Hmm I guess @alexcrichton has a theory as to how to interpret None here, namely:

None should be interpreted as "use the upstream generics" if and only if the only output crate type is an rlib. If the output crate type contains a dylib then we can't use unlinked artifacts generics.

@jonas-schievink jonas-schievink added the A-linkage Area: linking into static, shared libraries and binaries label Oct 28, 2019
@pnkfelix
Copy link
Member Author

@michaelwoerister was this fixed by #68277 ?

@michaelwoerister
Copy link
Member

No, #68277 didn't change anything there. It fixed the -Zshare-generics problems by going another route.

@Enselic
Copy link
Member

Enselic commented Dec 16, 2023

Triage: The quoted code was completely removed in d21f9b7. From what I understand, it is not known how to reproduce the problem. Now that the problematic code is removed, it is unclear to me how to take action here.

Closing as obsolete. Apologies in advance if that is inappropriate. Then of course feel free to re-open.

@Enselic Enselic closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants