Page MenuHomeFreeBSD

retrieve OS release automatically to build compiler target triple
ClosedPublic

Authored by alfredo on Mar 3 2022, 8:35 PM.
Tags
None
Referenced Files
F102782567: D34429.id103457.diff
Sun, Nov 17, 3:12 AM
Unknown Object (File)
Thu, Oct 24, 10:22 AM
Unknown Object (File)
Oct 4 2024, 7:56 PM
Unknown Object (File)
Oct 1 2024, 8:23 PM
Unknown Object (File)
Oct 1 2024, 2:28 PM
Unknown Object (File)
Sep 30 2024, 2:14 PM
Unknown Object (File)
Sep 30 2024, 9:33 AM
Unknown Object (File)
Sep 30 2024, 7:18 AM

Details

Summary

Retrieve FreeBSD revision number directly from sys/conf/newvers.sh
when building the compiler target triple value, avoiding manual
intervention on every new release.

This patch was split from D19237, so added reviewers/commenters of that change

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44633
Build 41521: arc lint + arc unit

Event Timeline

imp requested changes to this revision.Mar 3 2022, 8:46 PM
imp added inline comments.
share/mk/src.sys.env.mk
27

Never use sed for this. It's always wrong now that we can get the answer directly. It has proven to be historically fragile.

sh sys/conf/newvers.sh -V REVISION | cut -d= -f 2
"14.0"
This revision now requires changes to proceed.Mar 3 2022, 8:46 PM

I love this idea, btw. I hope my reaction my reaction to one small detail doesn't obscure this :)

share/mk/src.sys.env.mk
27
OS_REVISION!=eval `sh ${.CURDIR}/git/head/sys/conf/newvers.sh -V REVISION`; echo $$REVISION

works and eliminates the "" and can cope with all manner of weirdness that some downstreams do to newvers.sh.

updated with imp's suggestion

share/mk/src.sys.env.mk
30

I personally would change this to be " && echo $$REVISION || echo" in the event that $REVISION cannot be properly evaluated. Just my $0.02 USD, though.

In D34429#780080, @imp wrote:

I love this idea, btw. I hope my reaction my reaction to one small detail doesn't obscure this :)

Don't worry, luckily wasn't me the one who built that whole sed sentence, I just copied it from other places, otherwise I'd be very sad with how simple solution became now :-D

share/mk/src.sys.env.mk
27

I liked it! Used ${SRCTOP}/sys/conf/newvers.sh instead (I guess */git/head/* is your local path)

alfredo marked an inline comment as done.

Updated with gjb's suggestion

Hi @imp, are you ok with current patch?

looks good now. thanks.

This revision is now accepted and ready to land.Apr 10 2022, 11:17 PM