From 28ddebe4c497b1e28d23d68c2efbd438255a5d4d Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 8 Jan 2025 15:58:04 +0000 Subject: [PATCH] Set igncr using BASH_ENV instead of SHELLOPTS --- dist/index.js | 9 ++++++--- dist/post/index.js | 1 + packages/setup-ocaml/src/constants.ts | 2 ++ packages/setup-ocaml/src/installer.ts | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 974b36b9..aef39aba 100644 --- a/dist/index.js +++ b/dist/index.js @@ -149660,6 +149660,8 @@ __nccwpck_require__.d(extract_namespaceObject, { var external_node_process_ = __nccwpck_require__(1708); // EXTERNAL MODULE: ../../node_modules/@actions/core/lib/core.js var lib_core = __nccwpck_require__(7184); +;// CONCATENATED MODULE: external "node:fs/promises" +const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises"); // EXTERNAL MODULE: external "node:os" var external_node_os_ = __nccwpck_require__(48161); // EXTERNAL MODULE: ../../node_modules/@actions/exec/lib/exec.js @@ -149785,6 +149787,7 @@ const CYGWIN_MIRROR_ENCODED_URI = encodeURIComponent(CYGWIN_MIRROR).toLowerCase( // [HACK] https://github.com/ocaml/setup-ocaml/pull/55 const CYGWIN_ROOT = external_node_path_namespaceObject.join("D:", "cygwin"); const CYGWIN_ROOT_BIN = external_node_path_namespaceObject.join(CYGWIN_ROOT, "bin"); +const CYGWIN_BASH_ENV = external_node_path_namespaceObject.join(CYGWIN_ROOT, "bash_env"); const DUNE_CACHE_ROOT = (() => { const homeDir = external_node_os_.homedir(); const xdgCacheHome = external_node_process_.env.XDG_CACHE_HOME; @@ -150084,8 +150087,6 @@ async function update() { }); } -;// CONCATENATED MODULE: external "node:fs/promises" -const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises"); // EXTERNAL MODULE: ../../node_modules/@actions/http-client/lib/index.js var http_client_lib = __nccwpck_require__(9920); // EXTERNAL MODULE: ../../node_modules/@actions/io/lib/io.js @@ -168895,6 +168896,7 @@ async function retrieveOpamLocalPackages() { + async function installer() { if (lib_core.isDebug()) { lib_core.exportVariable("OPAMVERBOSE", 1); @@ -168911,7 +168913,6 @@ async function installer() { lib_core.exportVariable("CYGWIN", "winsymlinks:native"); lib_core.exportVariable("HOME", external_node_process_.env.USERPROFILE); lib_core.exportVariable("MSYS", "winsymlinks:native"); - lib_core.exportVariable("SHELLOPTS", "igncr"); await lib_core.group("Change the file system behaviour parameters", async () => { await (0,lib_exec.exec)("fsutil", ["behavior", "query", "SymlinkEvaluation"]); // [INFO] https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-behavior @@ -168931,6 +168932,8 @@ async function installer() { if (!cygwinCacheHit) { await saveCygwinCache(); } + await promises_namespaceObject.writeFile(CYGWIN_BASH_ENV, "set -o igncr"); + lib_core.exportVariable("BASH_ENV", CYGWIN_BASH_ENV); lib_core.addPath(CYGWIN_ROOT_BIN); } await setupOpam(); diff --git a/dist/post/index.js b/dist/post/index.js index 5d3c1d91..28b25844 100644 --- a/dist/post/index.js +++ b/dist/post/index.js @@ -114768,6 +114768,7 @@ const constants_CYGWIN_MIRROR_ENCODED_URI = encodeURIComponent(CYGWIN_MIRROR).to // [HACK] https://github.com/ocaml/setup-ocaml/pull/55 const constants_CYGWIN_ROOT = external_node_path_namespaceObject.join("D:", "cygwin"); const CYGWIN_ROOT_BIN = external_node_path_namespaceObject.join(constants_CYGWIN_ROOT, "bin"); +const CYGWIN_BASH_ENV = external_node_path_namespaceObject.join(constants_CYGWIN_ROOT, "bash_env"); const DUNE_CACHE_ROOT = (() => { const homeDir = external_node_os_.homedir(); const xdgCacheHome = external_node_process_.env.XDG_CACHE_HOME; diff --git a/packages/setup-ocaml/src/constants.ts b/packages/setup-ocaml/src/constants.ts index ee67d6b4..433d78e2 100644 --- a/packages/setup-ocaml/src/constants.ts +++ b/packages/setup-ocaml/src/constants.ts @@ -64,6 +64,8 @@ export const CYGWIN_ROOT = path.join("D:", "cygwin"); export const CYGWIN_ROOT_BIN = path.join(CYGWIN_ROOT, "bin"); +export const CYGWIN_BASH_ENV = path.join(CYGWIN_ROOT, "bash_env"); + export const DUNE_CACHE_ROOT = (() => { const homeDir = os.homedir(); const xdgCacheHome = process.env.XDG_CACHE_HOME; diff --git a/packages/setup-ocaml/src/installer.ts b/packages/setup-ocaml/src/installer.ts index 8da4a2b0..54a0dbe5 100644 --- a/packages/setup-ocaml/src/installer.ts +++ b/packages/setup-ocaml/src/installer.ts @@ -1,3 +1,4 @@ +import * as fs from "node:fs/promises"; import * as os from "node:os"; import * as process from "node:process"; import * as core from "@actions/core"; @@ -10,6 +11,7 @@ import { saveOpamCache, } from "./cache.js"; import { + CYGWIN_BASH_ENV, CYGWIN_ROOT_BIN, DUNE_CACHE, DUNE_CACHE_ROOT, @@ -47,7 +49,6 @@ export async function installer() { core.exportVariable("CYGWIN", "winsymlinks:native"); core.exportVariable("HOME", process.env.USERPROFILE); core.exportVariable("MSYS", "winsymlinks:native"); - core.exportVariable("SHELLOPTS", "igncr"); await core.group( "Change the file system behaviour parameters", async () => { @@ -70,6 +71,8 @@ export async function installer() { if (!cygwinCacheHit) { await saveCygwinCache(); } + await fs.writeFile(CYGWIN_BASH_ENV, "set -o igncr"); + core.exportVariable("BASH_ENV", CYGWIN_BASH_ENV); core.addPath(CYGWIN_ROOT_BIN); } await setupOpam();