Page MenuHomeFreeBSD

Filter certain compile-time options into -DATF_BUILD_*
ClosedPublic

Authored by ngie on Aug 30 2016, 1:08 AM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.