-
Notifications
You must be signed in to change notification settings - Fork 21
Windows #90
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 #90
Changes from all commits
b20b805
f13b532
382754b
65ad6ca
3093d2f
1b006c8
9548068
56ae924
5b081a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,13 +16,15 @@ module Repositories = struct | |
|
|
||
| type t = { | ||
| opam_repository_master : repo; | ||
| opam_repository_mingw_opam2 : repo; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At some point later this year this will go - might it be better to have a list of repositories here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it doesn't matter much, if the patch is sufficiently clean it can simply be reverted, but maybe a list would help managing multiple repositories. Ok!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, no, it's simpler with a flat structure (no list), because the branch we want to checkout is different for each git repo (master for opam-repository, opam2 for opam-repository-mingw). With a list we won't be able to distinguish the repos, so we'd need to attach the branch to clone. It would induce a somewhat complex refactor, while reverting the commit is simple enough to remove the support for opam-repository-mingw. |
||
| opam_2_0 : repo; | ||
| opam_2_1 : repo; | ||
| } | ||
|
|
||
| let digest {opam_repository_master; opam_2_0; opam_2_1} = | ||
| let digest {opam_repository_master; opam_repository_mingw_opam2; opam_2_0; opam_2_1} = | ||
| let json = `Assoc [ | ||
| "opam-repository__master", `String opam_repository_master; | ||
| "opam-repository-mingw__opam2", `String opam_repository_mingw_opam2; | ||
| "opam__2.0", `String opam_2_0; | ||
| "opam__2.1", `String opam_2_1; | ||
| ] in | ||
|
|
@@ -34,6 +36,7 @@ module Repositories = struct | |
|
|
||
| type t = { | ||
| opam_repository_master : hash; | ||
| opam_repository_mingw_opam2 : hash; | ||
| opam_2_0 : hash; | ||
| opam_2_1 : hash; | ||
| } [@@deriving yojson] | ||
|
|
@@ -52,12 +55,13 @@ module Repositories = struct | |
| Current.Process.check_output ~cwd ~cancellable:true ~job ("", [|"git"; "rev-parse"; "HEAD"|]) >>!= fun hash -> | ||
| Lwt.return (Ok (String.trim hash)) | ||
|
|
||
| let build No_context job {Key.opam_repository_master; opam_2_0; opam_2_1} = | ||
| let build No_context job {Key.opam_repository_master; opam_repository_mingw_opam2; opam_2_0; opam_2_1} = | ||
| Current.Job.start job ~level:Current.Level.Mostly_harmless >>= fun () -> | ||
| get_commit_hash ~job ~repo:opam_repository_master ~branch:"master" >>!= fun opam_repository_master -> | ||
| get_commit_hash ~job ~repo:opam_repository_mingw_opam2 ~branch:"opam2" >>!= fun opam_repository_mingw_opam2 -> | ||
| get_commit_hash ~job ~repo:opam_2_0 ~branch:"2.0" >>!= fun opam_2_0 -> | ||
| get_commit_hash ~job ~repo:opam_2_1 ~branch:"2.1" >>!= fun opam_2_1 -> | ||
| Lwt.return (Ok {Value.opam_repository_master; opam_2_0; opam_2_1}) | ||
| Lwt.return (Ok {Value.opam_repository_master; opam_repository_mingw_opam2; opam_2_0; opam_2_1}) | ||
|
|
||
| let pp f _ = Fmt.string f "Git repositories" | ||
|
|
||
|
|
@@ -68,6 +72,7 @@ module Cache = Current_cache.Make(Repositories) | |
|
|
||
| type t = { | ||
| opam_repository_master : Current_git.Commit_id.t; | ||
| opam_repository_mingw_opam2 : Current_git.Commit_id.t; | ||
| opam_2_0 : Current_git.Commit_id.t; | ||
| opam_2_1 : Current_git.Commit_id.t; | ||
| } | ||
|
|
@@ -76,17 +81,20 @@ let get ~schedule = | |
| let key = { | ||
| Repositories.Key. | ||
| opam_repository_master = "git://github.com/ocaml/opam-repository"; | ||
| opam_repository_mingw_opam2 = "git://github.com/fdopen/opam-repository-mingw"; | ||
| opam_2_0 = "git://github.com/ocaml/opam"; | ||
| opam_2_1 = "git://github.com/ocaml/opam"; | ||
| } in | ||
| let+ {Repositories.Value.opam_repository_master; opam_2_0; opam_2_1} = | ||
| let+ {Repositories.Value.opam_repository_master; opam_repository_mingw_opam2; opam_2_0; opam_2_1} = | ||
| Current.component "Git-repositories" |> | ||
| let> key = Current.return key in | ||
| Cache.get ~schedule Repositories.No_context key | ||
| in | ||
| { | ||
| opam_repository_master = | ||
| Current_git.Commit_id.v ~repo:key.opam_repository_master ~gref:"master" ~hash:opam_repository_master; | ||
| opam_repository_mingw_opam2 = | ||
| Current_git.Commit_id.v ~repo:key.opam_repository_mingw_opam2 ~gref:"opam2" ~hash:opam_repository_mingw_opam2; | ||
| opam_2_0 = | ||
| Current_git.Commit_id.v ~repo:key.opam_2_0 ~gref:"2.0" ~hash:opam_2_0; | ||
| opam_2_1 = | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why's this in
Docker? I'd take the root as"/run/secrets"on Unix andOption.value (Sys.getenv_opt "ProgramData") ~default:"C:\ProgramData")on Windows and then put the secrets inocurrent-hubunder that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding was that these were Docker Swarm secrets (also available via docker compose). The default location for secrets inside containers on Windows is
C:\ProgramData\Docker\secrets.https://docs.docker.com/engine/swarm/secrets/#windows-support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dra27 we haven't really resolved that conversation, are you convinced by my explanation?