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

Handle long paths #36

Closed
wants to merge 1 commit into from
Closed

Handle long paths #36

wants to merge 1 commit into from

Conversation

johnterickson
Copy link
Collaborator

No description provided.

@johnterickson johnterickson requested a review from dfederm January 19, 2024 00:10
@@ -25,6 +25,7 @@
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.MSBuildCache.Common.Tests" />
<InternalsVisibleTo Include="Microsoft.MSBuildCache.AzurePipelines" />
Copy link
Member

Choose a reason for hiding this comment

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

This should be avoided. Our plugin impls should not be "special" in any way.

Just make whatever you need public instead.

@@ -230,8 +230,8 @@ internal sealed class PipelineCachingCacheClient : CacheClient
// 3. map all the relative paths to the temp files
foreach (KeyValuePair<AbsolutePath, ContentHash> output in outputs)
{
string relativePath = output.Key.Path.Replace(RepoRoot.Path, "", StringComparison.OrdinalIgnoreCase);
extras.Add(relativePath.Replace("\\", "/", StringComparison.Ordinal), new FileInfo(tempFilesPerHash[output.Value].Path));
RelativePath relativePath = output.Key.MakePathRelativeTo(RepoRoot)!;
Copy link
Member

Choose a reason for hiding this comment

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

There seem to be a ton of type conversions here.

output.Key starts as a AbsolutePath, then in MakePathRelativeTo gets converted to a string then back to a RelativePath on return, then immediately it's converted back to a string.

Can we just use strings everywhere?

Copy link
Member

Choose a reason for hiding this comment

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

It looks like the input being an AbsolutePath is what's adding this long path prefix in the first place. So it's being added just to remove it again!

I'll just fix it as part of #35.

@dfederm dfederm deleted the dev/jerick/longPaths branch March 7, 2024 19:57
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.

2 participants