Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

[Bug] [Windows] Xamarin.Build.Download Fix Max Path Length Extraction #1296

Merged
merged 4 commits into from
Dec 13, 2021

Conversation

dmariogatto
Copy link
Contributor

Fix for issue #1295.

Simplified AppendQuoted, now no longer tries to escape \ or " and just wraps the text argument in double quotes (this I also believe is the same behaviour of QuotedArgument in Cake).

As mentioned in the above issue this was found when testing NuGets built from xamarin/GoogleApisForiOSComponents#501 and is a blocking issue as it prevents building in VS for Windows.

New test case added TestPathGreaterThan260Chars.

Test have been validated on,

  • Windows 10 21H1
  • macOS 12.0.1

if (Platform.IsWindows)
psi = new ProcessStartInfo (args.ProcessPath, args.ToString ())
{
WorkingDirectory = null,
Copy link
Member

Choose a reason for hiding this comment

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

could you provide link to docs for this trick, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting to null will default to System32 as the working directory, see here. This should be fine as no user/pass is specified & all the paths for the process and extraction are absolute. If we set it to contentDir it'll fail for paths over 260 chars.

@moljac
Copy link
Member

moljac commented Nov 1, 2021

possibly related

#1293

at least merge together

@moljac moljac self-assigned this Nov 1, 2021
@dmariogatto dmariogatto changed the title [Bug] [Windows] Xamarin.Download.Build Fix Max Path Length Extraction [Bug] [Windows] Xamarin.Build.Download Fix Max Path Length Extraction Nov 1, 2021
Copy link
Member

@moljac moljac left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants