Page MenuHomeFreeBSD

krb5: compile_et: Fix the installed compile_et
ClosedPublic

Authored by markj on Aug 18 2025, 8:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 9:51 PM
Unknown Object (File)
Fri, Oct 10, 4:00 PM
Unknown Object (File)
Fri, Oct 10, 4:00 PM
Unknown Object (File)
Fri, Oct 10, 4:00 PM
Unknown Object (File)
Fri, Oct 10, 4:00 PM
Unknown Object (File)
Fri, Oct 10, 9:59 AM
Unknown Object (File)
Wed, Sep 24, 3:49 AM
Unknown Object (File)
Mon, Sep 15, 6:50 PM
Subscribers

Details

Summary

We now build compile_et from krb5/util/compile_et. The compile_et make
target runs compile_et.sh through a preprocessor that does some
substitution on the script, in particular it defines the directory where
compile_et can find et_h.awk and et_c.awk.

We build compile_et as a bootstrap tool since it's used to build krb5.
It also gets installed by installworld, presumably because we did that
with Heimdal Kerberos too and there's some chance that third-party
projects are using it.

There are two problems, both fixed by this patch:

First, we don't actually install those awk scripts anywhere, so
/usr/sbin/compile_et isn't usable on an installed system. Let's simply
install them to /usr/libexec/et.

Second, compile_et is a bootstrap tool and gets installed into WORLDTMP
during the bootstrap phase of the build. At that point we preprocess it
to set the directory where it can find those awk scripts. That
directory is currently set with KRB5_ETDIR?= ${DESTDIR}/usr/share/et,
but DESTDIR points into the object directory, so this value is bogus.

Since all build-time invocations of compile_et explicitly specify the
script directory with the -d option, let's just update the path to point
to the installed script directory. In particular, avoid fixing DESTDIR
in the script, since we don't do that generally.

PR: 288929

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Aug 18 2025, 8:30 PM
krb5/libexec/et/Makefile
8 ↗(On Diff #160566)

Should this use KRB5_ETDIR?

krb5/Makefile.inc
17

i'm not sure /usr/libexec is the right place for this. since it's not arch-specific (as far as i can tell from a quick look) it should probably go in /usr/share/et, which is also where upstream puts it.

markj added inline comments.
krb5/Makefile.inc
17

AFAIU libexec is for programs which aren't meant to be included in one's PATH, so this usage seems reasonable to me. But it's not very important, and yes it's probably better to match upstream when possible.

markj marked an inline comment as done.

Apply review feedback.

krb5/Makefile.inc
17

I do also wonder why ?= is used here. Probably not appropriate now it's hard-coded in BSD.usr.dist so best not to pretend overriding it is supported?

krb5/Makefile.inc
17

Some downstream distribution could plausibly want to override it, and etc/mtree/BSD.* isn't authoritative really. One can specify additional mtree files with LOCAL_MTREE too. Also, I think we generally tend to ?= for destination directories.

krb5/libexec/Makefile
12 ↗(On Diff #160568)

is this meant to be here? it looks like you're installing the scripts in util/et now and there's no krb5/libexec/et/Makefile in the review.

krb5/util/et/Makefile
46

i don't know if this really matters, but i think non-config files in base usually get mode 0444?

markj marked 2 inline comments as done.

Handle review comments:

  • fix up a hasty move from usr/libexec to usr/share
  • use a mode of 0444

not tested but this looks fine in principle. i think this puts the files in the wrong package (they should be in a -dev package) but compile_et is already in the wrong package and i have another review open that redoes the krb5 packaging stuff, so i'll make sure it's right there.

This revision is now accepted and ready to land.Aug 18 2025, 11:08 PM
This revision was automatically updated to reflect the committed changes.