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

Missing linker symbols with incremental build #61917

Closed
jsgf opened this issue Jun 17, 2019 · 3 comments
Closed

Missing linker symbols with incremental build #61917

jsgf opened this issue Jun 17, 2019 · 3 comments
Labels
A-incr-comp Area: Incremental compilation A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jsgf
Copy link
Contributor

jsgf commented Jun 17, 2019

I'm seeing linker errors of the form:

  = note: buck-out/dev/gen/scm/mononoke/mononoke_types/mononoke_types-unittest#binary,unittest/mononoke_types_unittest-3fe649e44bd0ade8.42tcmeh8woei6igl.rcgu.o:42tcmeh8woei6igl:function mononoke_types_unittest::hash::Sha256::from_bytes: error: undefined reference to '<T as core::convert::Into<U>>::into'
          buck-out/dev/gen/scm/mononoke/mononoke_types/mononoke_types-unittest#binary,unittest/mononoke_types_unittest-3fe649e44bd0ade8.42tcmeh8woei6igl.rcgu.o:42tcmeh8woei6igl:function mononoke_types_unittest::hash::Sha1::from_bytes: error: undefined reference to '<T as core::convert::Into<U>>::into'
          clang-8: error: linker command failed with exit code 1 (use -v to see invocation)

I have no idea how to get a small repro for this, but:

  • This is a Buck build, rather than cargo
  • It only happens with incremental builds. If I either remove the incremental DB or disable incremental builds, it works
  • It only happens at opt-level=1; opt-level=0 and opt-level=3 are fine
  • It goes away if I make small code changes, but it doesn't seem to matter what (which says incremental)
  • Changing codegen-units doesn't affect anything.

This might be a dup of #45929, but I'm not sure what.

Ugh, and now I can't repro it again. This, or something like it, has been showing up every week or so, so I'll update the next time I hit it.

@jonas-schievink jonas-schievink added A-incr-comp Area: Incremental compilation A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 17, 2019
@jonas-schievink
Copy link
Contributor

Yeah this has popped up quite a few times. Nominating to prioritize and maybe get to the bottom of these problems. I've also got a reliable reproduction of this in #59535.

@ehuss
Copy link
Contributor

ehuss commented Jun 18, 2019

Cargo recently had a user report something similar (rust-lang/cargo#7015) where disabling incremental solved the problem. I wasn't able to ever repro it myself, though. I'm not sure if T-compiler wants more examples or information, or if the general problem is understood.

@dtolnay
Copy link
Member

dtolnay commented Jun 19, 2019

Closing in favor of #59535 which has a reliable repro based on Cargo. I transferred the nomination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. 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