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

[Request] Interfere bypass and testing #80

Open
xiota opened this issue May 18, 2023 · 4 comments
Open

[Request] Interfere bypass and testing #80

xiota opened this issue May 18, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@xiota
Copy link
Contributor

xiota commented May 18, 2023

Would be nice if there were a way to bypass (broken) interferes or to test a (not yet merged) interfere. When testing interferes, the package directory shouldn't be cleaned because the build is likely to be run multiple times. (This could also be useful for checking artifacts when debugging the PKGBUILD.)

chaotic mkd -n package # bypass interfere
chaotic mkd -i package # test interfere stored someplace like package.int
@dr460nf1r3 dr460nf1r3 added the enhancement New feature or request label May 18, 2023
@xiota
Copy link
Contributor Author

xiota commented Sep 11, 2023

Maybe... could exit interference-apply() early if a special file, like interfere.bypass, is detected?

function interference-apply() {
set -euo pipefail
local _INTERFERE _PREPEND _PKGBUILD
_INTERFERE="${1:-}"
interference-generic "${_PKGTAG}"
# shellcheck source=/dev/null
[[ -f "${_INTERFERE}/prepare" ]] \
&& source "${_INTERFERE}/prepare"
if [[ -f "${_INTERFERE}/interfere.patch" ]]; then
if patch -Np1 <"${_INTERFERE}/interfere.patch"; then
echo 'Patches applied with success'
else
echo 'Ignoring patch failure...'
fi
fi
if [[ -f "${_INTERFERE}/PKGBUILD.prepend" ]]; then
# The worst one, but KISS and easier to maintain
_PREPEND="$(cat "${_INTERFERE}/PKGBUILD.prepend")"
_PKGBUILD="$(cat PKGBUILD)"
echo "$_PREPEND" >PKGBUILD
echo "$_PKGBUILD" >>PKGBUILD
fi
[[ -f "${_INTERFERE}/PKGBUILD.append" ]] \
&& cat "${_INTERFERE}/PKGBUILD.append" >>PKGBUILD
interference-pkgrel "${_PKGTAG}"
return 0
}

Then to build without interfere:

chaotic get package
touch package/interfere.bypass
chaotic mkd package

@xiota
Copy link
Contributor Author

xiota commented Sep 12, 2023

Can bypass by renaming folder. package_ and pkgbuild-package have been suggested rename targets.

Still don't know a way to test interferes without committing.

@dr460nf1r3
Copy link
Member

dr460nf1r3 commented Sep 12, 2023

nvm 😬

It still seems like a handy feature to test out interferes.

@xiota
Copy link
Contributor Author

xiota commented Sep 12, 2023

This PR only allows bypassing interferes, and others (@PedroHLC @Technetium1) have pointed out alternative methods.

Still don't know a way to test new interferes that haven't yet been committed though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants