dotnet / reproducible-builds

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

Does setting ContinuousIntegrationBuild also set Deterministic? #14

Closed AshleighAdams closed 2 years ago

AshleighAdams commented 2 years ago

I'm converting a project over to use this package, and I currently have something akin to:

<PropertyGroup Condition="'$(CI)' != ''">
  <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
  <Deterministic>true</Deterministic>
</PropertyGroup>

I suspect that setting ContinuousIntegrationBuild is going to also set Deterministic?

wapplegate commented 2 years ago

A little late, but it looks like it sets ContinuousIntegrationBuild to true dynamically when running in a CI environment:

https://github.com/dotnet/reproducible-builds/blob/main/src/DotNet.ReproducibleBuilds/DotNet.ReproducibleBuilds.props

You can see the props file includes conditions for multiple CI systems.

AshleighAdams commented 2 years ago

@wapplegate Yeah, I see that, but I can't figure out if Deterministic will also be set to true as a consequence of ContinuousIntegrationBuild being set, or if I need to keep doing that one manually in my projects :(

wapplegate commented 2 years ago

Yeah my bad I read that a little quick. If you remove:

<Deterministic>true</Deterministic>

Does it actually make a difference? I was under the assumption it wasn't required.

dferretti commented 2 years ago

IIRC Deterministic is enabled by default nowadays: original PR way back when: https://github.com/dotnet/sdk/pull/153 current SDK: https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props#L34

from a quick search in the SDK repo I don't think the ContinuousIntegrationBuild property has anything to do with Deterministic

AshleighAdams commented 2 years ago

Looks like that's the answer @dferretti, thanks. Will close this now.