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

Windows support through Opam 2.2 #1150

Open
AllanBlanchard opened this issue Jun 18, 2024 · 4 comments
Open

Windows support through Opam 2.2 #1150

AllanBlanchard opened this issue Jun 18, 2024 · 4 comments
Assignees
Labels
windows Relates to Windows support
Milestone

Comments

@AllanBlanchard
Copy link

FYI, we worked a little bit on porting Frama-C to Windows in Opam 2.2. We had to fix zlib and gmp which are also necessary for Alt-Ergo but we could not really figure out how to fix Alt-Ergo.

The fixes that we prepared are available here: ocaml/opam-repository@master...zilbuz:opam-repository:frama-c-windows

In Alt-Ergo, I slightly modified /src/bin/text/dune, adding a condition enabled_if for the flags, and for now just adding a rule for Windows that uses the standard flags, however, if I can build the executable, it just fails to run currently, so I guess that diving in the code of Alt-Ergo might be necessary.

@bclement-ocp bclement-ocp added the triage Requires a decision from the dev team label Jul 11, 2024
@bclement-ocp bclement-ocp added this to the 2.6.0 milestone Jul 11, 2024
@bclement-ocp bclement-ocp removed the triage Requires a decision from the dev team label Jul 11, 2024
@bclement-ocp
Copy link
Collaborator

Thanks for the report & extra information.
For tracking purposes: assigning @Halbaroth since this is essentially a duplicate of #919

@Halbaroth
Copy link
Collaborator

Halbaroth commented Aug 9, 2024

Good news, Alt-Ergo works on Windows through Opam 2.2 now! We support installations with both MSYS2 and Cygwin.
You can try to setup it with:

opam pin https://github.com/OCamlPro/alt-ergo.git#next 

Please, let me know if you have an issue.

Your patches have been helpful but when I tried it, I need to patch camlzip too and it seems I did something wrong because Alt-Ergo crashed frequently, depending on the environment in which we loaded it. I believed it was a problem related with the linked libraries but after some of patches of Basile Desloges have been pushed on opam-repository, everything works fine.

Alt-Ergo will officially support Windows in the next release 2.6.0, which should be published in September.

Notice that some features are not available on Windows (see #1201). We plan to support timelimit and :reproduce-resource-limit in 2.7.0. Tell me if you need it in the next release.

@Halbaroth Halbaroth added the windows Relates to Windows support label Aug 9, 2024
@AllanBlanchard
Copy link
Author

Sorry for this long silence, I was in vacation ^^.

I installed the package this morning and got the following warning:

[WARNING] C:\Users\ab238114\AppData\Local\opam\default\bin\alt-ergo.exe is a Cygwin-linked executable

And when I try to run the exectuable, nothing happens but the return value is false:

PS C:\> alt-ergo.exe --version
PS C:\> echo $?
False

Notice that some features are not available on Windows (see #1201). We plan to support timelimit and :reproduce-resource-limit in 2.7.0. Tell me if you need it in the next release.

I guess that it means that Why3 will not be able to stop alt-ergo, but since Why3 still cannot compilable on Windows via Opam 2.2, I guess that it is not that problematic for us :P . From a business perspective it is not a problem for now: we have workaround for the very few people working on Windows and most of them do not use WP (thus, they do not use Alt-Ergo). It might be a "problem" for me for teaching in march 2025 if:

  • we succeed in creating a Windows package for Frama-C before that,
  • why3 works on Windows at this point,
  • Alt-Ergo 2.7.0 is not released at this point.

@Halbaroth
Copy link
Collaborator

Halbaroth commented Sep 6, 2024

Sorry for this long silence, I was in vacation ^^.

I installed the package this morning and got the following warning:

[WARNING] C:\Users\ab238114\AppData\Local\opam\default\bin\alt-ergo.exe is a Cygwin-linked executable

And when I try to run the exectuable, nothing happens but the return value is false:

PS C:\> alt-ergo.exe --version
PS C:\> echo $?
False

Notice that some features are not available on Windows (see #1201). We plan to support timelimit and :reproduce-resource-limit in 2.7.0. Tell me if you need it in the next release.

Thanks for the bug report. I will investigate. I need bit of information:

  1. Did you try to install Alt-Ergo with a fresh opam setup?
  2. Did you install Cygwin by yourself and you use the opam init script to setup Cygwin?
  3. Did you try to run Alt-Ergo in bash through Cygwin?

I guess that it means that Why3 will not be able to stop alt-ergo, but since Why3 still cannot compilable on Windows via Opam 2.2, I guess that it is not that problematic for us :P .

I didn't check but I guess that Why3 can kill a subprocess if it exceed the time limit. We plan to support timelimit on Windows through GC alarms.

From a business perspective it is not a problem for now: we have workaround for the very few people working on Windows and most of them do not use WP (thus, they do not use Alt-Ergo). It might be a "problem" for me for teaching in march 2025 if:

* we succeed in creating a Windows package for Frama-C before that,

* why3 works on Windows at this point,

* Alt-Ergo 2.7.0 is not released at this point.

We can publish a small release if you really need this feature before the 2.7.0.

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

No branches or pull requests

3 participants