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

*/*: speed up cargo SRC_URI generation #36759

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

antecrescent
Copy link
Contributor

@antecrescent antecrescent commented May 21, 2024

git grep -rlE '^inherit .*cargo' | grep '.ebuild$' |\
xargs pkgcheck scan -k SuboptimalCratesSeparator,SuboptimalCratesURICall \
-R FormatReporter --format '{category}/{package}/{package}-{version}.ebuild' |\
xargs sed -i -e 's/\$(cargo_crate_uris\( \${CRATES}\)\?)/\${CARGO_CRATE_URIS}/' \
-e 's/^\([[:space:]]*\|CRATES="\)\([a-zA-Z0-9_-]\+\)-\([0-9]\+\.[0-9]\+\.[0-9]\+.*\)/\1\2@\3/'

The second sed pattern breaks down into
(optional leading white space OR CRATES=")(crate validation regex from cargo.eclass)

Using this script, I changed

  • crates foo-1.2.3 to [email protected]
  • $(cargo_crate_uris) and $(cargo_crate_uris ${CRATES}) to ${CARGO_CRATE_URIS}

dev-util/cargo-c-0.9.14 is a false positive for SuboptimalCratesSeparator due to an empty ${MY_P} in CRATES.


Please check all the boxes that apply:

  • I can submit this contribution in agreement with the Copyright Policy.
  • I have certified the above via adding a Signed-off-by line to every commit in the pull request.
  • This contribution has not been created with the assistance of Natural Language Processing artificial intelligence tools, in accordance with the AI policy.
  • I have run pkgcheck scan --commits --net to check for issues with my commits.

Please note that all boxes must be checked for the pull request to be merged.

@gentoo-bot
Copy link

Pull Request assignment

Submitter: @antecrescent
Areas affected: ebuilds
Packages affected: app-backup/rdedup, app-benchmarks/hyperfine, app-crypt/nitrocli, app-editors/helix, app-i18n/yaskkserv2...

@gentoo/github: Too many disjoint maintainers, disabling auto-assignment.

Linked bugs

No bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment.

If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers.


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added maintainer-needed There is at least one affected package with no maintainer. Review it if you can. need assignment It was impossible to assign the PR correctly. Please assign it manually. no bug found No Bug/Closes found in the commits. labels May 21, 2024
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2024-05-21 14:00 UTC
Newest commit scanned: f7c7dc6
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/2a80e6242e/output.html

ac817be introduced the @ separator for
crates and ${CARGO_CRATE_URIS} to speed up SRC_URI generation.

Signed-off-by: Lucio Sauer <[email protected]>
@mgorny
Copy link
Member

mgorny commented May 21, 2024

Thanks for doing this!

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2024-05-21 14:45 UTC
Newest commit scanned: 28985dc
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/8c8e23ef4d/output.html

@antecrescent
Copy link
Contributor Author

I am currently compiling the affected packages to verify that I didn't break anything. Once that's done, I'll mark it as ready for review :)

@antecrescent antecrescent marked this pull request as ready for review May 21, 2024 15:51
@thesamesam thesamesam requested a review from mgorny May 25, 2024 08:26
@mgorny
Copy link
Member

mgorny commented May 25, 2024

I'm sorry to say but this really isn't feasible as all-in-one commit, because the individual packages are outdated already and it's a mess to update. Please rebase, split it to one commit per package, I'll merge then these that are up-to-date and reiterate over the rest.

gentoo-bot pushed a commit that referenced this pull request May 25, 2024
Co-authored-by: Lucio Sauer <[email protected]>
Bug: #36759
Signed-off-by: Maciej Barć <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-needed There is at least one affected package with no maintainer. Review it if you can. need assignment It was impossible to assign the PR correctly. Please assign it manually. no bug found No Bug/Closes found in the commits.
Projects
None yet
4 participants