-
Notifications
You must be signed in to change notification settings - Fork 585
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
fix msbuild being used on mono < 5.0.0.0 instead of xbuild #1540
Conversation
src/app/FakeLib/MSBuildHelper.fs
Outdated
which "msbuild" | ||
which "xbuild" | ||
] | ||
defaultArg (unixSources |> List.choose id |> List.tryHead) "xbuild" | ||
else | ||
defaultArg (sources |> List.choose id |> List.tryHead) "xbuild" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use msbuild
here?
src/app/FakeLib/MSBuildHelper.fs
Outdated
let unixSources = [ | ||
environVarDir |> Option.map (exactPathOrBinaryOnPath "msbuild") | ||
match isUnix, EnvironmentHelper.monoVersion with | ||
| true, Some(_, Some(version)) when version > monoVersionToUseMSBuildOn -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe even >=
but I don't think it matters
src/app/FakeLib/MSBuildHelper.fs
Outdated
{ projectParams with | ||
Targets = targets |> split ';' |> List.filter ((<>) "") | ||
Properties = projectParams.Properties @ properties project | ||
MaxCpuCount = Some ( Some (EnvironmentHelper.getMachineEnvironment().ProcessorCount)) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its ok. But doesn't msbuild
figure this out when no argument is given?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the FAKE build itself, which uses MSBuildWithDefaults
doesn't build with multiple cores because the CPU Count isn't provided on this very flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact, none of the MSBuildXXXX
helpers set the core count, so they fall prey to this. The only way to get around it is to use raw build setParams
yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it up to you :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :)
@matthid good catches on both counts, thanks! |
That's fair. I've removed the CPU change. |
https://travis-ci.org/fsharp/FAKE/builds/227224324#L6135 Good that we can get away from mono soon :) |
thanks for fixing this. |
LGTM |
Fixes #1539 by having the msbuild detection logic learn about mono versions.
For all branches we added the ability for the MSBuild environment variable to specify just a tool, which would then be searched for on the current PATH.
For mono >= 5.0.0.0 we default to msbuild on all path lookups, etc
For mono < 5.0.0.0 we default to xbuild for all similar lookups.
In addition I thought it would be a good chance to make the default msbuild functions pass through the number of cores on the machine in order to trigger parallel msbuild behavior.