Page MenuHomeFreeBSD

Stop using unifdef to generate bsdxml.h
ClosedPublic

Authored by arichardson on Feb 11 2018, 12:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 2:40 PM
Unknown Object (File)
Mar 25 2024, 10:43 PM
Unknown Object (File)
Mar 22 2024, 5:20 PM
Unknown Object (File)
Mar 22 2024, 5:20 PM
Unknown Object (File)
Mar 22 2024, 5:20 PM
Unknown Object (File)
Mar 22 2024, 5:20 PM
Unknown Object (File)
Mar 14 2024, 6:38 AM
Unknown Object (File)
Mar 8 2024, 8:13 AM
Subscribers
None

Details

Summary

The current invocation of unifdef causes the build to fail when using a shell with -o pipefail on by default since unifdef will return a non-zero exit status if it changes something. The only thing this call to unifdef does is remove 5 lines that will be ignored by the compiler anyway. Furthermore, it is the only make rule in the source tree that requires unifdef. Removing this call also makes it slightly easier to build without inhering $PATH (D16815) since we don't need unifdef anymore.

I also noticed that the sed call to replace the include guard has been broken for over 10 years since the import of expat 2.0.1 changed it from XmlParse_INCLUDED to Expat_INCLUDED. I could also fix this but since it's been broken for so long and no one noticed, it's probably not necessary.

Diff Detail

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

Event Timeline

lib/libexpat/Makefile
26 ↗(On Diff #39176)

Maybe just eliminate it entirely?

The VMS stuff is 4 lines and doesn't hurt anything to be present.

lib/libexpat/Makefile
26 ↗(On Diff #39176)

It looks like there might be a Linux unifdef that doesn't support -x? Maybe use a || true?

However, IMO this sort of build-time file modification is a relic of a time when we had a VCS with a large cost to "taking files off the vendor branch", which has not been a concern for some time.

I would probably drop this unifdef as @imp suggests and remove the __VMS parts from expat.h in contrib/, or just leave the __VMS bits.

arichardson retitled this revision from Allow building bsdxml.h when the bmake shell uses -o pipefail to Stop using unifdef to generate bsdxml.h.
arichardson edited the summary of this revision. (Show Details)

I think this is fine. The __VMS bits don't hurt to leave in. It seems dubious to even be doing the sed at this point vs just modifying the header in place in src. I think Alex mentioned that the sed for the #ifdef guard isn't even working because it was renamed in an import of an updated expat?

This revision is now accepted and ready to land.Aug 21 2018, 1:54 PM

need to update a comment, but otherwise looks good.

lib/libexpat/Makefile
21 ↗(On Diff #47025)

We no longer get rid of some of the VMS stuff...

This revision was automatically updated to reflect the committed changes.