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

Flow 0.143.0 fails to start on Windows 10 #8574

Closed
CrOrc opened this issue Jan 21, 2021 · 2 comments
Closed

Flow 0.143.0 fails to start on Windows 10 #8574

CrOrc opened this issue Jan 21, 2021 · 2 comments

Comments

@CrOrc
Copy link

CrOrc commented Jan 21, 2021

Flow version: 0.143.0

Expected behavior

On windows 10 flow should start and report errors

Actual behavior

Flow fails to start with exit code 3221225781 and no messages at all.

@mroch
Copy link
Contributor

mroch commented Jan 21, 2021

ouch, sorry about this. 0.143 contains a new dependency on C++, which is likely the culprit here.

to help me debug, can you see if installing the C++ runtime from Microsoft fixes the issue? https://aka.ms/vs/16/release/vc_redist.x64.exe

@mroch
Copy link
Contributor

mroch commented Jan 21, 2021

never mind, it doesn't help.

facebook-github-bot pushed a commit that referenced this issue Jan 22, 2021
Summary:
The Windows binary we distribute is compiled with mingw64. The addition of C++ code in v0.143.0 caused us to start dynamically linking `libstdc++-6.dll`. this requires users to have mingw64 installed (not acceptable), or for us to package that DLL next to `flow.exe`. That's possible in theory but I couldn't get it to work correctly, and it's nice for the binary to be self-contained.

So we statically link `libstdc++` and `pthread` instead. The linker on Windows, `flexlink` from [flexdll](https://github.com/alainfrisch/flexdll), doesn't support `-static` or `-static-libstdc++` and [prefers](https://github.com/alainfrisch/flexdll/blob/1ba65c105ecf9976a663d67170b746cf3e679aa5/reloc.ml#L258-L268) the `.dll.a` dynamic interface over the `.a` static one, so I'm taking advantage of/abusing its search algorithm to resolve to `libstdc++-6.a` before `libstdc++-6.dll.a` by passing `-lstdc++.a` instead of `-lstdc++`.

Fixes #8574

Pull Request resolved: #8578

Reviewed By: dsainati1

Differential Revision: D26018528 (29a8ab8)

Pulled By: mroch

fbshipit-source-id: 6ff224b323811b12474f9d49c4628a44a3a80721
noppa pushed a commit to noppa/flow that referenced this issue Feb 21, 2021
Summary:
The Windows binary we distribute is compiled with mingw64. The addition of C++ code in v0.143.0 caused us to start dynamically linking `libstdc++-6.dll`. this requires users to have mingw64 installed (not acceptable), or for us to package that DLL next to `flow.exe`. That's possible in theory but I couldn't get it to work correctly, and it's nice for the binary to be self-contained.

So we statically link `libstdc++` and `pthread` instead. The linker on Windows, `flexlink` from [flexdll](https://github.com/alainfrisch/flexdll), doesn't support `-static` or `-static-libstdc++` and [prefers](https://github.com/alainfrisch/flexdll/blob/1ba65c105ecf9976a663d67170b746cf3e679aa5/reloc.ml#L258-L268) the `.dll.a` dynamic interface over the `.a` static one, so I'm taking advantage of/abusing its search algorithm to resolve to `libstdc++-6.a` before `libstdc++-6.dll.a` by passing `-lstdc++.a` instead of `-lstdc++`.

Fixes facebook#8574

Pull Request resolved: facebook#8578

Reviewed By: dsainati1

Differential Revision: D26018528

Pulled By: mroch

fbshipit-source-id: bf43c1452056a0d045c9b7a09feb2804efac12f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants