-
Notifications
You must be signed in to change notification settings - Fork 586
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
2186: Look for Paket executable without ".exe" extension on non-Windows platforms. #2191
2186: Look for Paket executable without ".exe" extension on non-Windows platforms. #2191
Conversation
src/app/Fake.DotNet.Paket/Paket.fs
Outdated
if Environment.isWindows then | ||
windowsName | ||
else | ||
if !! ("./**/" @@ unixName) |> Seq.isEmpty |> not then |
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.
if we already search for it why not use that result but search again?
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.
True, I was just thinking that it needs to fall back to mono if Paket is full framework. Then it needs to search for paket.exe. I can try to avoid double search before the merge.
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.
We might need to introduce a tryFindToolFolderInSubPath
and call that first and retry with the .exe
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 thought about that. I can try that out instead, but what should the fallback be if it can't find any of them?
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'd problably use try*
for the first and the other overload for the second call (ie. just use the default paket.exe
as we do now)
Thanks for adding support for this scenario! |
fallback to the original search for 'paket.exe'.
Not sure if using |
Yes that is ok.
Yes we probably should add some tests to this module or at least for the "new" use-case |
I guess the try-with can be removed if we keep Path.GetDirectoryName. But I'm just wondering if there was a reason FileInfo.Directory was used originally. Where should a test file be created. And should it be called PaketSpecs.fs? |
@atlemann You could for example copy https://github.com/fsharp/FAKE/blob/release/next/src/test/Fake.Core.UnitTests/Fake.DotNet.Cli.fs rename and edit accordingly and add it to either https://github.com/fsharp/FAKE/blob/release/next/src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj or the integration test project. You should be able to either run the test via command line (I usually use is that the info you wanted?
Personally I'm always very nervous when I see |
Added tests for Fake.IO.Globbing.Tools
Directory.CreateDirectory folder |> ignore | ||
folder | ||
|
||
testSequencedGroup "Find tool paths" <| |
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.
Any reason why that needs to be sequenced (not that I think it would matter)?
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.
Because they would conflict when run in parallel due to this search pattern in the impl. !! ("./**/" @@ toolname)
. Maybe there's a better way to do the tests?
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.
Ops, forgot to remove Focused flag
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.
Because they would conflict when run in parallel due to this search pattern in the impl.
!! ("./**/" @@ toolname)
. Maybe there's a better way to do the tests?
Ah, because you find other results... Yes the "ultimate" solution would be to somehow mock "Environment.CurrentDirectory" but it's fine as it is. Can you add that fact as comment for future reader? Something like // sequenced because otherwise folders conflict with '!! "./**"'
Thanks a lot for taking care of this! Will be part of the next release (will merge once green) |
No problem! You guys are doing all the hard work. |
Looking for a file called
paket
without.exe
extension on non-windows platforms before falling back topaket.exe
. This is to support Paket bootstrapped in .NET Core "mode".Fixes #2186
I could not find any tests for this module.