Historical bug tracker for the Pacman package manager.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
FS#43498 - [pacman] makepkg VCS rebuilding - new flag(s) needed
Attached to Project:
Pacman
Opened by nfnty (nfnty) - Sunday, 18 January 2015, 19:21 GMT
Last edited by Allan McRae (Allan) - Monday, 01 February 2016, 00:28 GMT
Opened by nfnty (nfnty) - Sunday, 18 January 2015, 19:21 GMT
Last edited by Allan McRae (Allan) - Monday, 01 February 2016, 00:28 GMT
|
DetailsI've been having two problems with --noextract when rebuilding modified VCS sources, specifically with git bisecting.
1: --noextract can't be run with prepare(). It is necessary to run prepare() again when checking out new commits. 2: pkgver() is not run. $pkgver is not updated and --force has to be used when building and therefore discarding the old package. Making it hard to keep track of what commit the package was built with and not being able to compare packages. I'm proposing two things. Second proposal is also beneficial for non-VCS sources. 1: Adding the flag --vcsrebuild Like --noextract only with pkgver() and prepare(). --noprepare should work as is. 2: Adding the flag --prepare OR 2: --noextract calls prepare() --noprepare explicitly called when needed |
This task depends upon
After consideration only one general flag --rebuild (short form -B) is needed. Basically a flag that leaves the srcdir completely intact and runs the normal build process again, including pkgver() and prepare(). This flag would be beneficial for VCS and non-VCS builds alike.
--noprepare can be explicitly appended if needed. Maybe --nopkgver should also be added.
This also makes --noextract more or less unnecessary.
You can check yourself what --holdver is doing on line 564-577 in scripts/makepkg.sh.in or makepkg for that matter.
Something which is stopped with --noextract. Also --holdver is useless with --noextract.
What's your point?
You mention "git bisecting", but given your responses, I have absolutely no idea how you are doing that. Can you please provide a step-by-step guide to your workflow?
[first terminal]
1. cd "$srcdir/$srcname"
2. git bisect start
3. git bisect good "$oldpkg_commit"
4. git bisect bad HEAD
[second terminal]
5. makepkg --install --noconfirm --log --syncdeps --rmdeps --force --noextract
6. Test package
[first terminal]
if bad:
7. git bisect bad
if good:
7. git bisect good
[second terminal]
8. makepkg --install --noconfirm --log --syncdeps --rmdeps --force --noextract
9. Test package
...
...
...
continue until done.
Basically when updating packages and I hit a regression I go into $srcdir and start a git bisect. Therefore makepkg should do everything as usual minus the extraction(updating) and with pkgver() otherwise I have to overwrite the current package.
Then I tried a bisect in the $srcdir/<source> and running the build manually. It build from head:
allan@arya /home/arch/build/pacman-git/src/pacman ((76fc724...)|BISECTING)
> ./src/pacman/pacman -V
.--. Pacman v4.2.0-234-g76fc7 - libalpm v9.0.1
Note the version difference. So I can replicate the issue, but not for the reason described here. Someone with more git knowledge will need to look at this.
Note that you can bisect in the git checkout in the directory with the PKGBUILD and use the "#commit=...." fragment to work around this.
Is that the same thing causing your issue Allan, or something else?
I make a clean build directory and just extract the source (makepkg -Co). Then do a git bisect and manually build from within that directory. It still builds from head. Bisecting just is not working for some reason.
> > ./src/pacman/pacman -V
>
> .--. Pacman v4.2.0-234-g76fc7 - libalpm v9.0.1
>
> Note the version difference.
Am I missing something? Those version numbers match and `makepkg -e` appears to be building whatever commit I checkout.
Back to not understanding this bug then.
FS#46800also does this.Sure there's --noprepare which restores the old behavior, but that's a lot of extra typing for what I believe is a much more common use of --noextract.
For OP's use case of doing git bisects, you can specify the commit in the source array and thus skip --noextract since makepkg will checkout the correct commit each time.
[1] I often extract the sources using 'makepkg -o', manually edit some source files, and then use 'makepkg -e' to package it (while possibly repeating the edit/package steps).
We can suppress the prepare() function with --noprepare, but changing this back provides no way to tell prepare() to run unless we add a --prepare flag.
If someone provides that patch, I will look at it...
I don't see the need for a --prepare switch to be used together with --noextract (I consider prepare() tightly coupled to source extraction); its usefulness would be minimal at best.
If someone really wants to call prepare() when not extracting sources (for some special testing/bisect scenario), they can call it from build().