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

[2.2 backport] Add curl to the list of required cygwin packages to avoid issues with Windows' curl #6143

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ users)
## Plugins

## Init
* Add curl to the list of required cygwin packages to avoid issues with Windows' curl [#6142 @kit-ty-kate - fix #6120]

## Config report

Expand Down
1 change: 1 addition & 0 deletions src/client/opamInitDefaults.ml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ let required_packages_for_cygwin =
"tar";
"unzip";
"rsync";
"curl";
] |> List.map OpamSysPkg.of_string

let init_scripts () = [
Expand Down
93 changes: 49 additions & 44 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -321,50 +321,55 @@ module Cygwin = struct
let fstab = cygwin_root / "etc" // "fstab" in
let cygcheck = cygwin_bin // cygcheckexe in
let local_cygwin_setupexe = cygsetup () in
if OpamFilename.exists cygcheck then
OpamConsole.warning "Cygwin already installed in root %s"
(OpamFilename.Dir.to_string cygwin_root)
else
(* rjbou: dry run ? there is no dry run on install, from where this
function is called *)
(OpamProcess.Job.run @@
(* download setup.exe *)
download_setupexe local_cygwin_setupexe @@+ fun () ->
(* launch install *)
let args = [
"--root"; OpamFilename.Dir.to_string cygwin_root;
"--arch"; "x86_64";
"--only-site";
"--site"; mirror;
"--local-package-dir";
OpamFilename.Dir.to_string (internal_cygcache ());
"--no-admin";
"--no-desktop";
"--no-replaceonreboot";
"--no-shortcuts";
"--no-startmenu";
"--no-write-registry";
"--no-version-check";
"--quiet-mode"; "noinput";
] @
match packages with
| [] -> []
| spkgs ->
[ "--packages";
OpamStd.List.concat_map "," OpamSysPkg.to_string spkgs ]
in
let args =
if Unix.has_symlink () then
"--symlink-type" :: "native" :: args
else
args
in
OpamSystem.make_command
(OpamFilename.to_string local_cygwin_setupexe)
args @@> fun r ->
OpamSystem.raise_on_process_error r;
set_fstab_noacl fstab;
Done ())
let not_already_installed =
if OpamFilename.exists cygcheck then
(log "Cygwin already installed in root %s"
(OpamFilename.Dir.to_string cygwin_root);
false)
else
true
in
(* rjbou: dry run ? there is no dry run on install, from where this
function is called *)
OpamProcess.Job.run @@
(* download setup.exe *)
download_setupexe local_cygwin_setupexe @@+ fun () ->
(* launch install *)
let args = [
"--root"; OpamFilename.Dir.to_string cygwin_root;
"--arch"; "x86_64";
"--only-site";
"--site"; mirror;
"--local-package-dir";
OpamFilename.Dir.to_string (internal_cygcache ());
"--no-admin";
"--no-desktop";
"--no-replaceonreboot";
"--no-shortcuts";
"--no-startmenu";
"--no-write-registry";
"--no-version-check";
"--quiet-mode"; "noinput";
] @
match packages with
| [] -> []
| spkgs ->
[ "--packages";
OpamStd.List.concat_map "," OpamSysPkg.to_string spkgs ]
in
let args =
if Unix.has_symlink () then
"--symlink-type" :: "native" :: args
else
args
in
OpamSystem.make_command
(OpamFilename.to_string local_cygwin_setupexe)
args @@> fun r ->
OpamSystem.raise_on_process_error r;
if not_already_installed then
set_fstab_noacl fstab;
Done ()

let analysis_cache = Hashtbl.create 17

Expand Down
Loading