Comments (10)
From my reading of the code, it appears that Windows accepts /
or -
, while Unix only accepts -
. Given this, the simplest fix would be to replace /
with -
across the board in all help messages.
from msbuild.
I'd strongly vote for accepting /
in the command line switches, otherwise migrating builds scripts from xbuild (which accepts /
) will be a huge pain.
from msbuild.
@akoeplinger I believe the only thing needed to do for that approach would be to eliminate the #if
block at https://github.com/Microsoft/msbuild/blob/f112881f2ef7647d964a92690e15d8613685e5a1/src/XMakeCommandLine/XMake.cs#L1295-1300
from msbuild.
MSBuild team triage: The change was done for simplicity to be able to determine if the parameter is a path or MSBuild switch, it's definitely more involved than just removing the #if block. We would accept the change if it included unit tests for the different scenarios (files, invalid parameters, etc.). We're also happy for the help text to be updated in the xplat branch either way.
from msbuild.
@AndyGerlicher is the only concern here that MSBuild would mistake a file named e.g. /nologo
as a switch on Linux if we just removed the #if? That wouldn't sound like a compelling reason to me honestly :)
from msbuild.
@akoeplinger It has more to do with what happens when a path (that starts with a slash) is interpreted as a switch, only to determine that it is not valid (that's what would currently happen after the #if block is removed). Additional code needs to be added to check if the "bad" switch is in fact a file path. Your case (when a file path happens to be a valid switch) is less likely and may not be of concern as there is no easy way to handle this anyway.
from msbuild.
@ValMenn ok, thanks for your response. I'll take a look and see if I can come up with something here.
from msbuild.
I opened a PR that allows using / for switches: #91
from msbuild.
@david-mitchell since my PR was merged, I think the primary reason for this issue does no longer apply, so I think this can be closed. Or do you think we should still be recommending -
prefix on Unix?
from msbuild.
@akoeplinger agreed.
from msbuild.
Related Issues (20)
- [Bug]: MSBuild automatically escapes all my strings for me with seemingly no way to have it not do that? HOT 2
- Add help hyperlinks to reported results
- [Bug]: Error MSB4166 shows in about 1% of our builds in the same machine HOT 1
- Serialize build cancellation event to the binlog HOT 1
- Remove code repetition in EventSourceSink.cs
- [Bug]: When Publishing with .sln, MSBuild doesn't use `BaseOutputPath` HOT 1
- Release 17.11
- [Kitten] Fix binskim warnings in msbuild pipeline HOT 3
- [Bug]: Running a specific target which depends on ResolveReferences fails when TargetFrameworks is specified HOT 4
- Visual Studio 2022 17.10 fails to load csproj - error : The "Target" name is reserved, and cannot be used HOT 3
- Is the double-checked locking pattern in BuildManager correct?
- [Bug]: Parsing `-property:Configuration` with Command-line comments HOT 5
- [BuildCkeck] No warning or error message visible when replaying binlog of an analyzed build
- [Feature Request]: Support building the new Visual Studio solution file format (.slnx) HOT 7
- [Bug]: HOT 2
- [Bug]: CustomAnalyzerTest test fails in the CI pipeline HOT 2
- Retarget to .NET 9
- [Bug]: Can't use contained classes of NuGet Package Microsoft.Build when added as GlobalPackageReference in a Directory.Packages.props file HOT 2
- Investigate possible ToolTask hang HOT 1
- [Bug]: Net472 Service Fabric project with .Net 8 project reference broken in latest msbuild HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msbuild.