Page MenuHomeFreeBSD

Fix build of ports that use /usr/share/mk on FBSD 10 when WITH_DEBUG_FILES=1
AbandonedPublic

Authored by bdrewery on May 9 2016, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 10:45 PM
Unknown Object (File)
Fri, Apr 12, 1:56 PM
Unknown Object (File)
Fri, Apr 12, 1:21 PM
Unknown Object (File)
Wed, Apr 10, 5:43 PM
Unknown Object (File)
Feb 8 2024, 8:59 PM
Unknown Object (File)
Jan 28 2024, 4:55 AM
Unknown Object (File)
Dec 20 2023, 12:36 AM
Unknown Object (File)
Dec 6 2023, 2:14 AM
Subscribers

Details

Reviewers
brd
asomers
Group Reviewers
portmgr
Summary

Fix the build of sysutils/cpdup and similar ports on FreeBSD stable/10 and
stable/9 since r403467, which set WITHOUT_DEBUG_FILES=1 in bsd.port.mk.

//SpectraBSD_ports/main/Mk/bsd.port.mk
Only set WITHOUT_DEBUG_FILES if OSVERSION > 1100091. That is the
closest FreeBSD_version change to rS291955, which set
DEBUG_FILES to a default YES option on FreeBSD 11. However, it
remains a default NO option on FreeBSD stable/10 and stable/9. This
causes ports to fail to build on those versions if
WITH_DEBUG_FILES=YES is set in /etc/src.conf.

This change effectively undoes svn revisions rP403467 and rP409433 on
older versions of FreeBSD.

Test Plan

I don't know. exp run? Reviewers, please suggest something.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 3633
Build 3673: arc lint + arc unit

Event Timeline

asomers retitled this revision from to Fix build of ports that use /usr/share/mk on FBSD 10 when WITH_DEBUG_FILES=1.
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added reviewers: bdrewery, brd.
mat edited edge metadata.

I don't understand what is broken, and what is fixed with this.

In D6271#133336, @mat wrote:

I don't understand what is broken, and what is fixed with this.

On FreeBSD stable/10, if you set "WITH_DEBUG_FILES=1" in /etc/src.conf and try to build a port like sysutils/cpdup, it will fail with an error like this:

make[1]: "/usr/share/mk/bsd.own.mk" line 502: WITH_DEBUG_FILES and WITHOUT_DEBUG_FILES can't both be set.
===> Compilation failed unexpectedly.

I said in email as well. Using WITH_DEBUG_FILES with ports cannot work. None of the plists expect .debug files. So you either get failed plist testing or a package that doesn't have the .debug files anyhow.

I said in email as well. Using WITH_DEBUG_FILES with ports cannot work. None of the plists expect .debug files. So you either get failed plist testing or a package that doesn't have the .debug files anyhow.

As far as ports go, I don't expect WITH_DEBUG_FILES to do anything. What it actually does is to produce packages that don't have .debug files. However, I set it in /etc/src.conf in order to affect the world build, and then it gets unintentionally sucked into the ports builds for things like cpdup that use the system make files. If ports were to ignore /etc/src.conf, then this wouldn't be a problem.

I said in email as well. Using WITH_DEBUG_FILES with ports cannot work. None of the plists expect .debug files. So you either get failed plist testing or a package that doesn't have the .debug files anyhow.

As far as ports go, I don't expect WITH_DEBUG_FILES to do anything. What it actually does is to produce packages that don't have .debug files. However, I set it in /etc/src.conf in order to affect the world build, and then it gets unintentionally sucked into the ports builds for things like cpdup that use the system make files. If ports were to ignore /etc/src.conf, then this wouldn't be a problem.

src.conf shouldn't be getting pulled into any port build, even cpdup which uses /usr/share/mk.

Do you have your ports/ directory nested inside of a src/ directory?

I said in email as well. Using WITH_DEBUG_FILES with ports cannot work. None of the plists expect .debug files. So you either get failed plist testing or a package that doesn't have the .debug files anyhow.

As far as ports go, I don't expect WITH_DEBUG_FILES to do anything. What it actually does is to produce packages that don't have .debug files. However, I set it in /etc/src.conf in order to affect the world build, and then it gets unintentionally sucked into the ports builds for things like cpdup that use the system make files. If ports were to ignore /etc/src.conf, then this wouldn't be a problem.

src.conf shouldn't be getting pulled into any port build, even cpdup which uses /usr/share/mk.

Do you have your ports/ directory nested inside of a src/ directory?

No. My portsdir is at ~/freebsd/ports, my src dir is at ~/freebsd/stable_10, my uname -a is

FreeBSD alans-fbsd10 10.3-STABLE FreeBSD 10.3-STABLE #6: Fri Apr  8 15:08:18 MDT 2016     alans@alans-fbsd10:/usr/obj/usr/home/alans/freebsd/stable_10/sys/GENERIC  amd64

And my /etc/src.conf is

WITH_TESTS=1
WITH_DEBUG_FILES=1

I have no /etc/make.conf.

grep SRCCONF /usr/share/mk/bsd.port.mk

Do you get WITHOUT_SRCCONF= ?

grep SRCCONF /usr/share/mk/bsd.port.mk

Do you get WITHOUT_SRCCONF= ?

_WITHOUT_SRCCONF=

It makes no difference. But if I change the patch to set _WITHOUT_SRCCONF instead of WITHOUT_SRCCONF, then I get voluminous errors about "Malformed conditional" in several /usr/share/mk/* files. Before we go any further, I should update my world and kernel to the latest stable/10. That'll take most of the day.

It makes no difference. But if I change the patch to set _WITHOUT_SRCCONF instead of WITHOUT_SRCCONF, then I get voluminous errors about "Malformed conditional" in several /usr/share/mk/* files. Before we go any further, I should update my world and kernel to the latest stable/10. That'll take most of the day.

Yup that's what I meant. Can you show the errors?

It makes no difference. But if I change the patch to set _WITHOUT_SRCCONF instead of WITHOUT_SRCCONF, then I get voluminous errors about "Malformed conditional" in several /usr/share/mk/* files. Before we go any further, I should update my world and kernel to the latest stable/10. That'll take most of the day.

Yup that's what I meant. Can you show the errors?

[alans@alans-fbsd10 ~/freebsd/ports/sysutils/cpdup]$ make
===>   cpdup-1.18 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by cpdup-1.18 for building
===>  Extracting for cpdup-1.18
=> SHA256 Checksum OK for cpdup-1.18.tgz.
===>  Patching for cpdup-1.18
===>  Configuring for cpdup-1.18
===>  Building for cpdup-1.18
make[1]: "/usr/share/mk/bsd.prog.mk" line 13: Malformed conditional (${MK_ASSERT_DEBUG} == "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 39: Malformed conditional (${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) &&  empty(DEBUG_FLAGS:M-gdwarf-*))
make[1]: "/usr/share/mk/bsd.prog.mk" line 57: Malformed conditional (${MK_DEBUG_FILES} != "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 92: Malformed conditional (${MK_CTF} != "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 129: Malformed conditional (${MK_DEBUG_FILES} != "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 141: Malformed conditional (${MK_MAN} != "no" && !defined(MAN) &&  !defined(MAN1) && !defined(MAN2) && !defined(MAN3) &&  !defined(MAN4) && !defined(MAN5) && !defined(MAN6) &&  !defined(MAN7) && !defined(MAN8) && !defined(MAN9))
make[1]: "/usr/share/mk/bsd.prog.mk" line 149: Malformed conditional (${MK_MAN} != "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 155: Malformed conditional (${MK_DEBUG_FILES} != "no")
make[1]: "/usr/share/mk/bsd.libnames.mk" line 27: Malformed conditional (${MK_LIBCPLUSPLUS} != "no")
make[1]: "/usr/share/mk/bsd.libnames.mk" line 72: Malformed conditional (${MK_IPX} != "no")
make[1]: "/usr/share/mk/bsd.libnames.mk" line 85: Malformed conditional (${MK_LDNS} != "no")
make[1]: "/usr/share/mk/bsd.libnames.mk" line 95: Malformed conditional (${MK_SENDMAIL} != "no")
make[1]: "/usr/share/mk/bsd.libnames.mk" line 161: Malformed conditional (${MK_UNBOUND} != "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 205: Malformed conditional (${MK_DEBUG_FILES} != "no")
make[1]: "/usr/share/mk/bsd.incs.mk" line 7: Malformed conditional (!defined(NO_INCS) && ${MK_TOOLCHAIN} != "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 250: Malformed conditional (${MK_MAN} != "no")
make[1]: "/usr/share/mk/bsd.prog.mk" line 264: Malformed conditional (${MK_MAN} != "no")
make[1]: "/usr/share/mk/bsd.sys.mk" line 146: Malformed conditional (${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" &&  ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips")
make[1]: Fatal errors encountered -- cannot continue
make[1]: stopped in /usr/home/alans/freebsd/ports/sysutils/cpdup/work/cpdup
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.

I see the problem now. Ports never should have been pulling in /etc/src.conf, but they always have since it was added. The options showing in your quote are all "src-only" options and don't get set when _WITHOUT_SRCCONF is set. Having a default value for them all would fix it.

Because src.conf is getting pulled in your value of WITH_DEBUG_FILES=yes in it is conflicting with the ports system wanting to disable it. https://people.freebsd.org/~bdrewery/patches/stable-10-without_srcconf.patch is probably the right fix for this (combined with the bsd.port.mk MAKE_ENV+= _WITHOUT_SRCCONF change). Though it would need an exp-run and would have unknown impact on users since ports have been pulling in src.conf for so long.

Using MAKE_ARGS+= MK_DEBUG_FILES=no would be an easy workaround if it wasn't for the "can't by set by a user" error. That was removed in head and I could remove it from stable/10 and stable/9 but then it will still hit release builds and need OSVERSION checks.

bdrewery edited reviewers, added: asomers; removed: bdrewery.

This is fixed after recent stable and ports/Mk/bsd.port.mk updates. See rP415530 commit message for a workaround in the meantime.