FileOnQ / Imaging.Heif

A C#/.NET wrapper around libheif for decoding and processing high efficiency image formats (heif, heic).
GNU Lesser General Public License v3.0
15 stars 4 forks source link

Add Deterministic DLLs for NuGet #80

Closed SkyeHoefling closed 2 years ago

SkyeHoefling commented 2 years ago

Description

The DLLs generated are not marked as deterministic when viewing in the NuGet Package Explorer. We need to update the build so they are deterministic.

https://nuget.info/packages/FileOnQ.Imaging.Heif/1.0.0

image

SkyeHoefling commented 2 years ago

I spent a few hours looking into this and it doesn't make complete sense to me. As far as I can tell our builds are being compiled as deterministic builds. In both build.main.yml and build_pr.yml we use the compiler switch /p:ContinuousIntegrationBuild=true which is supposed to compile it as deterministic.

https://github.com/FileOnQ/Imaging.Heif/blob/63fba20e2f3fd585bbdcc6b2c14271f050ec3940/.github/workflows/build_main.yml#L51-L53

I ran a clean build from my local environment and then performed the dotnet pack just as GitHub Actions are and I could get the build to be deterministic. Another weird thing I found was the -dev builds on NuGet are all deterministic, it appears just the final release one is not.

@mitchelsellers do you have any ideas what could be going on here?

mitchelsellers commented 2 years ago

I spent some time looking at this myself and I'm not 100% sure what the root of the issue might be, as you are correct, in theory it should be fine using the commands that are listed in the build, a few observations

Not sure how much help this is at the moment but that's what I see different from other projects that I have working properly.

SkyeHoefling commented 2 years ago

This is great feedback, I saw the technique of adding a special <PropertyGroup> to turn deterministic building on. I think that is going to be best for us to add something like this

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
    <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup> 

With that added, we will be able to remove the manual switches in our dotnet cli commands