You are not logged in.

#1 2018-07-11 22:02:25

89c51
Member
Registered: 2012-06-05
Posts: 716

PKGBUILDs and meson build system question

I have a question regarding meson use in PKGBUILDS.

If you build with meson outside of PKGBUILDs (assume an app from git) it compiles only the changes made after the last time you build. Is there a way to do this when you use it in a PKGBUILD?

Thanks in advance.

Offline

#2 2018-07-11 22:51:11

progandy
Member
Registered: 2012-05-17
Posts: 3,179

Re: PKGBUILDs and meson build system question

I think it should work. It depends on what is done in the build() function. Maybe try "makepkg --noprepare" for rebuilds and/or edit the build() function.

Last edited by progandy (2018-07-11 22:52:05)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2018-07-12 03:38:30

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,448

Re: PKGBUILDs and meson build system question

meson works the same way inside of a PKGBUILD as outside.

The difference is that for tarball sources, re-running makepkg will typically update the files by re-extracting them unless you use --noextract. Then meson thinks you've got updated files.

Typically when people want to build incremental builds like this they are using git sources in the PKGBUILD, which will just pull new changes to makepkg's working copy. This should work flawlessly and only compile new changes. It's not meson-specific.


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

Online

#4 2018-07-12 08:45:54

89c51
Member
Registered: 2012-06-05
Posts: 716

Re: PKGBUILDs and meson build system question

Eschwartz wrote:

Typically when people want to build incremental builds like this they are using git sources in the PKGBUILD, which will just pull new changes to makepkg's working copy. This should work flawlessly and only compile new changes. It's not meson-specific.

The thing is that it doesn't work as i expect it and i have no idea what to do.

Offline

#5 2018-07-12 09:23:45

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 6,369

Re: PKGBUILDs and meson build system question

Post the PKGBUILD with the command that doesn't do what you expect and clarify what you want to achieve.

If you're using arch-meson, check whether the things it sets may be causing the unexpected behaviour.


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 2018-07-12 14:33:09

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,448

Re: PKGBUILDs and meson build system question

89c51 wrote:
Eschwartz wrote:

Typically when people want to build incremental builds like this they are using git sources in the PKGBUILD, which will just pull new changes to makepkg's working copy. This should work flawlessly and only compile new changes. It's not meson-specific.

The thing is that it doesn't work as i expect it and i have no idea what to do.

"it" works as I expect, but until you clarify what doesn't work, how it doesn't work, what precise way it deviates from what you did expect, and how to reproduce it, there's really nothing else for me to say.

Lone_Wolf wrote:

If you're using arch-meson, check whether the things it sets may be causing the unexpected behaviour.

arch-meson should not be used, ever.

Last edited by eschwartz (2018-07-12 14:33:49)


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

Online

#7 2018-07-13 04:42:07

89c51
Member
Registered: 2012-06-05
Posts: 716

Re: PKGBUILDs and meson build system question

https://aur.archlinux.org/cgit/aur.git/ … nology-git

lets take the above package (terminology)

I have a directory with the PKGBUILD in it, i run makepkg -s and compiles the whole thing. If the devs push a change and run makepkg -s again it compiles the whole thing again and not only the changes. I want it to compile only the changes.

Offline

#8 2018-07-13 05:40:46

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,448

Re: PKGBUILDs and meson build system question

Well, um, it works for me in another meson project?

git clone https://github.com/linuxmint/nemo
cd nemo
git git reset --hard 3.8.4
meson build
ninja -C build
# 269 build objects get generated
git pull
# one new commit, one file modified
ninja -C build
# 18 objects get rebuilt, including one custom command which always runs no matter what

And sure enough, when I use a PKGBUILD and pin the sources, build the tag, then let makepkg update to the latest master, I get the same results! Because makepkg is not doing anything weird...

Clearly it can and does work.


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

Online

#9 2018-07-13 06:42:40

progandy
Member
Registered: 2012-05-17
Posts: 3,179

Re: PKGBUILDs and meson build system question

89c51 wrote:

https://aur.archlinux.org/cgit/aur.git/ … nology-git

lets take the above package (terminology)

I have a directory with the PKGBUILD in it, i run makepkg -s and compiles the whole thing. If the devs push a change and run makepkg -s again it compiles the whole thing again and not only the changes. I want it to compile only the changes.

  ./autogen.sh \
    --prefix=/usr

https://git.enlightenment.org/apps/term … autogen.sh
That removes the build directory and regenerates the build instructions, so it has to build from scratch. You can try to move that to prepare() and then call makepkg with --noprepare on recurring builds.

Last edited by progandy (2018-07-13 06:46:19)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#10 2018-07-13 06:47:44

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,448

Re: PKGBUILDs and meson build system question

Uhm, more specifically the autogen seems to be a wrapper script for meson, which rm -rf build && meson . build/ "$@"

https://git.enlightenment.org/apps/term … autogen.sh

Why can't autogen die even after autotools dies... -_-

EDIT: ninja edit wars.

Last edited by eschwartz (2018-07-13 06:48:26)


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

Online

#11 2018-07-13 13:57:01

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 6,369

Re: PKGBUILDs and meson build system question

Eschwartz wrote:
Lone_Wolf wrote:

If you're using arch-meson, check whether the things it sets may be causing the unexpected behaviour.

arch-meson should not be used, ever.

I completely agree, all my packages that need meson use it directly.
IF arch-meson is needed/useful (both of which i doubt) , it should be part of devtools, not  of the meson package.

I checked the terminology-git autogen.sh and found the same as progandy and Eschwartz posted.

Meson looks at the $directory where it builds to determine what has changed.
If that dir is erased, it has to build everything again.


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

Board footer

Powered by FluxBB