Page MenuHomeFreeBSD

Filter certain compile-time options into -DATF_BUILD_*
ClosedPublic

Authored by ngie on Aug 30 2016, 1:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 1:23 AM
Unknown Object (File)
Tue, Nov 5, 8:14 AM
Unknown Object (File)
Tue, Nov 5, 8:14 AM
Unknown Object (File)
Sun, Nov 3, 5:59 AM
Unknown Object (File)
Sun, Nov 3, 5:45 AM
Unknown Object (File)
Sat, Nov 2, 12:55 AM
Unknown Object (File)
Oct 4 2024, 4:01 AM
Unknown Object (File)
Oct 3 2024, 11:11 AM
Subscribers

Details

Summary

Filter certain compile-time options into -DATF_BUILD_*

Items filtered through are:

  • Constant defines (-D)
  • Include flags (-I)
  • Linker flags (-L)
  • Optimization level (-O)
  • Warnings / linker flags (-W)
  • Preprocessor options (-f)

This fixes the scenario hit by the Jenkins job where it's infecting
the build with --sysroot, etc options from the Jenkins build in the
tests.

MFC after: 2 weeks
Reported by: Jenkins
Sponsored by: EMC / Isilon Storage Division

Diff Detail

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

Event Timeline

ngie retitled this revision from to Filter certain compile-time options into -DATF_BUILD_*.
ngie updated this object.
ngie edited the test plan for this revision. (Show Details)
ngie added reviewers: bdrewery, jmmv.
jmmv edited edge metadata.

I think this is fine. I just wonder if we should just zero out the parameters instead, or hardcode them to known values. I can't imagine a well-behaving compiler that wouldn't correctly build the test programs just with a call to ${CC} and no explicit flags.

lib/atf/libatf-c/Makefile
33 ↗(On Diff #19807)

While you are doing this, could you rename these variables to ATF_BUILD_*? It's weird they are prefixed just with an underscore.

Maybe just inline the values down below where the -D are defined.

This revision is now accepted and ready to land.Aug 30 2016, 1:30 AM
ngie marked an inline comment as done.Aug 30 2016, 2:00 AM
In D7702#159902, @jmmv wrote:

I think this is fine. I just wonder if we should just zero out the parameters instead, or hardcode them to known values. I can't imagine a well-behaving compiler that wouldn't correctly build the test programs just with a call to ${CC} and no explicit flags.

It's a double edged sword depending on what you're trying to test..

User options specified - great for users because they know it's more likely to build if the options matched. Hard for maintainers though to debug.

User options omitted - great for maintainers because the failure "surface area" is lower, but it'll likely end up with support questions when a user specified "unexpected" compile-time flags.

lib/atf/libatf-c/Makefile
33 ↗(On Diff #19807)

I can't inline the values below as I would be assigning a non-immediate (expanded) value to a non-immediate value, but I can definitely add a prefix.

ngie marked 2 inline comments as done.Aug 30 2016, 2:00 AM
This revision was automatically updated to reflect the committed changes.