Skip to content

Missing linker symbols with incremental build #61917

Closed

Description

@jsgf

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.

Activity

  1. added
    A-incr-compArea: Incremental compilation
    A-linkageArea: linking into static, shared libraries and binaries
    C-bugCategory: This is a bug.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jun 17, 2019
  2. jonas-schievink commented on Jun 17, 2019

    @jonas-schievink
    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.

  3. ehuss commented on Jun 18, 2019

    @ehuss
    Contributor

    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.

  4. dtolnay commented on Jun 19, 2019

    @dtolnay
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationA-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.T-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