Page MenuHomeFreeBSD

Fix -DBUILD_WITH_STRICT_TMPPATH dtrace builds
ClosedPublic

Authored by arichardson on Aug 11 2020, 3:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 5:23 PM
Unknown Object (File)
Oct 8 2024, 2:33 PM
Unknown Object (File)
Oct 8 2024, 2:59 AM
Unknown Object (File)
Oct 7 2024, 12:50 PM
Unknown Object (File)
Oct 6 2024, 4:55 PM
Unknown Object (File)
Sep 23 2024, 1:15 AM
Unknown Object (File)
Sep 23 2024, 1:15 AM
Unknown Object (File)
Sep 23 2024, 1:15 AM
Subscribers

Details

Summary

Some of the scripts used for libdtrace invoke nawk instead of awk
(for example cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh).
When bootstrapping all tools, we get the nawk -> awk link while building
usr.bin/awk, but when linking/copying the dependencies from the host we
were only adding awk but not nawk.

This was silently generating invalid files when building libdtrace with
BUILD_WITH_STRICT_TMPPATH=1 since those scripts invoke nawk instead of
awk. In addition to adding the missing link this commit also adds
set -e to those scripts to catch errors like this in the future.

Obtained from: CheriBSD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Seems fine to me, but can you see why we can't just use awk?

This revision is now accepted and ready to land.Aug 11 2020, 3:18 PM

Was the issue just that it tried to invoke nawk but it didn't exist?

Was the issue just that it tried to invoke nawk but it didn't exist?

Yes and then it failed to produce correct output.

I guess I could also change it to use awk instead, but since I haven't audited the whole tree for uses of nawk, adding the nawk->awk link to WORLDTMP seems like the safer solution.

adding the nawk->awk link to WORLDTMP seems like the safer solution

Yeah, that's fine with me. A future step could be to make BUILD_WITH_STRICT_TMPPATH the default, then try to identify and remove unnecessary tools more broadly.

adding the nawk->awk link to WORLDTMP seems like the safer solution

Yeah, that's fine with me. A future step could be to make BUILD_WITH_STRICT_TMPPATH the default, then try to identify and remove unnecessary tools more broadly.

I would very much like to do that. It's already the default in CheriBSD and I originally set it to on-by-default when I first committed it upstream. However, it broke too many cases that I hadn't tested/wasn't able to test, so I switched the default to off again.
I'll try flipping the default again after the cross-build patches have landed, hopefully the remaining issues will be fixed by those patches.

This revision was automatically updated to reflect the committed changes.