pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: mk.conf error from pkg_chk (Was: openjdk21 build errors)
On Tue, 28 Jan 2025 at 20:50, Roland Illig <roland.illig%gmx.de@localhost> wrote:
>
> Am 28.01.2025 um 08:35 schrieb Mayuresh:
> > On Mon, Jan 27, 2025 at 06:28:57PM +0100, Roland Illig wrote:
> >> Since pkg_chk is a shell program, you can get an execution trace by running:
> >
> > I ran it as:
> >
> > sh -xe /usr/pkg/sbin/pkg_chk -Brnv
> >
> > I find this line intriguing:
> >
> > 190 eval $(printf "BSD_PKG_MK=1\n.PHONY: x\nx:\n\t@echo $1="'$'"{$1}\n" | ${MAKE} -f - -f $MAKECONF x)
>
> I consider this line a clear bug.
It was (at the time, sometime in the last century :) a "least worst
option" to try to bootstrap extracting the location of PKGSRCDIR
> The file mk/bsd.prefs.mk documents at the top that some variables are
> always defined when mk.conf is included. And even though OPSYS is not
> in that list, MACHINE_PLATFORM contains it, and it is defined
> unconditionally above the point where mk.conf is included, so OPSYS
> should be seen as guaranteed to be defined as well.
>
>
> Same for the variables OBJECT_FMT, NATIVE_OBJECT_FMT.
>
> I don't know pkg_chk, but maybe its maintainer David Brownlee can help
> out here by ensuring that mk.conf is only ever included in an
> environment that offers the same guarantees as pkgsrc itself.
Obviously the only way to absolutely guarantee that mk.conf is only
included with BSD_PKG_MK set with exactly the same environment as
pkgsrc itself would be to include the pkgsrc mk files.
Unfortunately at that point pkg_chk is attempting to determine where
pkgsrc is located by processing mk.conf, so cannot include pkgsrc mk
files directly.
The pkgsrc environment changes over time so what was good enough for
almost all cases in 1998 is so for a lesser percentage now. That it
"works for me" is certainly an incomplete argument.
I'm very much open to suggestions as to how to improve matters.
Obvious options include
Add some more manually set values in the relevant line above.
- Easiest, but least complete. Moves the goalposts closer, but still
outside the correct area
Install the correct subset of pkgsrc mk files along with the pkg_chk package.
- Simple enough to do, but introduces potential for confusion "hwy,
what is this folder in $PREFIX which has bsd.prefs.mk and other files
for, and breaks pkg_chk.sh from being to run standalone outside its
installed pkgsrc. The mk files might also be out of date from those in
pkgsrc
Postprocess the correct subset of pkgsrc mk files *into* the installed
pkg_chk script:
- It avoids the issues listed above, apart from the potential of out
of date files but.... uh, maybe?
Give up on trying to autodetect pkgsrc location
- I'd prefer not to lose that ability :)
David
Home |
Main Index |
Thread Index |
Old Index