Skip to content

Conversation

@mmitche
Copy link
Member

@mmitche mmitche commented Feb 14, 2024

Reverts #14486

@mmitche
Copy link
Member Author

mmitche commented Feb 14, 2024

@tmat There is an interesting regression here. For some reason, after the update to the latest SDK, the LocateRepository task is no longer able to determine the ScmRepositoryUrl of the inner cloned repo in SB. It would have been this change that altered things:

dotnet/sourcelink@f6b97c9...94eaac3

Any ideas what happened here?

@mthalman
Copy link
Member

More info (note the ScmRepositoryUr value diff). What's interesting is that this does work in the VMR.

Arcade Repo: 8.0.101 (working)

Microsoft.Build.Tasks.Git.LocateRepository
    Assembly = /__w/1/s/.dotnet/sdk/8.0.101/Sdks/Microsoft.Build.Tasks.Git/build/../tools/core/Microsoft.Build.Tasks.Git.dll
    Parameters
        NoWarnOnMissingInfo = True
        ConfigurationScope = local
        Path = /__w/1/s/artifacts/source-build/self/src/src/Microsoft.DotNet.Arcade.Sdk
    SourceLink: Reusing cached git repository information.
    OutputProperties
        _GitRepositoryId = /__w/1/s/artifacts/source-build/self/src/.git
        ScmRepositoryUrl = https://github.com/dotnet/arcade
        SourceRevisionId = da98edc4c3ea539f109ea320672136ceb32591a7
    OutputItems
        SourceRoot
            /__w/1/s/artifacts/source-build/self/src/
                SourceControl = git
                RevisionId = da98edc4c3ea539f109ea320672136ceb32591a7
                ScmRepositoryUrl = https://github.com/dotnet/arcade

Arcade Repo: 8.0.102 (not working)

Microsoft.Build.Tasks.Git.LocateRepository
    Assembly = /__w/1/s/.dotnet/sdk/8.0.102/Sdks/Microsoft.Build.Tasks.Git/build/../tools/core/Microsoft.Build.Tasks.Git.dll
    Parameters
        NoWarnOnMissingInfo = True
        ConfigurationScope = local
        Path = /__w/1/s/artifacts/source-build/self/src/src/Microsoft.DotNet.Arcade.Sdk
    SourceLink: Reusing cached git repository information.
    OutputProperties
        _GitRepositoryId = /__w/1/s/artifacts/source-build/self/src/.git
        SourceRevisionId = fc77e80b5bae1a338845de59586a833a7785ce33
    OutputItems
        SourceRoot
            /__w/1/s/artifacts/source-build/self/src/
                SourceControl = git
                RevisionId = fc77e80b5bae1a338845de59586a833a7785ce33
                ScmRepositoryUrl = 

VMR: 8.0.102 (working)

Microsoft.Build.Tasks.Git.LocateRepository
    Assembly = /vmr/.dotnet/sdk/8.0.102/Sdks/Microsoft.Build.Tasks.Git/build/../tools/core/Microsoft.Build.Tasks.Git.dll
    Parameters
        NoWarnOnMissingInfo = True
        ConfigurationScope = local
        Path = /vmr/src/arcade/artifacts/source-build/self/src/src/Microsoft.DotNet.Arcade.Sdk
    SourceLink: Reusing cached git repository information.
    OutputProperties
        _GitRepositoryId = /vmr/.git
        ScmRepositoryUrl = https://github.com/dotnet/dotnet
    OutputItems
        SourceRoot
            /vmr/
                SourceControl = git
                RevisionId = 99f3307aa690137283696958d89dd0196a8ec048
                ScmRepositoryUrl = https://github.com/dotnet/dotnet

@mmitche
Copy link
Member Author

mmitche commented Feb 14, 2024

The VMR in 8.0.* copies rather than clones, IIRC

@mthalman
Copy link
Member

@tmat - Can you investigate what might be the issue here? See #14487 (comment)

@mmitche
Copy link
Member Author

mmitche commented Feb 22, 2024

Also seeing this in main now. @tmat Looks to be out right now. I'm inclined to put in a workaround so that we can get unblocked. Will look into it.

@mmitche
Copy link
Member Author

mmitche commented Feb 22, 2024

I didn't get a chance to fix this, but the issue appears to be that the inner clone doesn't end up with a remote that matches the outer clone's URI. It appears that the sourcelink targets look for origin and then upstream. I think it probably has the correct behavior? Perhaps before, if there was no remote URI for inner clone, it kept looking up the directory structure.

Two possible solutions include:

  • Alter the inner clone so that it sets the remotes equal to the outer clones
  • Alter the source build inner invocation to pass through the azdo specific variables (BUILD_SOURCE_URI I think) if they exist.

I think the first option one is better.

@mmitche mmitche closed this Mar 13, 2024
@MichaelSimons MichaelSimons deleted the revert-14486-revert-14480-mmitche-patch-5 branch August 28, 2025 13:19
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

Successfully merging this pull request may close these issues.

4 participants