Skip to content

Cannot package libraries that contain vendored Rust libraries used in the build #6917

@jdm

Description

@jdm

https://github.com/servo/mozjs is a snapshot of the JS engine from https://hg.mozilla.org/mozilla-central/, wrapped up in a crate that invokes the native Makefile build from build.rs. This native build happens to invoke cargo build on a Rust project that exists inside https://hg.mozilla.org/mozilla-central/ and generates a binary that is used in the JS engine build. The build works fine, but running cargo package causes the subdirectory containing this project to be ignored (mozjs/js/src/frontend/binsource) because it contains a Cargo.toml. I am no longer able to publish new versions of mozjs on crates.io since this Rust library was introduced upstream because of this restriction.

Activity

alexcrichton

alexcrichton commented on May 8, 2019

@alexcrichton
Member

I believe this happens roughly around here, and unfortunately there's no clear fix for this I know of.

SimonSapin

SimonSapin commented on Sep 24, 2019

@SimonSapin
Contributor

@alexcrichton What do you think of not excluding a subpackage from the tarball if that directory is explicitly listed in include?

SimonSapin

SimonSapin commented on Sep 24, 2019

@SimonSapin
Contributor

By no clear fix, did you mean in the design decision of what the behavior should be, or are there implementation difficulties?

alexcrichton

alexcrichton commented on Sep 25, 2019

@alexcrichton
Member

I believe this is both a difficult design decision as well has something which has a number of implementation difficulties. I think that supporting this would require an RFC as well as a champion for the implementation.

added
S-needs-rfcStatus: Needs an RFC to make progress.
on Nov 1, 2023
nicoburns

nicoburns commented on Feb 7, 2025

@nicoburns
Contributor

This would be a "dumb workaround", but could the Cargo.toml be renamed to something else prior to packaging, and then renamed back in the build.rs, in order to avoid Cargo's package detection?

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jdm@epage@alexcrichton@SimonSapin@nicoburns

        Issue actions

          Cannot package libraries that contain vendored Rust libraries used in the build · Issue #6917 · rust-lang/cargo