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

Add initial support for opam 2.2 on Windows #794

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

kit-ty-kate
Copy link
Member

@kit-ty-kate kit-ty-kate commented May 15, 2024

Closes #733
Closes #793

Joint work with @hhugo @smorimoto @dra27.

@kit-ty-kate kit-ty-kate changed the title Add support for opam 2.2 on Windows Add initial support for opam 2.2 on Windows May 15, 2024
@smorimoto
Copy link
Member

You can compile by running yarn build.

@smorimoto
Copy link
Member

Could you rebase to the latest master?

@kit-ty-kate
Copy link
Member Author

Could you rebase to the latest master?

done

You can compile by running yarn build.

that does not work. Do you have a list of command to run for javascript beginners? I have yarn installed but (after having to modify package.json to get the right yarn version or something), it's complaining about ncc.

@kit-ty-kate
Copy link
Member Author

Note from @dra27: this should be part of ocaml/setup-ocaml@v3

@hhugo
Copy link
Contributor

hhugo commented May 17, 2024

@kit-ty-kate, do you have some CI testing this GH action ?

@kit-ty-kate
Copy link
Member Author

@hhugo I do in kit-ty-kate/mirage-torrent#2 but while the setup-ocaml succeeds, the builds fails while building dune:

#=== ERROR while compiling dune.3.15.2 ========================================#
# context     2.2.0~beta2 | win32/x86_64 | ocaml-base-compiler.4.14.2 | git+https://github.com/dra27/opam-repository.git#windows-initial
# path        D:\a\mirage-torrent\mirage-torrent\_opam\.opam-switch\build\dune.3.15.2
# command     D:\a\mirage-torrent\mirage-torrent\_opam\bin\ocaml.exe boot/bootstrap.ml -j 4
# exit-code   2
# env-file    D:\.opam\log\dune-8180-dff03d.env
# output-file D:\.opam\log\dune-8180-dff03d.out
### output ###
# ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot unix.cma boot/libs.ml boot/duneboot.ml
# ** Cannot resolve symbols for D:/a/mirage-torrent/mirage-torrent/_opam/lib/ocaml\libcamlrun.a(startup_aux.b.o):
#  swscanf
# ** Cannot resolve symbols for descriptor object:
#  _vscwprintf
# File "boot/duneboot.ml", line 1:
# Error: Error while building custom runtime system

@hhugo
Copy link
Contributor

hhugo commented May 28, 2024

I'm also testing this PR in https://github.com/hhugo/ocamlbuild/pull/7 and see the same error.

@hhugo
Copy link
Contributor

hhugo commented May 28, 2024

The following can probably be removed as well

    // Works around the lack of https://github.com/ocaml/opam/pull/3882 when
    // adding ocaml/opam-repository on Windows. Can be removed when the action
    // switches to opam 2.2
    if (PLATFORM === "win32") {
      const autocrlf = await getExecOutput(
        "git",
        ["config", "--global", "core.autocrlf"],
        { ignoreReturnCode: true },
      );
      if (autocrlf.stdout.trim() !== "input") {
        if (autocrlf.exitCode === 0) {
          restore_autocrlf = autocrlf.stdout.trim();
        } else {
          restore_autocrlf = null; // Unset the value at the end
        }
      }
      await exec("git", ["config", "--global", "core.autocrlf", "input"]);
    }

@smorimoto smorimoto force-pushed the win52 branch 2 times, most recently from 777f230 to 12d77b3 Compare June 7, 2024 22:21
@smorimoto smorimoto requested review from dra27 and smorimoto June 7, 2024 23:38
@smorimoto smorimoto marked this pull request as draft June 8, 2024 01:37
Copy link
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to special case WIndows in the test matrix any more 😎

.github/workflows/workflow.yml Show resolved Hide resolved
.github/workflows/workflow.yml Outdated Show resolved Hide resolved
@kit-ty-kate kit-ty-kate marked this pull request as ready for review June 10, 2024 21:02
@smorimoto smorimoto linked an issue Jun 10, 2024 that may be closed by this pull request
@smorimoto smorimoto added the enhancement New feature or request label Jun 10, 2024
@smorimoto smorimoto requested a review from dra27 June 10, 2024 21:51
@smorimoto smorimoto force-pushed the win52 branch 3 times, most recently from b930661 to d73c4bc Compare June 10, 2024 22:18
@smorimoto smorimoto force-pushed the win52 branch 5 times, most recently from faf1ee6 to 42d6dde Compare June 12, 2024 02:44
@smorimoto smorimoto linked an issue Jun 13, 2024 that may be closed by this pull request
@smorimoto smorimoto force-pushed the win52 branch 6 times, most recently from 3ef016c to a9e1cf9 Compare June 13, 2024 23:12
@smorimoto smorimoto linked an issue Jun 13, 2024 that may be closed by this pull request
@smorimoto smorimoto force-pushed the win52 branch 2 times, most recently from e4e7436 to 50d4e6d Compare June 14, 2024 01:06
@hhugo
Copy link
Contributor

hhugo commented Jun 15, 2024

When can we expect a release with this PR ?

@smorimoto
Copy link
Member

I'm planning to release as follows, but do you all have any objections? @dra27 @hhugo @kit-ty-kate

  1. Merge this PR to master
  2. Release as v3.0.0-alpha (maybe we shouldn't create the v3 tag at this point)
  3. Once we have tested widely and verified that there is no major problem, then release v3.0.0

@hhugo
Copy link
Contributor

hhugo commented Jun 17, 2024

Sounds reasonable to me

@kit-ty-kate
Copy link
Member Author

lgtm

@smorimoto smorimoto force-pushed the win52 branch 2 times, most recently from fc8859a to b386864 Compare June 18, 2024 01:44
Co-authored-by: Kate <kit-ty-kate@outlook.com>
Co-authored-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
@smorimoto smorimoto merged commit 53a5c11 into ocaml:master Jun 18, 2024
8 checks passed
@smorimoto
Copy link
Member

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

Successfully merging this pull request may close these issues.

opam 2.2 support on Windows Better Caching Native Windows Support
4 participants