-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
DeterministicSourcePaths can break building if source control information not available #37379
Comments
You can define the repository root by adding the following to the <ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
</ItemGroup> |
tmat, that is strictly speaking true, but other than manually adding a My gripe is that with a property as generically named as "ContinuousIntegrationBuild" (which is likely to grow additional functionality over time, since it is the obvious mechanism for informing the SDK that we are running in a CI server), it really should not be necessary to make any source level changes. My real preference would be to downgrade that error to a warning. (Perhaps only if the developer did not explicitly set DeterministicSourcePaths?) Another reasonable alternative would be to introduce some special MSBuild property that if set would generate a SourceRoot item. It would be easy to configure the CI server set that property to the root of the "workspace" (or whatever it happens to call the equivalent concept). |
@KevinCathcart The problem is that msbuild does not know what the repository root directory is - it does not have a concept of repository. Someone has to determine that. SourceLink is able to do that based on the source control information. As I pointed out above another option is to specify it explicitly in The intention is that |
@jaredpar Please close if you think that is appropriate. |
One problem is that you don't offer these additional settings in a clean way. The only options involve adding or modifying files in the source repository. That is a bad thing. If the build server needs to supply additional information, like the root of the checked out repo, it should be able to do that via MSBuild properties. Otherwise, it means either: one cannot build older revisions deterministically, or you can by having the build server drop in extra files, or modify some file checked into source control. Anybody who cares about deterministic builds would NOT want the build server adding files to the build, or modifying the files in the build. |
adding debugtype as portable to check symbols removing os condition update changelog for removing netstandard 1.x (#1858) since we are using msbuild, we have to set deterministic reverting updating Product.props and removing reference from all projects adding sourceroot based on github issue (dotnet/roslyn#37379) including pdbs in output folder commenting deterministic properties and sourceroot removing cibuild from nugetprops undoing nupkg and sourceroot from directory.build
Adding SourceRoot which is needed for ContinuousIntegrationBuild and Deterministic: dotnet/roslyn#37379 Otherwise wa have this error: Microsoft.Managed.Core.targets(191,5): error : SourceRoot items must include at least one top-level (not nested) item when DeterministicSourcePaths is true
…h SourceLink feature. dotnet/roslyn#37379
Version Used:
dotnet sdk 2.2.300
Steps to Reproduce:
Actual Behavior:
Expected Behavior:
Build Succeeds.
The mere fact that we we are performing a continuous integration build does not mean that source control information will be available to MSBuild. However deterministic builds are enabled by default, and turning on
ContinuousIntegrationBuild
, means thatDeterministicSourcePaths
is enabled.That would be fine if
DeterministicSourcePaths
worked when no source control information was available, but it requiresSourceRoot
items, which are only created by a source control information provider like the Source Link packages.This bit me when I tried to add a new Test project to a solution being built with
/p:ContinuousIntegrationBuild=true
. I did not bother to add a Source Link NuGet package since I was not going to package or publish the test project on the CI server, merely run it, so I don't actually need Source Link data in the pdbs.Obviously I know the workarounds (add the Source Link package or set
DeterministicSourcePaths
to false in the test project).But ideally they would not be needed. Instead ideally, either a)
DeterministicSourcePaths
would only be set if a source control information provider package was installed, or b) thatDeterministicSourcePaths
was somehow made to work even without a source provider package.@tmat I think you are the expert on this stuff, so this is probably your issue.
The text was updated successfully, but these errors were encountered: