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

Release 5.14.1 #2334

Merged
merged 4 commits into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 5.14.1 - 2019-06-13

* BUGFIX: Fake 5 native libraries support now works on unix - https://github.com/fsharp/FAKE/pull/2334

## 5.14.0 - 2019-06-12

* BREAKING: Renamed `CliVersion.Lkg` to `CliVersion.Coherent` as it was renamed on the installer. If you use an old installer with this flag you can still use `CliVersion.Version "lkg"` - https://github.com/fsharp/FAKE/pull/2318
Expand Down
20 changes: 10 additions & 10 deletions src/app/Fake.Runtime/CoreCache.fs
Original file line number Diff line number Diff line change
Expand Up @@ -331,30 +331,30 @@ This can happen for various reasons:
tracefn "Redirect assembly load to previously loaded assembly: %A" loadedName
result

let findAndLoadUnmanagedInRuntimeDeps (loadFromPath:string -> nativeint) (unmanagedDllName:string) (logLevel:Trace.VerboseLevel) (nativeLibraries:NativeLibrary list) =
let findUnmanagedInRuntimeDeps (loadFromPath:string -> nativeint) (unmanagedDllName:string) (logLevel:Trace.VerboseLevel) (nativeLibraries:NativeLibrary list) =
if logLevel.PrintVerbose then tracefn "Trying to resolve native library: %s" unmanagedDllName
match nativeLibraries |> Seq.tryFind (fun l ->
let fnExt = Path.GetFileName l.File
let fn = Path.GetFileNameWithoutExtension l.File
unmanagedDllName = fn || unmanagedDllName = fnExt) with
| Some lib ->
let path = lib.File
let ptr = loadFromPath path
if logLevel.PrintVerbose then tracefn "Redirect native library '%s' to known path: %s" unmanagedDllName path
ptr, path
path
| None ->
// will failwithf later anyway.
if logLevel.PrintVerbose then tracefn "Could not resolve native library '%s'!" unmanagedDllName
IntPtr.Zero, null
null

let resolveUnmanagedDependencyCached =
let libCache = System.Collections.Concurrent.ConcurrentDictionary<_,nativeint * string>()
let libCache = System.Collections.Concurrent.ConcurrentDictionary<_,string>()
fun (loadFromPath:string -> nativeint) (unmanagedDllName:string) (logLevel:Trace.VerboseLevel) (nativeLibraries:NativeLibrary list) ->
let mutable wasCalled = false
let ptr, path = libCache.GetOrAdd(unmanagedDllName, (fun _ ->
let path = libCache.GetOrAdd(unmanagedDllName, (fun _ ->
wasCalled <- true
findAndLoadUnmanagedInRuntimeDeps loadFromPath unmanagedDllName logLevel nativeLibraries))
if wasCalled && ptr = IntPtr.Zero then
findUnmanagedInRuntimeDeps loadFromPath unmanagedDllName logLevel nativeLibraries))

if wasCalled && isNull path then
let available =
if nativeLibraries.Length > 0 then
"Available native libraries:\n - " + String.Join("\n - ", nativeLibraries |> Seq.map (fun n -> n.File))
Expand All @@ -372,10 +372,10 @@ This can happen for various reasons:
- the package should be downloaded again

-> If the above doesn't apply or you need help please open an issue!""" unmanagedDllName available unmanagedDllName
if not wasCalled && not (ptr = IntPtr.Zero) then
if not wasCalled && not (isNull path) then
if logLevel.PrintVerbose then
tracefn "Redirect native library '%s' to previous loaded library '%s'" unmanagedDllName path
ptr
loadFromPath path

#if NETSTANDARD1_6
// See https://github.com/dotnet/coreclr/issues/6411
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,4 @@ let tests =
testCase "issue #2007 - native libs work" <| fun _ ->
handleAndFormat <| fun () ->
fakeRunAndCheck "build.fsx" "build.fsx" "i002007-native-libs" |> ignore

]