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

Can't use a native library from the user's PATH with Fake 5.14+ #2342

Closed
BillHally opened this issue Jun 25, 2019 · 4 comments
Closed

Can't use a native library from the user's PATH with Fake 5.14+ #2342

BillHally opened this issue Jun 25, 2019 · 4 comments
Labels

Comments

@BillHally
Copy link
Contributor

BillHally commented Jun 25, 2019

Description

Can't use a native library from the user's PATH with Fake 5.14+.

Repro steps

  1. Use functionality (whether from a Nuget package or written directly into a script) which relies on a native library being in the PATH environment variable rather than a Nuget package. For example:
#load ".fake/build.fsx/intellisense.fsx"

open Fake.Core

open System.Runtime.InteropServices

module Imports =
    [<DllImport("kernel32.dll")>]
    extern uint32 GetCurrentProcessId()

Target.create "Build" (fun _ ->
  printfn "Current process: %d" (Imports.GetCurrentProcessId())
)

Target.runOrDefault "Build"

There's a small repository demonstrating the issue at https://github.com/BillHally/FakeNativeLibraryIssue.

Expected behavior

Functionality works

Actual behavior

An exception is raised. For example:

Build      00:00:00.0056542   (Could not resolve native library 'kernel32.dll'.                                                                                                                                                                                                                                                                                            No native libraries found!

This can happen for various reasons:
- The nuget cache (or packages folder) might be broken.
  -> Please save your state, open an issue and then
  - delete the source package of 'kernel32.dll' from the '~/.nuget' cache (and the 'packages' folder)
  - delete 'paket-files/paket.restore.cached' if it exists
  - delete '<script.fsx>.lock' if it exists
  - try running fake again
  - the package should be downloaded again

-> If the above doesn't apply or you need help please open an issue!)

Known workarounds

Use Fake v 5.13.7

Related information

  • Operating system - Windows 10
  • Version of FAKE - > 5.14
@matthid
Copy link
Member

matthid commented Jun 25, 2019

Ah indeed, didn't realize that FAKE already supported this. Shouldn't be too hard to add this. Question is if we can properly detect this case and report the above error otherwise.

@matthid matthid added the bug label Jun 25, 2019
@matthid
Copy link
Member

matthid commented Jun 25, 2019

Thanks for reporting this.

@matthid
Copy link
Member

matthid commented Jun 30, 2019

This should be solved with the next release.

@BillHally
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants