Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Deterministic builds in .NET8 #10710

Open
dejvis opened this issue Sep 27, 2024 · 2 comments
Open

[Bug]: Deterministic builds in .NET8 #10710

dejvis opened this issue Sep 27, 2024 · 2 comments
Labels

Comments

@dejvis
Copy link

dejvis commented Sep 27, 2024

Issue Description

Hello
We have an issue with the deterministic build in .NET8.

We have a large project with many referenced libraries.

For simplification, lets have lib2 which is referenced by lib1.
For deployment reasons, if lib2 changes, we need lib1 to remain unchanged.

The current behavior in .NET8 is that if lib2 changes, lib1 changes as well.

For deployment build we use msbuild.

Is this a bug or an intended solution? Is there a solution to our requirements?

Steps to Reproduce

TestDeterministicBuildCoreConsole.zip

Expected Behavior

If lib2 changes, we need lib1 to remain unchanged.

Actual Behavior

If lib2 changes, lib1 changes as well.

Analysis

No response

Versions & Configurations

No response

@dejvis dejvis added the bug label Sep 27, 2024
@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Sep 27, 2024

I believe this can be done by using a reference assembly. So that if the implementation of lib2 changes, the reference assembly of lib2 stays the same anyway, and the compilation of lib1 sees only the reference assembly and considers lib2 unchanged.

I'm not sure if you can generate the reference assembly automatically as part of the lib2 build. There is an MSBuild property for that but IIRC it copies all assembly attributes so if you're putting Git commit info in those attributes then the reference assembly will change. Another option is to maintain the reference assembly as separate source code and use ApiCompat tools to verify that the implementation is compatible with that.

@dejvis
Copy link
Author

dejvis commented Sep 27, 2024

If you mean this section in VS , than it is already turned on and still build generates different binaries. I expect msbuild takes this property from the project files.
obrazek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants