Skip to content

Commit

Permalink
Merge pull request #710 from ocaml/do-not-install-depext-opam-2.2
Browse files Browse the repository at this point in the history
Do not install `opam-depext` if using opam 2.2 or later
  • Loading branch information
smorimoto authored Oct 19, 2023
2 parents 06476c1 + 40ae3a0 commit 3a69246
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 30 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to

## [unreleased]

### Changed

- Do not install `opam-depext` if using opam 2.2 or later.

## [2.1.0]

### Added
Expand Down
24 changes: 14 additions & 10 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions dist/post/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions packages/setup-ocaml/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ export enum Platform {
Win32 = "win32",
}

const platform = getPlatform();

export const CYGWIN_ROOT = path.join("D:", "cygwin");

export const CYGWIN_ROOT_BIN = path.join(CYGWIN_ROOT, "bin");

export const CYGWIN_ROOT_WRAPPERBIN = path.join(CYGWIN_ROOT, "wrapperbin");

export const ALLOW_PRELEASE_OPAM = core.getBooleanInput("allow-prelease-opam", {
required: false,
trimWhitespace: true,
});
// [todo] remove the branch for Windows once opam 2.2 is released as stable.
export const ALLOW_PRELEASE_OPAM =
platform !== Platform.Win32 &&
core.getBooleanInput("allow-prelease-opam", {
required: false,
trimWhitespace: true,
});

export const CACHE_PREFIX = core.getInput("cache-prefix", {
required: false,
Expand All @@ -47,10 +52,13 @@ export const OCAML_COMPILER = core.getInput("ocaml-compiler", {
trimWhitespace: true,
});

export const OPAM_DEPEXT = core.getBooleanInput("opam-depext", {
required: false,
trimWhitespace: true,
});
// [todo] remove this once opam 2.2 is released as stable.
export const OPAM_DEPEXT =
!ALLOW_PRELEASE_OPAM &&
core.getBooleanInput("opam-depext", {
required: false,
trimWhitespace: true,
});

export const OPAM_DEPEXT_FLAGS = core
.getInput("opam-depext-flags", { required: false, trimWhitespace: true })
Expand All @@ -77,8 +85,6 @@ const repositories_yaml = yaml.parse(
core.getInput("opam-repositories", { required: false, trimWhitespace: true }),
) as Record<string, string> | null;

const platform = getPlatform();

const defaultRepository =
platform === Platform.Win32
? "https://github.com/ocaml-opam/opam-repository-mingw.git#sunset"
Expand Down
2 changes: 1 addition & 1 deletion packages/setup-ocaml/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function installer() {
core.exportVariable("OPAMERRLOGLEN", 0);
core.exportVariable("OPAMJOBS", os.cpus().length);
core.exportVariable("OPAMPRECISETRACKING", 1);
// [todo] remove this line once we unlock opam 2.2
// [todo] remove this once opam 2.2 is released as stable.
// https://github.com/ocaml/opam/issues/3447
core.exportVariable("OPAMSOLVERTIMEOUT", 1000);
core.exportVariable("OPAMYES", 1);
Expand Down

0 comments on commit 3a69246

Please sign in to comment.