dotnet / reproducible-builds

Contains the DotNet.ReproducibleBuilds package
MIT License
183 stars 18 forks source link

ContinuousIntegrationBuild detection will trigger env var BuildCheck #51

Open MattKotsenas opened 1 month ago

MattKotsenas commented 1 month ago

The upcoming BuildCheck to flag env var usage trigger on our ContinuousIntegrationBuild detection logic: https://github.com/dotnet/reproducible-builds/blob/94faeb18d35e5bb0a94b09833d179c19151162f9/src/DotNet.ReproducibleBuilds/DotNet.ReproducibleBuilds.props#L15-L38

It feels like we should have an opinion on what the correct fix is here. The two main options I see are:

  1. Recommend that people that use the BuildCheck not rely on the detection and instead pass /p:ContinuousIntegrationBuild=true directly when in CI
  2. Allowlist these variables in some fashion. For that to work smoothly, we likely need to package an analyzerconfig with the values. It's also unclear if BuildChecks currently support packaged analyzerconfig files
MattKotsenas commented 1 month ago

@baronfel, is there anywhere this is currently under discussion? I'm fine with either solution really, I think the main ask is to have a good doc of the rationale and suggested fixes.

baronfel commented 1 month ago

Not currently - I just poked Rainer and Jared about this concept of package-provided configuration though. I think this might be a gap for buildchecks for .NET 9 GA compared to how Roslyn can discover editorconfig configs shipped in packages.

I hope where we end up is that this package could provide some customizations for buildchecks in the package and register those somehow in props, then have MSBuild handle things from there.