[arch-projects] [devtools] uses MAKEFLAGS (+others) from /etc/makepkg.conf not /usr/share/devtools/

james harvey jamespharvey20 at gmail.com
Fri Feb 8 01:00:24 UTC 2019


On Thu, Feb 7, 2019 at 8:14 AM Bruno Pagani <bruno.n.pagani at gmail.com> wrote:
> Le 07/02/2019 à 12:14, james harvey via arch-projects a écrit :
> > I got extremely confused when I accidentally found out that the
> > MAKEFLAGS that is needed to be set for parallel building using
> > devtools is the one in "/etc/makepkg.conf", instead of one like
> > "/usr/share/devtools/makepkg-x86_64.conf".
> >
> > Turns out this is because "makechrootpkg"::20180531-4::638 is:
> >
> >    load_vars /etc/makepkg.conf
> >
> > load_vars() only reads "{SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER",
> > so without me having set any of the others, it turns out the only
> > variable it uses from /etc is MAKEFLAGS.
> >
> > For me, I think this is the only makepkg/pacman variable in an entire
> > devtools run that isn't out of /usr/share/devtools, since "archbuild"
> > gives those to "mkarchroot" and "arch-nspawn... pacman -Syu", and they
> > are copied into "/var/lib/archbuild/extra-x86_64/root/etc/" for
> > anything ran in the chroot.
>
> Not the only variable, but the whole set above. On purpose.
>
> > Should this be fixed?
>
> AFAIK, this is the expected behaviour. When you build using devtools,
> you expect variables local to this machine/user to be respected (and
> that is the exact list of variables listed above), while distro settings
> for everything else to be used ({C,CXX,LD}FLAGS mostly).

OK, I had a misunderstanding here.  I was thinking all variables
should be coming out of /usr/share/devtools, but I get now that isn't
the case so those files can be left unmodified, and only these
variables are allowed to be customized.

> > I originally thought of a new "makechrootpkg
> > -M" option, but I think it could instead run:
> >
> >    load_vars ${copydir}/etc/makepkg.conf
> >
> > If not, should "/usr/share/devtools/makepkg-x86_64.conf" be updated
> > with a comment where those variables are, to say they're actually used
> > out of "/etc/makepkg.conf"?
>
> I don’t think you need to know about and thus ever touch
> `/usr/share/devtools/*.conf`. Unless you actually develop devtools
> themselves.

I guess I'm abusing devtools a bit, as a few others are.  I use
devtools to build modified official packages when necessary, and to
build AUR packages even if they depend on other AUR packages.  I add a
local repository to "/usr/share/devtools/pacman-extra.conf", and to
/etc/pacman.conf as a CacheDir so it is bind mounted.  I also add to
"COMPRESSXZ" "--threads=0" to
"/usr/share/devtools/makepkg-x86_64.conf".

Maybe others using devtools similarly are using a customized version
of archbuild using its own pacman and makepkg conf files, which is
what I used to do.  I stopped so when devtools updates its conf files,
it would overwrite my changes and I'd just add them back in.
Otherwise, I might miss merging changes into mine.

Or, maybe they run mkarchroot/arch-nspawn/makechrootpkg directly.

Or, maybe they use graysky2's clean-chroot-manager, which I haven't
looked at yet.

It still seems odd to me for "/usr/share/devtools/*.conf" to show
variables that are never read from it, and personally would replace
those with a comment referring to /etc/makepkg.conf, but I respect if
the answer is that I shouldn't have been confused because I shouldn't
have been looking at them in the first place.


More information about the arch-projects mailing list