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

Add long path switches to config #3507

Merged

Conversation

ccastanedaucf
Copy link
Contributor

Should be safe now that we're on Dev16.

@ccastanedaucf
Copy link
Contributor Author

@dotnet-bot test Windows_NT Build for CoreCLR please

@ccastanedaucf
Copy link
Contributor Author

@dotnet-bot test OSX10.13 Build for CoreCLR please

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Do we also need this in unit tests . . . somehow? I have a very hazy recollection that they can consume configuration but I don't remember if that is still app.config-compatible post-xunit.

https://github.com/Microsoft/msbuild/blob/master/src/Shared/UnitTests/App.config

@ccastanedaucf
Copy link
Contributor Author

I remember spending a while trying to figure that one out, some unit tests would use the app.config and others (I believe everything under Tasks?) would completely ignore it.

@ccastanedaucf
Copy link
Contributor Author

I'm double checking that one since I'd have a better idea of what's going wrong now vs 5 weeks ago

@ccastanedaucf
Copy link
Contributor Author

Completely figured it out. So .NET Framework tests can't use the two App.config switches since the tests run on 4.6.1, and .NET Core tests will already have them enabled by default. Remember the switches are so we can target 4.6.1 but still use the new long path behavior when running on > 4.6.2.

What makes it seem like App.config is being read: a bunch of tests on .NET Framework fail since they expect a PathTooLong exception that doesn't get thrown. But since most of the path-related calls on Windows net46 use native calls, it behaves as if the switches were set for many tests.

Which also means... if the remaining managed path-related calls went through FileUtilities, FileSystems, ect. where the conditional switches for native/managed calls are, long paths would actually work even when running on 4.6.1. And at that point the app.config switches wouldn't even be necessary. Would also make running tests with long paths enabled on 4.6.1 really easy since the behavior would be uniform, and not a mix of things that throw and don't throw LongPathException. But that's a whole other issue.

@hickford
Copy link
Contributor

hickford commented Apr 5, 2024

@rainersigwald So MSBuild 16.0 and later (Visual Studio 2019 and later) can handle long paths? Is this documented anywhere?

Aha https://github.com/dotnet/msbuild/releases/tag/v16.0.461.62831

MSBuild.exe now supports long paths on Windows

This pull request was closed.
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