-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
ci: implement auto-update groups #24344
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,8 @@ TERMUX_PKG_MAINTAINER="Joshua Kahn @TomJo2000" | |||||||||
| TERMUX_PKG_VERSION="0.40.0" | ||||||||||
| TERMUX_PKG_SRCURL=https://github.com/mpv-player/mpv/archive/v${TERMUX_PKG_VERSION}.tar.gz | ||||||||||
| TERMUX_PKG_SHA256=10a0f4654f62140a6dd4d380dcf0bbdbdcf6e697556863dc499c296182f081a3 | ||||||||||
| TERMUX_PKG_AUTO_UPDATE=false | ||||||||||
| TERMUX_PKG_AUTO_UPDATE=true | ||||||||||
| TERMUX_PKG_AUTO_UPDATE_GROUP=x11/mpv | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, so how did you choose the names for the update groups? If the update group names are "arbitrary" I'd prefer them to follow the project name or a suitable proxy like
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Name of update group is copied directly to PR description and, as a consequence, to git commit in the case if you squash two commits after PR reviewing.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd probably be better to not put semantic meaning into the name of the update group. What would the current commit messages be anyway? if (( "${#versions[*]}" == 1 )); then
title="bump(${group}): ${versions[@]}"
else
title="bump(${group}): group update"
fiIn which case
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There may also be a case where a package may be part of multiple autoupdate groups.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
All packages under
It should not happen. It is not designed this way.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think the versions always matching or all packages in a group always being updated at the same time is a particularly good assumption to make.
Not right now.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my understanding auto-update group definition is similar to rebuild group: group of packages which are required to be updated in the same PR/push because of version or ABI mismatch. I planned to implement something like creating autoupdate group for, i.e. boost with automatic revbumping of all revdeps (because of possible ABI mismatch of newer boost version).
As I said before my understanding of update group is similar to rebuild group so I do not see the point.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Since these two packages exist in different repos we can omit the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm gonna reiterate that I don't think repo channel information should be part of the update group names.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably it should be in the case if all packages in update group exist in the same repo. Just for consistency with other |
||||||||||
| TERMUX_PKG_DEPENDS="alsa-lib, ffmpeg, jack, libandroid-glob, libandroid-support, libarchive, libass, libcaca, libiconv, liblua52, libsixel, libuchardet, openal-soft, pulseaudio, rubberband, zlib, libplacebo" | ||||||||||
| TERMUX_PKG_RM_AFTER_INSTALL="share/icons share/applications" | ||||||||||
| TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" | ||||||||||
|
|
@@ -31,15 +32,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" | |||||||||
| -Dandroid-media-ndk=disabled | ||||||||||
| " | ||||||||||
|
|
||||||||||
| termux_step_post_get_source() { | ||||||||||
| # Version guard | ||||||||||
| local ver_m=${TERMUX_PKG_VERSION#*:} | ||||||||||
| local ver_x=$(. $TERMUX_SCRIPTDIR/x11-packages/mpv-x/build.sh; echo ${TERMUX_PKG_VERSION#*:}) | ||||||||||
| if [ "${ver_m}" != "${ver_x}" ]; then | ||||||||||
| termux_error_exit "Version mismatch between mpv and mpv-x." | ||||||||||
| fi | ||||||||||
| } | ||||||||||
|
|
||||||||||
| termux_step_pre_configure() { | ||||||||||
| LDFLAGS+=" -landroid-glob" | ||||||||||
| sed -i "s/host_machine.system() == 'android'/false/" ${TERMUX_PKG_SRCDIR}/meson.build | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,8 +24,8 @@ termux_pkg_upgrade_version() { | |||||||||
|
|
||||||||||
| local LATEST_VERSION="$1" | ||||||||||
| local SKIP_VERSION_CHECK="${2:-}" | ||||||||||
| local EPOCH | ||||||||||
| EPOCH="${TERMUX_PKG_VERSION%%:*}" # If there is no epoch, this will be the full version. | ||||||||||
| local EPOCH; EPOCH="${TERMUX_PKG_VERSION%%:*}" # If there is no epoch, this will be the full version. | ||||||||||
| local CURRENT_REF; CURRENT_REF="$(git rev-parse --abbrev-ref HEAD)" | ||||||||||
| # Check if it isn't the full version and add ':'. | ||||||||||
| if [[ "${EPOCH}" != "${TERMUX_PKG_VERSION}" ]]; then | ||||||||||
| EPOCH="${EPOCH}:" | ||||||||||
|
|
@@ -122,32 +122,41 @@ termux_pkg_upgrade_version() { | |||||||||
| fi | ||||||||||
| done < "${TERMUX_SCRIPTDIR}/scripts/big-pkgs.list" | ||||||||||
|
|
||||||||||
| _termux_should_cleanup "${big_package}" && "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./clean.sh | ||||||||||
| if [[ -z "${TERMUX_PKG_AUTO_UPDATE_GROUP}" ]]; then | ||||||||||
| _termux_should_cleanup "${big_package}" && "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./clean.sh | ||||||||||
|
|
||||||||||
| if ! "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./build-package.sh -C -a "${TERMUX_ARCH}" -i "${TERMUX_PKG_NAME}"; then | ||||||||||
| _termux_should_cleanup "${big_package}" && "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./clean.sh | ||||||||||
| git checkout -- "${TERMUX_PKG_BUILDER_DIR}" | ||||||||||
| termux_error_exit "ERROR: failed to build." | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| if ! "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./build-package.sh -C -a "${TERMUX_ARCH}" -i "${TERMUX_PKG_NAME}"; then | ||||||||||
| _termux_should_cleanup "${big_package}" && "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./clean.sh | ||||||||||
| git checkout -- "${TERMUX_PKG_BUILDER_DIR}" | ||||||||||
| termux_error_exit "ERROR: failed to build." | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| _termux_should_cleanup "${big_package}" && "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./clean.sh | ||||||||||
|
|
||||||||||
| if [[ "${GIT_COMMIT_PACKAGES}" == "true" ]]; then | ||||||||||
| echo "INFO: Committing package." | ||||||||||
| echo "INFO: Committing package${TERMUX_PKG_AUTO_UPDATE_GROUP:+" to ${TERMUX_PKG_AUTO_UPDATE_GROUP} update group"}." | ||||||||||
| stderr="$( | ||||||||||
| if [[ -n "${TERMUX_PKG_AUTO_UPDATE_GROUP}" ]]; then | ||||||||||
| # Switch to auto-update branch, create if needed | ||||||||||
| git checkout -b "auto-update/${TERMUX_PKG_AUTO_UPDATE_GROUP}/${GITHUB_RUN_ID}" || \ | ||||||||||
| git checkout "auto-update/${TERMUX_PKG_AUTO_UPDATE_GROUP}/${GITHUB_RUN_ID}" | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation is needed to make it explicit it is a part of another command (it goes after
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then move the
Suggested change
|
||||||||||
| fi | ||||||||||
| git add "${TERMUX_PKG_BUILDER_DIR}" 2>&1 >/dev/null | ||||||||||
| git commit -m "bump(${repo}/${TERMUX_PKG_NAME}): ${LATEST_VERSION}" \ | ||||||||||
| -m "This commit has been automatically submitted by Github Actions." 2>&1 >/dev/null | ||||||||||
| )" || { | ||||||||||
| git reset HEAD --hard | ||||||||||
| [[ -n "${TERMUX_PKG_AUTO_UPDATE_GROUP}" ]] && git checkout "${CURRENT_REF}" | ||||||||||
| termux_error_exit <<-EndOfError | ||||||||||
| ERROR: git commit failed. See below for details. | ||||||||||
| ${stderr} | ||||||||||
| EndOfError | ||||||||||
| } | ||||||||||
| [[ -n "${TERMUX_PKG_AUTO_UPDATE_GROUP}" ]] && git checkout "${CURRENT_REF}" | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| if [[ "${GIT_PUSH_PACKAGES}" == "true" ]]; then | ||||||||||
| if [[ "${GIT_PUSH_PACKAGES}" == "true" && -z "${TERMUX_PKG_AUTO_UPDATE_GROUP}" ]]; then | ||||||||||
| echo "INFO: Pushing package." | ||||||||||
| stderr="$( | ||||||||||
| # Fetch and pull before attempting to push to avoid a situation | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this have a mutual
TERMUX_PKG_ALIGN_VERSION_WITH=flangto coincide with Flang'sTERMUX_PKG_ALIGN_VERSION_WITH=libllvm?I wouldn't expect any issues from such a "loop" in alignment.
And if that does cause an issue, it should be handled by the alignment solver.
It should be visible from every package that has an alignment with another package that that alignment exists.
Just as every package in an update group should visibly be part of said update group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TERMUX_PKG_ALIGN_VERSION_WITHhandling code check package referenced in this variable and all packages referencing current package in theirTERMUX_PKG_ALIGN_VERSION_WITHif any. So it is kinda being checked both ways.Update group does not mean all packages in update group must have same versions. It only means they should be updated in single push/pull_request to avoid dependency update hell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still prefer to have a visual/text indicator of alignment or group membership in every package with such a relation.
Makes it significantly easier to search for such relations.
So in this case adding a,
TERMUX_PKG_ALIGN_VERSION_WITH=flangmakes it obvious from both package's build script that they require alignment with the other.
We should probably also turn
TERMUX_PKG_ALIGN_VERSION_WITHinto a comma separated list likeTERMUX_PKG_LICENSEfor example, since more than 2 packages may need to be version aligned with each other.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ofc you can do that to make it obvious, but it is not required. Anyway when you will try to update one of them without updating another one you will get version mismatch error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please cross-reference it for all packages that we're adding this to at the inception of the feature so we don't have to track these down later.
I'm even considering adding a linter rule to enforce full cross-referencing of alignments so this doesn't become a mess to figure out.
Note
Also in case you didn't catch it earlier,
Turning
TERMUX_PKG_ALIGN_VERSION_WITHinto a comma separated listlike
TERMUX_PKG_LICENSEwould be helpful since more than 2 packages may need to have their versions aligned.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it will be better to make checking code to find all packages referencing same package in
TERMUX_PKG_ALIGN_VERSION_WITHto make sure version guard works for all of them.Otherwise we might end up with referencing 60+ packages in every 60 buildscripts of them. And it will end up with a tree wide updating buildscripts if we add more kframeworks6 libraries.
I solved this by mentioning same package in all of packages requiring version aligning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's where the update group comes in though, no?
It doesn't imply version alignment, but it does imply a grouping.
Thanks. I feel like this is gonna be a mess otherwise so I wanna get ahead of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
TERMUX_PKG_ALIGN_VERSION_WITHshould come in separate PR, but it changes same files so I not decided if I should move it away from this PR. And also it helps us make sure nobody will break packages with randoms PRs updating specific packages despite of existing (or not yet existing) version guards.