Skip to content

Commit 5dcf82c

Browse files
authored
Merge pull request #881 from ocaml/better-darcs-fix
Better optional dependencies management
2 parents 96de1ac + ffd7014 commit 5dcf82c

File tree

14 files changed

+73
-56
lines changed

14 files changed

+73
-56
lines changed

analysis/dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 26 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lint-fmt/dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/analysis/src/analysis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import type { Output } from "./opam-detector.js";
1212
import { createBuildTarget } from "./opam-detector.js";
1313

14-
async function getOpamLocalPackages() {
14+
async function retrieveOpamLocalPackages() {
1515
const globber = await glob.create("*.opam");
1616
const fpaths = await globber.glob();
1717
return fpaths;
@@ -23,7 +23,7 @@ export async function analysis() {
2323
url: "https://github.com/ocaml/setup-ocaml/tree/master/analysis",
2424
version: "0.0.0",
2525
});
26-
const fpaths = await getOpamLocalPackages();
26+
const fpaths = await retrieveOpamLocalPackages();
2727
for (const fpath of fpaths) {
2828
const temp = await fs.mkdtemp(
2929
path.join(os.tmpdir(), "setup-ocaml-opam-tree-"),

packages/lint-fmt/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as process from "node:process";
22
import * as core from "@actions/core";
33
import { checkFmt } from "./lint.js";
4-
import { getOcamlformatVersion } from "./ocamlformat.js";
4+
import { retrieveOcamlformatVersion } from "./ocamlformat.js";
55
import { installDune, installOcamlformat } from "./opam.js";
66

77
async function run() {
88
try {
9-
const version = await getOcamlformatVersion();
9+
const version = await retrieveOcamlformatVersion();
1010
if (version) {
1111
await installOcamlformat(version);
1212
}

packages/lint-fmt/src/ocamlformat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function parse() {
2222
}
2323
}
2424

25-
export async function getOcamlformatVersion() {
25+
export async function retrieveOcamlformatVersion() {
2626
const config = await parse();
2727
if (config === undefined) {
2828
core.warning(".ocamlformat file is not found");

packages/setup-ocaml/src/cache.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import {
1818
PLATFORM,
1919
RESOLVED_COMPILER,
2020
} from "./constants.js";
21-
import { getLatestOpamRelease } from "./opam.js";
22-
import { getCygwinVersion } from "./windows.js";
21+
import { retrieveLatestOpamRelease } from "./opam.js";
22+
import { retrieveCygwinVersion } from "./windows.js";
2323

2424
async function composeCygwinCacheKeys() {
25-
const cygwinVersion = await getCygwinVersion();
25+
const cygwinVersion = await retrieveCygwinVersion();
2626
const key = `${CACHE_PREFIX}-setup-ocaml-cygwin-${cygwinVersion}`;
2727
const restoreKeys = [key];
2828
return { key, restoreKeys };
@@ -44,7 +44,7 @@ async function composeDuneCacheKeys() {
4444
}
4545

4646
async function composeOpamCacheKeys() {
47-
const { version: opamVersion } = await getLatestOpamRelease();
47+
const { version: opamVersion } = await retrieveLatestOpamRelease();
4848
const sandbox = OPAM_DISABLE_SANDBOXING ? "nosandbox" : "sandbox";
4949
const ocamlCompiler = await RESOLVED_COMPILER;
5050
const repositoryUrls = OPAM_REPOSITORIES.map(([_, value]) => value).join(",");

packages/setup-ocaml/src/installer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
repositoryRemoveAll,
2727
setupOpam,
2828
} from "./opam.js";
29-
import { getOpamLocalPackages } from "./packages.js";
29+
import { retrieveOpamLocalPackages } from "./packages.js";
3030
import { setupCygwin } from "./windows.js";
3131

3232
export async function installer() {
@@ -85,7 +85,7 @@ export async function installer() {
8585
core.exportVariable("DUNE_CACHE_TRANSPORT", "direct");
8686
}
8787
core.exportVariable("CLICOLOR_FORCE", "1");
88-
const fnames = await getOpamLocalPackages();
88+
const fnames = await retrieveOpamLocalPackages();
8989
if (fnames.length > 0) {
9090
if (OPAM_PIN) {
9191
await pin(fnames);

packages/setup-ocaml/src/opam.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
updateUnixPackageIndexFiles,
1919
} from "./unix.js";
2020

21-
export async function getLatestOpamRelease() {
21+
export async function retrieveLatestOpamRelease() {
2222
const semverRange = ALLOW_PRERELEASE_OPAM ? "*" : "<2.3.0";
2323
const octokit = github.getOctokit(GITHUB_TOKEN);
2424
const { data: releases } = await octokit.rest.repos.listReleases({
@@ -62,7 +62,7 @@ export async function getLatestOpamRelease() {
6262

6363
async function acquireOpam() {
6464
await core.group("Install opam", async () => {
65-
const { version, browserDownloadUrl } = await getLatestOpamRelease();
65+
const { version, browserDownloadUrl } = await retrieveLatestOpamRelease();
6666
const cachedPath = toolCache.find("opam", version, ARCHITECTURE);
6767
const opam = PLATFORM !== "windows" ? "opam" : "opam.exe";
6868
if (cachedPath === "") {

0 commit comments

Comments
 (0)