Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
<!-- Disable source link when building locally. -->
<DisableSourceLink Condition="'$(DisableSourceLink)' == '' and
'$(ContinuousIntegrationBuild)' != 'true' and
'$(DotNetBuildFromSource)' != 'true' and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to explicitly specify this property in the source-build configuration vs a sourcebuild condition here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The benefit is it utilizes the existing mechanism for source-build and reduces the source-build specific checks throughout the code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to explicitly specify this property in the source-build configuration vs a sourcebuild condition here?

Makes sense - moving it there.

'$(OfficialBuildId)' == ''">true</DisableSourceLink>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/runtime-prereqs.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RuntimeVersionFile>$(ArtifactsObjDir)runtime_version.h</RuntimeVersionFile>
<NativeSourceLinkFile>$(ArtifactsObjDir)native.sourcelink.json</NativeSourceLinkFile>
<VerifySourceLinkFileExists>false</VerifySourceLinkFileExists>
<VerifySourceLinkFileExists Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(DotNetBuildFromSource)' != 'true'">true</VerifySourceLinkFileExists>
<VerifySourceLinkFileExists Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</VerifySourceLinkFileExists>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for mitigating risk, I'd remove changes here. It only applies to windows (native sourcelink).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is applicable to Linux as well - NativeSourceLinkFile points to a file that exists in Linux build, so we should check for file existence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will never use it though. It's only passed to MSVC here

if(EXISTS ${CLR_SOURCELINK_FILE_PATH})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will never use it though. It's only passed to MSVC here

if(EXISTS ${CLR_SOURCELINK_FILE_PATH})

Interesting. I might be missing when the file gets generated, but it did get created on Linux and had the following content. Should the file even be created on Linux?

{"documents":{"/src/source.online/src/runtime/artifacts/source-build/self/src/*":"https://raw.githubusercontent.com/nikolamilosavljevic/runtime/056cf9bd4c52f7bb8fff74bc47d9c6d2562c3e9c/*"}}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the file gets created always. It's used by native only on Windows. It gets used for managed projects mostly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Since this is useful for Windows only, it makes sense to remove it on source-build and revert the change I proposed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on this discussion wouldn't it be better to change this to be a windows specific check? e.g. only enabled for windows CI? The point is this really shouldn't be a source-build specific check. I understand however if the desire is to limit changes this late in the release cycle.

<AssemblyName>.NET Runtime</AssemblyName>
</PropertyGroup>

Expand Down