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

Check in package/publish if a git submodule is dirty. #7245

Merged
merged 2 commits into from
Aug 13, 2019

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Aug 13, 2019

This extends the "dirty" check during cargo publish to check files within a submodule.

It is a little crude, since it unconditionally tries to open every submodule even if it is not relevant to the current package. The performance doesn't seem too bad (~2s for rust-lang/rust with 16 submodules).

It's also a little lax, by ignoring uninitialized submodules. Presumably the verification build will fail if the submodule is not initialized. It could be more aggressive, by requiring all submodules to be initialized?

Closes #3622

@rust-highfive
Copy link

r? @Eh2406

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 13, 2019
@alexcrichton
Copy link
Member

Yeah since this only happens on publication I think it's fine to do some slower checks like this. r=me with test fixes

@ehuss
Copy link
Contributor Author

ehuss commented Aug 13, 2019

@bors r=alexcrichton

@bors
Copy link
Collaborator

bors commented Aug 13, 2019

📌 Commit 22adaf9 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2019
@bors
Copy link
Collaborator

bors commented Aug 13, 2019

⌛ Testing commit 22adaf9 with merge a6841b8...

bors added a commit that referenced this pull request Aug 13, 2019
Check in package/publish if a git submodule is dirty.

This extends the "dirty" check during `cargo publish` to check files within a submodule.

It is a little crude, since it unconditionally tries to open every submodule even if it is not relevant to the current package. The performance doesn't seem too bad (~2s for rust-lang/rust with 16 submodules).

It's also a little lax, by ignoring uninitialized submodules. Presumably the verification build will fail if the submodule is not initialized. It could be more aggressive, by requiring all submodules to be initialized?

Closes #3622
@bors
Copy link
Collaborator

bors commented Aug 13, 2019

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing a6841b8 to master...

@bors bors merged commit 22adaf9 into rust-lang:master Aug 13, 2019
@ehuss ehuss added this to the 1.39.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cargo happily publishes when a git submodule is dirty
5 participants