Skip to content

meta: Explicitly include items in packaged crate#5312

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
bushrat011899:exclude_etc
Jul 23, 2026
Merged

meta: Explicitly include items in packaged crate#5312
tgross35 merged 1 commit into
rust-lang:mainfrom
bushrat011899:exclude_etc

Conversation

@bushrat011899

@bushrat011899 bushrat011899 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Exclude /etc folder from cargo package by explicitly listing items to include. Currently published version of libc includes /etc/libc-util.py which cargo-deny picks up as an executable. Added in 27a38e3

Checklist

  • Relevant tests in libc-test/semver have been updated N/A
  • Commit messages permalink to headers for added or changed API N/A
  • Placeholder or unstable values like *LAST or *MAX have the standard doc comment N/A
  • Tested locally (cargo test -p libc-test --target mytarget);
    • Tested using cargo package and inspecting that the Python script is excluded.

@rustbot label +stable-nominated

@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jul 22, 2026
@tgross35

Copy link
Copy Markdown
Contributor

Does it maybe make sense to switch from exclude to include? I feel like this has surprised us in the past.

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's the better path. Would you be able to change the exclude to include? And cover at least:

  • src
  • tests
  • examples (doesn't exist now but could in the future. Not sure if it will reject it)
  • build.rs
  • CHANGELOG*
  • LICENSE*
  • README*

(if you could post a diff of cargo package --list, that would be helpful too. Otherwise I can get it)

View changes since this review

@rustbot

rustbot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Added in 27a38e3 causes `cargo-deny` warnings due to the inclusion of an executable Python script.
@bushrat011899

Copy link
Copy Markdown
Contributor Author

Does it maybe make sense to switch from exclude to include? I feel like this has surprised us in the past.

Yeah I think that makes more sense. I would assume it's easier to notice (and yank) if a libc version is missing required files than if it inadvertently includes additional ones.

I think that's the better path. Would you be able to change the exclude to include? And cover at least:

* src
* tests
* examples (doesn't exist now but could in the future. Not sure if it will reject it)
* build.rs
* CHANGELOG*
* LICENSE*
* README*

(if you could post a diff of cargo package --list, that would be helpful too. Otherwise I can get it)

The non-existent examples folder isn't an issue it seems so no problems there. Comparing before and after this commit using diff I get:

2,6d1
< .editorconfig
< .git-blame-ignore-revs
< .gitignore
< .release-plz.toml
< .rustfmt.toml
8d2
< CONTRIBUTING.md
16,17d9
< etc/libc-util.py
< rust-bors.toml

I think all of those make sense to exclude, but happy to amend!

@bushrat011899
bushrat011899 requested a review from tgross35 July 22, 2026 22:14
@bushrat011899

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@bushrat011899 bushrat011899 changed the title meta: Exclude /etc from Package meta: Explicitly include items in packaged crate Jul 23, 2026

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

View changes since this review

@tgross35
tgross35 added this pull request to the merge queue Jul 23, 2026
Merged via the queue into rust-lang:main with commit 53bc12c Jul 23, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants