Skip to content

RustBackendLoader: "Can't find dependent libraries" - libgcc_s_seh-1.dll #46

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

Open
david-allison opened this issue Mar 27, 2021 · 8 comments · Fixed by #47
Open

RustBackendLoader: "Can't find dependent libraries" - libgcc_s_seh-1.dll #46

david-allison opened this issue Mar 27, 2021 · 8 comments · Fixed by #47
Labels
bug Something isn't working

Comments

@david-allison
Copy link
Member

david-allison commented Mar 27, 2021

Currently the dll to test Anki-Android-Backend under robolectric on Windows links to libgcc_s_seh-1.dll

This means that developers must install GCC to unit test Anki-Android.


ankidroid/Anki-Android#8345 (comment)

The error I am getting
image

@david-allison
Copy link
Member Author

david-allison commented Mar 27, 2021

Trimmed dumpbin output

C:\Users\David\Downloads>dumpbin /dependents rsdroid1625960893423553494.dll
Dump of file rsdroid1625960893423553494.dll

File Type: DLL

  Image has the following dependencies:

    ole32.dll
    SHELL32.dll
    ADVAPI32.dll
    libgcc_s_seh-1.dll
    KERNEL32.dll
    msvcrt.dll
    USERENV.dll
    WS2_32.dll
C:\Users\David\Downloads>

@david-allison
Copy link
Member Author

User comment:

I checked my temp directory it doesn't exist.

david-allison added a commit that referenced this issue Mar 27, 2021
We had a crash which may have been caused by %TEMP% being cleared
at the wrong time.

We add a more viable exception if this is the case to see if we can
track down the problem

Fixes #46
david-allison added a commit that referenced this issue Mar 27, 2021
Knowing the OS will be useful in diagnosing bugs

Fixes #46
david-allison added a commit that referenced this issue Mar 27, 2021
We had a crash which may have been caused by %TEMP% being cleared
at the wrong time.

We add a more viable exception if this is the case to see if we can
track down the problem

Fixes #46
david-allison added a commit that referenced this issue Mar 27, 2021
Knowing the OS will be useful in diagnosing bugs

Fixes #46
@david-allison david-allison reopened this Apr 5, 2021
@david-allison david-allison changed the title RustBackendLoader: "Can't find dependent libraries" RustBackendLoader: "Can't find dependent libraries" - libgcc_s_seh-1.dll Apr 5, 2021
@david-allison
Copy link
Member Author

For testing:

david@Auxiliary:/mnt/c/Users/David/Downloads/Anki/rsd$ objdump --private-headers rsdroid1625960893423553494.dll  | grep "DLL Name:"
        DLL Name: ole32.dll
        DLL Name: SHELL32.dll
        DLL Name: ADVAPI32.dll
        DLL Name: libgcc_s_seh-1.dll
        DLL Name: KERNEL32.dll
        DLL Name: msvcrt.dll
        DLL Name: USERENV.dll

@david-allison
Copy link
Member Author

Was suggested to try -Ctarget-feature=+crt-static

@david-allison
Copy link
Member Author

david-allison added a commit that referenced this issue Apr 5, 2021
A user using robolectric for windows will need to have GCC installed

This isn't ideal, but I wasn't able to find the correct linker
documentation to disable this behavior

Related: #46
@Starkly
Copy link

Starkly commented Jun 26, 2021

Just to note, libgcc_s_seh-1.dll has a dependency on libwinpthread-1.dll

if both are in your PATH, then the library will load and the tests should run ok, without installing all of gcc

@mikehardy
Copy link
Member

Hey, I reproduce this now! Reproduction is half the battle. I hadn't tried to run it on windows yet but .\gradlew.bat jacocoUnitTestReport on a clean windows checkout did show this error for me

At some point I can play around with this at the same time as I attempt work on ankidroid/Anki-Android#10538 (comment)

@mikehardy
Copy link
Member

Everyone should use a package manager, and on windows I use chocolatey, install it like so https://chocolatey.org/install#install-step2

Then:

choco install mingw

And now the DLLs should be on PATH after a shell restart, you can investigate in a new powershell with this:

($env:Path).split(';')

...and you should see this:

C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin

Still want to investigate bundling those dlls somehow or doing the static link flag referenced above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants