Skip to content

cargo vendor does not vendor compiler_builtins #9915

@osa1

Description

@osa1

Using cargo 1.56.0-nightly (e515c3277 2021-09-08)

I have a Rust package that I build with cargo build -Zbuild-std=core,alloc. With these -Zbuild-std parameters cargo needs to build compiler_builtins for this package, but if I run cargo +nightly vendor -Zbuild-std=core,alloc vendor directory does not contain compiler_builtins.

Repro:

  • cargo +nightly new --bin cargo_vendor_bug
  • If you run cargo +nightly build -Zbuild-std=core,alloc --target=wasm32-wasi you will see that it builds compiler_builtins.
  • cargo +nightly vendor -Zbuild-std=core,alloc
  • Check vendor directory; it won't have compiler_builtins

Deps being built by this -Zbuild-std command:

  • core-0.0.0
  • compiler_builtins-0.1.49
  • rustc-std-workspace-core-1.99.0
  • alloc-0.0.0

I'm guessing core and alloc here are built into the compiler and cannot be vendored, but I'd expect compiler_builtins and rustc-std-workspace-core to be vendored as at least compiler_builtins (maybe rustc-std-workspace-core too) is fetched from crates.io and I can't build my package without fetching deps from crates.io with cargo vendor because of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions