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

Please provide Windows binaries #6

Closed
StoneCypher opened this Issue Nov 18, 2014 · 252 comments

Comments

Projects
None yet
@StoneCypher
Copy link

StoneCypher commented Nov 18, 2014

There's a whole lot of Windows developers out there who would love to use this too, and who will contribute based on it.

@prabirshrestha

This comment has been minimized.

Copy link

prabirshrestha commented Nov 18, 2014

+1

2 similar comments
@m90

This comment has been minimized.

Copy link
Contributor

m90 commented Nov 18, 2014

+1

@Bartvds

This comment has been minimized.

Copy link

Bartvds commented Nov 18, 2014

+1

@insin

This comment has been minimized.

Copy link

insin commented Nov 18, 2014

Has anyone tried building on Cygwin in the meantime? Looks like OCaml supports it:

https://ocaml.org/docs/install.html#Windows

Edit:

hack/heap/hh_shared.c:96:25: fatal error: sys/syscall.h: No such file or directory

If I delete the include and the syscall, I'm stumped because I'm on 32-bit Windows and integers overflow all over the place.

@StoneCypher

This comment has been minimized.

Copy link
Author

StoneCypher commented Nov 18, 2014

Looks like OCPWin might be the way to go. Looking into it.

@henriknorberg

This comment has been minimized.

Copy link

henriknorberg commented Nov 18, 2014

+1

2 similar comments
@stephen-gobin

This comment has been minimized.

Copy link

stephen-gobin commented Nov 18, 2014

+1

@totty90

This comment has been minimized.

Copy link

totty90 commented Nov 18, 2014

+1

@lefessan

This comment has been minimized.

Copy link

lefessan commented Nov 18, 2014

There is actually no issue at all with compiling the OCaml part of "flow" on Windows. The following file (copied in build.ocp at the root of the project) will work ASAP on Windows using OcpWin (after ocp-build init and ocp-build build):

begin program "flow"
    cclib = [ "-lelf" ] (* comment this line under Windows *)
    requires = [ "unix" "str" ]
  files = [
(* comment these C files under Windows to compile only the OCaml part *)
    "src/embedded/flowlib_elf.c"
      "hack/heap/hh_shared.c"
      "hack/utils/realpath.c"
      "hack/inotify/inotify_stubs.c"
      "hack/utils/nproc.c"
      "hack/hhi/hhi_elf.c"
      "hack/utils/get_build_id.gen.c" (* This file should have been generated first, for example under Linux *)
      "hack/utils/get_build_id.c"

      "hack/avl/monoidAvl.ml" "hack/client/clientExceptions.ml"
      "hack/utils/path.ml" "hack/client/clientLogCommand.ml"
      "src/server/sysConfig.ml" "hack/utils/tmp.ml"
      "hack/socket/socket.ml" "hack/utils/ident.ml"
      "hack/utils/sys_utils.ml" "hack/utils/utils.ml"
      "hack/utils/lock.ml" "hack/client/clientUtils.ml"
      "hack/utils/pidLog.ml" "hack/client/clientStop.ml"
      "hack/utils/build_id.ml" "hack/utils/hh_json.ml"
      "hack/utils/relative_path.ml" "hack/utils/pos.ml"
      "hack/utils/errors.ml" "hack/server/serverMsg.ml"
      "hack/client/hackClientStop.ml" "hack/utils/shell.ml"
      "hack/client/clientStart.ml" "hack/stubs/eventLogger.ml"
      "hack/utils/tty.ml" "hack/client/clientBuild.ml"
      "hack/client/clientEnv.ml" "hack/client/clientProlog.ml"
      "hack/client/clientStatus.ml" "hack/client/clientCommand.ml"
      "hack/utils/config_file.ml" "hack/utils/wwwroot.ml"
      "hack/client/clientArgs.ml" "hack/deps/fileInfo.ml"
      "hack/deps/typing_graph.ml" "hack/deps/typing_deps.ml"
      "hack/heap/prefix.ml" "hack/heap/value.ml"
      "hack/heap/sharedMem.ml" "hack/naming/naming_special_names.ml"
      "hack/parsing/namespace_env.ml" "hack/parsing/ast.ml"
      "hack/naming/nast.ml" "hack/typing/typing_reason.ml"
      "hack/typing/typing_defs.ml" "hack/typing/typing_env.ml"
      "hack/typing/typing_hooks.ml" "hack/typing/typing_print.ml"
      "hack/server/argumentInfoService.ml"
      "hack/client/clientArgumentInfo.ml"
      "hack/globals/autocomplete.ml" "hack/globals/find_refs.ml"
      "hack/globals/ide.ml" "hack/naming/naming_ast_helpers.ml"
      "hack/naming/naming_hooks.ml" "hack/parsing/namespaces.ml"
      "hack/naming/naming.ml" "hack/naming/naming_heap.ml"
      "hack/naming/nastVisitor.ml" "hack/typing/typeVisitor.ml"
      "hack/typing/typing_exts.ml" "hack/typing/typing_hint.ml"
      "hack/typing/typing_utils.ml"
      "hack/typing/typing_instantiate.ml" "hack/typing/typing_tdef.ml"
      "hack/typing/nastCheck.ml" "hack/typing/nast_terminality.ml"
      "hack/typing/typing_expand.ml"
      "hack/typing/typing_unification_env.ml"
      "hack/typing/typing_unify.ml" "hack/typing/typing_subtype.ml"
      "hack/typing/typing_ops.ml" "hack/typing/typing_suggest.ml"
      "hack/typing/nastInitCheck.ml"
      "hack/typing/typingEqualityCheck.ml"
      "hack/typing/typing_alias.ml" "hack/typing/typing_async.ml"
      "hack/typing/typing_dynamic_yield.ml"
      "hack/typing/typing_enum.ml" "hack/typing/typing_extends.ml"
      "hack/typing/typing_generic.ml" "hack/typing/typing_lenv.ml"
      "hack/typing/typing_variance.ml" "hack/typing/typing.ml"
      "hack/server/autocompleteService.ml"
      "hack/client/clientAutocomplete.ml" "hack/server/serverError.ml"
      "hack/client/clientCheckStatus.ml" "hack/client/colorFile.ml"
      "hack/parsing/parser_heap.ml" "hack/typing/coverage_level.ml"
      "hack/client/clientColorFile.ml" "hack/globals/serverConfig.ml"
      "hack/heap/globalStorage.ml" "hack/parsing/lexer_hack.mll"
      "hack/parsing/parser_hack.ml" "hack/procs/bucket.ml"
      "hack/utils/fork.ml" "hack/utils/printSignal.ml"
      "hack/procs/worker.ml" "hack/procs/multiWorker.ml"
      "hack/server/find.ml" "hack/server/serverArgs.ml"
      "hack/server/serverEnv.ml" "hack/typing/typing_inherit.ml"
      "hack/typing/typing_decl.ml"
      "hack/typing/typing_decl_service.ml"
      "hack/typing/typing_check_service.ml"
      "hack/server/serverIdeUtils.ml"
      "hack/server/serverCoverageMetric.ml"
      "hack/client/clientCoverageMetric.ml"
      "hack/typing/typing_compare.ml" "hack/server/findRefsService.ml"
      "hack/server/serverFindRefs.ml" "hack/client/clientFindRefs.ml"
      "hack/server/methodJumps.ml" "hack/client/clientMethodJumps.ml"
      "hack/client/clientOutline.ml" "hack/server/serverRefactor.ml"
      "hack/client/clientRefactor.ml" "hack/parsing/parsing_hooks.ml"
      "hack/search/searchUtils.ml" "hack/search/fuzzySearchService.ml"
      "hack/utils/trie.ml" "hack/search/trieSearchService.ml"
      "hack/search/searchService.ml"
      "hack/search/hackSearchService.ml" "hack/client/clientSearch.ml"
      "hack/client/clientTypeAtPos.ml" "hack/server/fileOutline.ml"
      "hack/server/serverArgumentInfo.ml"
      "hack/server/serverColorFile.ml"
      "hack/server/serverFileOutline.ml"
      "hack/server/serverInferType.ml" "hack/server/serverSearch.ml"
      "hack/client/clientCheck.ml" "hack/inotify/inotify.ml"
      "hack/fsnotify_linux/fsnotify.ml" "hack/dfind/dfindEnv.ml"
      "hack/dfind/dfindMaybe.ml" "hack/dfind/dfindAddFile.ml"
      "hack/dfind/dfindServer.ml" "hack/dfind/dfindLib.ml"
      "hack/hhi/hhi.ml" "hack/parsing/parsing_service.ml"
      "hack/server/serverDfind.ml" "hack/server/serverEnvBuild.ml"
      "hack/server/serverHealth.ml" "hack/server/serverPeriodical.ml"
      "hack/server/serverFunctors.ml" "src/common/flowConfig.ml"
      "src/embedded/flowlib.ml" "src/common/files_js.ml"
      "src/commands/commandUtils.ml" "src/parser/spider_monkey_ast.ml"
      "src/common/reason_js.ml" "src/parser/parse_error.ml"
      "src/common/errors_js.ml" "src/common/modes_js.ml"
      "src/typing/constraint_js.ml" "src/typing/flow_js.ml"
      "src/typing/env_js.ml" "src/typing/type_inference_hooks_js.ml"
      "src/typing/autocomplete_js.ml"
      "src/server/autocompleteService_js.ml"
      "src/server/serverProt.ml" "src/commands/autocompleteCommand.ml"
      "src/commands/configCommands.ml" "src/dts/dts_ast.ml"
      "src/dts/lexer_dts.mll" "src/dts/parser_dts.ml"
      "src/dts/printer_dts.ml" "src/commands/convertCommand.ml"
      "src/commands/findModuleCommand.ml"
      "src/commands/getDefCommand.ml"
      "src/commands/getImportersCommand.ml"
      "src/commands/getImportsCommand.ml"
      "src/commands/portCommand.ml" "src/parser/lexer_flow.mll"
      "src/parser/parser_flow.ml" "src/parsing/parsing_service_js.ml"
      "src/typing/module_js.ml" "src/typing/type_inference_js.ml"
      "src/typing/comments_js.ml" "src/typing/getDef_js.ml"
      "src/typing/init_js.ml" "src/typing/sort_js.ml"
      "src/typing/types_js.ml" "src/server/server.ml"
      "src/commands/serverCommands.ml" "src/commands/singleCommand.ml"
      "src/commands/statusCommands.ml" "src/commands/stopCommand.ml"
      "src/commands/suggestCommand.ml"
      "src/commands/typeAtPosCommand.ml"
      "src/stubs/flowEventLogger.ml" "src/flow.ml"

  ]
end
@lefessan

This comment has been minimized.

Copy link

lefessan commented Nov 18, 2014

So, porting "flow" is only a matter of porting the 7 files in C...

@gabelevi

This comment has been minimized.

Copy link
Contributor

gabelevi commented Nov 18, 2014

There really are 3 main pieces of Flow and Hack that are platform specific

  1. File system watching. This is inotify on Linux and fsevents on Darwin (MacOS)
  2. Embedding libraries in the binary (libraries are gzip'd and stuck in the text section of the flow binary...then extracted at runtime). This uses libelf on Linux and mach-o/getsect.h on Darwin.
  3. Shared memory stuff. I hear the mmap stuff we do wouldn't port well.

This is something we'd like to do sometime in the next year, but if someone wants to take a stab at it we'd be more than happy to take the PR :)

@totty90

This comment has been minimized.

Copy link

totty90 commented Nov 18, 2014

File system watching. This is inotify on Linux and fsevents on Darwin (MacOS)

Maybe we can postpone that for now. We can build manually for now. But at least should do the work (:

@lefessan

This comment has been minimized.

Copy link

lefessan commented Nov 18, 2014

From what I saw, there is no need to port part 2. (libelf/mach-o), as "flow" will also look up for "flowlib.tar.gz" in its environment (in the parent dir of its executable...). So, inotify and mmap... already quite some work !

@gabelevi

This comment has been minimized.

Copy link
Contributor

gabelevi commented Nov 18, 2014

Yeah, if you don't run the server as daemon, you don't need the file watching. And you can probably just stick the gzip'd libraries next to the binary and with a little hacking you don't need the embedded libraries stuff.

The shared memory part is a little trickier, but we've had success working around it for simple in-browser playground sorts of things. For example, the Hack tutorial runs the Hack typechecker in the browser without the shared memory stuff.

@cecilemuller

This comment has been minimized.

Copy link

cecilemuller commented Nov 19, 2014

+1

@pingec

This comment has been minimized.

Copy link

pingec commented Nov 19, 2014

Flow looks like an improvement over TypesScript, would be great if it would run on Windows!
(+1)

@koistya

This comment has been minimized.

Copy link

koistya commented Nov 19, 2014

+1

@lefessan

This comment has been minimized.

Copy link

lefessan commented Nov 19, 2014

@gabelevi: any hint on the trick to get rid of the shared memory stuff ?

@j201

This comment has been minimized.

Copy link

j201 commented Nov 19, 2014

+1

It would be great to see this as a competitor to TypeScript, but Windows support is necessary for that.

@gabelevi

This comment has been minimized.

Copy link
Contributor

gabelevi commented Nov 19, 2014

@lefessan So the way Hack compiles to JS is that it replaces a few things with simplified versions. So normally Hack uses sharedMem.ml which calls to external C functions. However, when we compile it to JS, it instead uses a different sharedMem.ml which is greatly simplified and doesn't call into C.

@lefessan

This comment has been minimized.

Copy link

lefessan commented Nov 19, 2014

I used ocpwin to compile a very simplified version for Windows.
http://www.ocamlpro.com/pub/ocpwin/flow-builds/

Still a lot of work to do to get a fully working version !

How to use it :
unzip the file, there are 2 files flow32.exe and flow64.exe to use depending on your system.
You must set a variable FLOWLIB to point at the lib/ directory of flow:

On Cygwin (you must use it for now)

export FLOWLIB=c:/cygwin/home/user/flow-simple-windows/lib

The server has been removed, so it probably only works with:

flow64 single DIRECTORY

I hope it is enough to play with Flow on Windows, while waiting for an official Windows version...

@koistya

This comment has been minimized.

Copy link

koistya commented Nov 19, 2014

@lefessan cool! Thanks, much appreciated.

@wchaowu

This comment has been minimized.

Copy link

wchaowu commented Nov 20, 2014

@lefessan cool +1

@lefessan

This comment has been minimized.

Copy link

lefessan commented Nov 20, 2014

I uploaded a new version:
http://www.ocamlpro.com/pub/ocpwin/flow-builds/

Now, it should behave as the linux/macosx client, but without any multicore support. Works without Cygwin.

Feedback welcome !

@jquense

This comment has been minimized.

Copy link

jquense commented Nov 21, 2014

+1. I was disappointed I couldn't try out flow. Is there word of an official stance or timeline? is win support a priority? it salads strikes me as odd when any new large web oss project is not cross platform. Why wasn't a tool choosen from the beginning (cough node) that handled what's seems to be fairly simple platform deps?

also for a lot Windows devs something a cygwin dep is a complete non-standard.

looking forward to trying this out eventually! it would be helpful to know when that might be :P

@lefessan

This comment has been minimized.

Copy link

lefessan commented Nov 21, 2014

@jquense: portability is an issue, but writing a type-checker is a much harder issue (don't even think about doing it in Javascript...). So, they chose the best tool (OCaml) for the hardest problem, and they left porting as an easy problem... and indeed, it took us only two days to have a working Windows version (ok, no multicore and persistent state, the code is uggly, and it's not official, but it works !).

@pradeeproark

This comment has been minimized.

Copy link

pradeeproark commented Nov 21, 2014

@jquense linux or osx share a common root and it is pretty easy to port between them. Windows is always a different beast, same happened with git, node etc. It will take a while, of course you can jump in and try to submit patches to get windows upto speed.

@jquense

This comment has been minimized.

Copy link

jquense commented Nov 21, 2014

@lefessan @pradeepcodes perhaps i came off as overly whiny, I didn't mean to pout. I mostly just wondering what the official stance is on win support. I realize the nix/osx are an easy port, and that windows if a different animal, i wasn't trying to say that it is easy to build something that meets the needs and is cross platform. My concern is more that when projects don't have cross-platform support as a priority from the beginning, the porting story is usually pretty bad for a long while (node is a good example). I am just wondering what the flow team's position on this is, and whether getting windows support first class is even something they care about. It helps me and my team when we know that flow will eventually be first class on windows, or its always going to be a "if ppl send the prs we'll merge them" sort of a support

@marosurbanec

This comment has been minimized.

Copy link

marosurbanec commented May 20, 2016

From WebStorm 12 Roadmap:

further Flow integration (if it becomes available for Windows)
...
We are thinking about deeper integrating Flow with our editor, but we don’t think it’s worth proceeding before Flow supports Windows – most of our users are on Windows.

Can't blame them, since the last commit to https://github.com/OCamlPro/flow is now more than half a year ago.

Flowtype is an amazing feat of software engineering, the best type inference I've ever seen; but its governance & management is horrible.

@webuniverseio

This comment has been minimized.

Copy link

webuniverseio commented May 20, 2016

As a side note it might be worth to check babel plugin which turns flow type annotations into runtime checks. I know it works different than flow, but idea is quite interesting - https://github.com/codemix/babel-plugin-typecheck.

@bjrmatos

This comment has been minimized.

Copy link

bjrmatos commented May 26, 2016

A lot of activity in twitter about windows support, so an official response from the team would be very appreciated 😃

@JuHwon

This comment has been minimized.

Copy link

JuHwon commented May 30, 2016

@MoOx

This comment has been minimized.

Copy link

MoOx commented Jun 8, 2016

Another weird "workaround" is to rely on this babel plugin https://github.com/codemix/babel-plugin-typecheck to use the flow notation to provide a similar static checking (and also can be done on runtime). Better than nothing.

Until Flow has official Windows binaries (and I am seeing someone assigned a few days ago \o/), the best solution seems to use the docker image https://github.com/motiz88/flow-docker since windows bins are tricky and even more out of date than the docker images.

@cristian-sima

This comment has been minimized.

Copy link

cristian-sima commented Jun 25, 2016

+1

@oviava

This comment has been minimized.

Copy link

oviava commented Jun 27, 2016

You can build the latest version directly with OCAML win: https://gist.github.com/oviava/9c7f0a5ec2fdcdc737b0a75239e6546f

@gabelevi

This comment has been minimized.

Copy link
Contributor

gabelevi commented Jun 28, 2016

@oviava - yep, as you've noticed Windows support is getting closer! It builds and mostly works, but I wouldn't recommend it quite yet.

@MoOx

This comment has been minimized.

Copy link

MoOx commented Jul 1, 2016

I successfully build flow on windows too (wasn't able 2 days ago) so there is definetly good stuff coming.
Way faster than via docker.
Thanks @gabelevi (& the potential other involved) for the hard work (saying this cause you are assigned ^^).

@MoOx

This comment has been minimized.

Copy link

MoOx commented Jul 1, 2016

I just published an unofficial Flow Windows binary (based on master branch so sort of ~0.27)

https://gist.github.com/MoOx/2eabc75477a80b4dd137d0d8cb16f95d

I will try to keep it up to date until this issue is closed.

@cecilemuller

This comment has been minimized.

Copy link

cecilemuller commented Jul 1, 2016

@MoOx That's great, although you may want to move the download to another site than Sendspace because Windows Defender flagged the zip as a virus :/

@MoOx

This comment has been minimized.

Copy link

MoOx commented Jul 1, 2016

@cecilemuller Any recommendation? I don't usually send zip online :D

@cecilemuller

This comment has been minimized.

Copy link

cecilemuller commented Jul 1, 2016

@MoOx

This comment has been minimized.

Copy link

MoOx commented Jul 1, 2016

I updated the gist with a link to a Google Drive folder where I will push builds :)

@cecilemuller

This comment has been minimized.

Copy link

cecilemuller commented Jul 1, 2016

Awesome :)

@danpantry

This comment has been minimized.

Copy link

danpantry commented Jul 1, 2016

Works a charm 👍

@StoneCypher

This comment has been minimized.

Copy link
Author

StoneCypher commented Jul 1, 2016

What @MoOx is doing is awesome

However we still really need an official build from @OCamlPro-Bozman or @OCamlPro-Henry so that @sindresorhus will push Windows support into the official NPM stuff.

@MoOx

This comment has been minimized.

Copy link

MoOx commented Jul 1, 2016

flow-bin are currently handled by flow team members.
So it's simple: an official build can be expected when this issue will be closed.

That's why I published this unofficial build (I just integrated a team that mostly work on windows and I don't want to wait - I can't live without flow now I tried).

@StoneCypher

This comment has been minimized.

Copy link
Author

StoneCypher commented Jul 1, 2016

Thanks. That's why I opened the issue, and why I raised it here again today - to make sure that people remember there's still a big goal ahead for serious windows dev

@fhelwanger fhelwanger referenced this issue Jul 6, 2016

Merged

Add flowtype support #172

11 of 13 tasks complete
@gabelevi

This comment has been minimized.

Copy link
Contributor

gabelevi commented Aug 1, 2016

Good news everyone! Windows support is here! Huge props to the OCamlPro team for their great work porting the tricky parts of Flow to Windows!

It's my great pleasure to finally close out this issue! If anyone finds bugs in the Windows binary, please create new issues!

@StoneCypher

This comment has been minimized.

Copy link
Author

StoneCypher commented Aug 1, 2016

@gabelevi - Thank you kindly

@csvan

This comment has been minimized.

Copy link

csvan commented Aug 10, 2016

@gabelevi thank you so much for the awesome work! You guys and the OCaml team are amazing <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.