You are not logged in.

#1 2020-05-16 01:09:49

ThreeGen
Member
Registered: 2015-02-17
Posts: 10

PKGBUILD with source in directory with pkgbuild? Feature request?

Hey guys, I'm looking into bisecting something in git. I also want to use pkgbuild to package it up and test it. After an hour of fiddling, I can't get pkgbuild and makepkg to use a local source in a folder in the same directory as the pkgbuild. I want to do this to manually run git-bisect in the source folder, and then use the pkgbuild to put it together for me with the bisected code.

Is there any way to do this? If not, I think it would be a great feature to be added.

If this isn't the right place to ask/request this, let me know where to actually put it, thanks.

Offline

#2 2020-05-16 01:14:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 23,441
Website

Re: PKGBUILD with source in directory with pkgbuild? Feature request?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2020-05-16 02:12:34

ThreeGen
Member
Registered: 2015-02-17
Posts: 10

Re: PKGBUILD with source in directory with pkgbuild? Feature request?

I know how to git bisect, I don't know how to get pkgbuild to use the source in the folder with the pkgbuild. It doesn't seem possible, actually, I'm just wondering if someone knows something I don't.

Edit: Ah, you guys suggest just doing it in-place of the source. Well, I guess this will work. It still would be nice to be able to tell pkgbuild to use a local source copy, so my normal OS builds wouldn't be messed with.

Last edited by ThreeGen (2020-05-16 02:14:34)

Offline

#4 2020-05-16 02:23:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 23,441
Website

Re: PKGBUILD with source in directory with pkgbuild? Feature request?

ThreeGen wrote:

I know how to git bisect, I don't know how to get pkgbuild to use the source in the folder with the pkgbuild.

That page tells you exactly how to use the source that is bisected in srcdir.  I'm not sure what you mean by the source in the folder with the PKGBUILD - do you mean under 'src' or do you actually clone a second copy in the same directory as the PKGBUILD?  If so, why?

ThreeGen wrote:

Edit: Ah, you guys suggest just doing it in-place of the source. Well, I guess this will work. It still would be nice to be able to tell pkgbuild to use a local source copy, so my normal OS builds wouldn't be messed with.

This doesn't make much sense.  Can you be more specific?  You can also just use content in the startdir if you really wanted, occasionally people will do that when they're working on code and haven't even bothered completing the PKGBUILD, but if you already have a normally functioning PKGBUILD, why would you want to do this?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2020-05-16 12:22:35

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,071

Re: PKGBUILD with source in directory with pkgbuild? Feature request?

The --noextract flag also prevents prepare() from being run.

For packages that need to execute things in prepare() (like autoreconf or patches ) to build correctly, git bisecting as outlined in that article fails.

I've had that happen a few times with VCS packages.

Making --noextract just skip extracting sources and adding a separate flag to skip prepare()  could solve this, but I never filed a feature request for makepkg as it seemed to me very few users would need this .


A workaround I use is to create a separate clone of the source where only the git bisect commands are run.
In the PKGBUILD I'd add the commit_being_tested to the source line and build the package normally, then tested.

Is that similar to what you want to achieve, ThreeGen ?


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#6 2020-05-20 18:55:13

ThreeGen
Member
Registered: 2015-02-17
Posts: 10

Re: PKGBUILD with source in directory with pkgbuild? Feature request?

I've got it bisecting, but later-fixed blocking bugs are not allowing me to test since the old Mesa doesn't work with single file clang, so I'm basically giving up using any of these methods or even bisecting.

But anyway, Mesa generates some files dynamically, meaning the code isn't sane between runs, not allowing for bisecting because of changes to the tree that I don't care about losing, but block the bisect unless removed. It's not an easy process, and is really more of a hack. It would just be nice to build "I'm debugging this package, not the makepkg." into makepkg, as it's really poorly put together for actual development work sadly.

Offline

#7 2020-05-20 21:44:34

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,309

Re: PKGBUILD with source in directory with pkgbuild? Feature request?

makepkg can do the bisection for you, have the source in the PKGBUILD pin to #commit=$COMMIT, and run:

git -C cloned-source bisect start --no-checkout

repeatedly run

COMMIT=$(git -C cloned-source rev-parse BISECT_HEAD) makepkg

makepkg will check out the commit referenced by $COMMIT, try to build it, etc. Tracking the bisection process happens outside of $srcdir, in the source clone located in ${SRCDEST:-$PWD}/.

Last edited by eschwartz (2020-05-21 00:13:11)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2020-05-20 23:44:31

ThreeGen
Member
Registered: 2015-02-17
Posts: 10

Re: PKGBUILD with source in directory with pkgbuild? Feature request?

Ah, I'll have to try that later. Thanks, will report back if it was a better method for my use case.

Offline

Board footer

Powered by FluxBB