You are not logged in.

#1 2015-06-24 11:24:12

FlowIt
Member
Registered: 2014-10-25
Posts: 239

[Solved] Building packages from git bisect

I am bisecting a library and have to install it to /usr since the affected programs only look there. So I decided to build a package in each step of the bisect. But how must the PKGBUILD look like? I can build a tarball each time and specify it as source, but as I see it this tarball contains only the current sourcefiles, not the code from one specific commit.
I also thought of taking the easy way with ./configure --prefix=/usr && make && make install. Will this be problematic if the library is already installed by pacman?
Regards

Last edited by FlowIt (2015-06-24 17:18:05)

Offline

#2 2015-06-24 11:32:38

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

Re: [Solved] Building packages from git bisect

You can use a VCS PKGBUILD and (maybe) put the bisect commands in the build function.  Then just run makepkg with the `-e` flag to use the current source tree on each repetition.

(note: I've not really used git bisect myself, so this is untested.)


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

Offline

#3 2015-06-24 11:59:29

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,808
Website

Re: [Solved] Building packages from git bisect

Once you have got your git repo in src directory you can just remove the source from the PKGBUILD and do git bisect in the src directory manually via command line. Makepkg doesn't care if there is no source listed in the  PKGBUILD as long as you have something  in src directory, so you can just rebuild after every bisect step.

Last edited by ugjka (2015-06-24 12:02:19)


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Online

#4 2015-06-24 12:01:47

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

Re: [Solved] Building packages from git bisect

ugjka, would that be equivalent to useing `makepkg -e`, or am I missing part of it?


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

Offline

#5 2015-06-24 12:07:33

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,808
Website

Re: [Solved] Building packages from git bisect

Trilby wrote:

ugjka, would that be equivalent to useing `makepkg -e`, or am I missing part of it?

I guess you're right, didn't know about -e


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Online

#6 2015-06-24 12:31:50

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] Building packages from git bisect

And will the make command issued in the PKGBUILD really build the currently checked out commit?

So just to sum things up:
This will be the directory structure:

.
|-src/
|---.git/
|---configure.ac
|---src/
|-----main.c
|-----foo.c
|-PKGBUILD

And the only change the PKGBUILD needs is to write source=()
The package will be build with makepkg -e
Manual bisecting between the builds.

Offline

#7 2015-06-24 12:33:18

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,864
Website

Re: [Solved] Building packages from git bisect

I build in a clean chroot, so when I bisect, I usually have two copies of the git repository -- one in my home directory, which I carry out the bisect commands on, and one in the build directory, pulled in by the source array in the PKGBUILD. I use "#commit=<hash>" at the end of the git source declaration to build the commit that bisect tells me to check next.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#8 2015-06-24 12:35:54

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

Re: [Solved] Building packages from git bisect

You can either change the source array or use the -e flag to makepkg - the latter sounds easier to me, but they'd have the same effect.  There is no need to do both (though there'd also be no harm).

The make command in the PKGBUILD will build whatever is currently in the source directory, so if you've just checked out a specific commit (in the source directory) before running makepkg, then yes, that is what will build.


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

Offline

#9 2015-06-24 17:17:52

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] Building packages from git bisect

I chose Trilby's solution and it worked fine for me. Thanks.
I'll mark this topic as solved.

Offline

Board footer

Powered by FluxBB