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

Clarify the relationship between the two packages, and general usage #15

Open
roji opened this issue Feb 23, 2022 · 4 comments
Open

Clarify the relationship between the two packages, and general usage #15

roji opened this issue Feb 23, 2022 · 4 comments

Comments

@roji
Copy link
Member

roji commented Feb 23, 2022

Reading the README.md, it isn't quite clear whether one should use both DotNet.ReproducibleBuilds and DotNet.ReproducibleBuilds.Isolated, or only one of them. What exactly each one of these packages does is also a bit vague, i.e. what exactly do I opt into for each one.

One last note: for DotNet.ReproducibleBuilds.Isolated, the usage says to include an <Sdk ... /> element in the csproj or Directory.Builds.props. A more complete sample would be useful here, since Sdk elements aren't something that's typically used, so it may not be immediately clear where to place them (inside an ? outside?).

@cmeeren
Copy link

cmeeren commented Aug 18, 2022

Can someone explain how to use the <Sdk> element in the Directory.Build.props? I can't find any information about where to add this line from the readme:

<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="{TBD}" />

If I add it as a child of <Project>, I just get this error when building the solution:

  MSBuild version 17.3.0+92e077650 for .NET
MSBUILD : error MSB1004: Specify the name of the target.
    Full command line: 'C:\Program Files\dotnet\sdk\6.0.400\MSBuild.dll /noconsolelogger /property:Configuration=Release /property:Platform=Any CPU /t: /logger:C:\<snip>\JetBrains.Platform.MsBuildEventLogger.dll;64863 /m:30 /fileLogger1 /fileloggerparameters1:LogFile=C:\<snip>\JetBrainsLog.ReSharperBuild_2022_08_18_20_13_51_6817.log; /fileLoggerParameters1:Verbosity=Normal C:\<snip>\MySolution.sln'
  Switches appended by response files:
Switch: /t:
For switch syntax, type "MSBuild -help"

@baronfel
Copy link
Member

Hey folks!

There are some docs on how to reference SDKs in general on the MSBuild Docs site: https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022

So I'd expect to see a project file or Directory.Build.props like:

<Project>
  <Sdk Name="Dotnet.ReproducibleBuilds.Isolated" Version="111" />
</Project>

@cmeeren for the specific build error, do you have a sample I can try to repro with locally?

Finally, I don't see anything in the props/targets files for the two packages that would prevent their use together. I'd need to dig deeper to be sure, though.

@cmeeren
Copy link

cmeeren commented Aug 19, 2022

@baronfel You're right, my error was caused by Rider unloading the projects (without my noticing) when I made an erroneous change to Directory.Build.props, and there were then no projects to actually build.

It works with

<Project>

  <Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.1.1" />

  ...

@hcoona
Copy link

hcoona commented Sep 27, 2022

Checked the source code. I think

So we should use both of them together.

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

No branches or pull requests

4 participants