Skip to content

Commit

Permalink
add support for ARM Linux
Browse files Browse the repository at this point in the history
report missing subdirectory in OW image
  • Loading branch information
jmalak committed Jan 24, 2025
1 parent 698f223 commit 923cbd8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 27 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ jobs:
- "2.0"
- "2.0-64"
include:
- runner: macos-13
# Intel
- runner: 'macos-13'
version: "2.0-64"
- runner: macos-14
# ARM
- runner: 'macos-14'
version: "2.0-64"
# ARM
- runner: 'ubuntu-24.04-arm'
version: "2.0-64"
steps:
- name: Download artifact
Expand Down
62 changes: 37 additions & 25 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ function getInputs(): ISetupWatcomSettings {
}
} else {
if (p_version == "2.0-64") {
p_path_subdirs = ["binl64", "binl"];
if (process.arch === 'arm64') {
p_path_subdirs = ["arml64"];
} else if (process.arch === 'x64') {
p_path_subdirs = ["binl64", "binl"];
} else {
throw new Error("Unsupported platform");
}
} else {
p_path_subdirs = ["binl"];
}
Expand Down Expand Up @@ -231,31 +237,37 @@ async function run(): Promise<void> {
process.env["PATH"] = `${originalPath}`;
}

if (settings.environment) {
core.startGroup("Setting environment.");
core.exportVariable("WATCOM", watcom_path);
core.info(`Setted WATCOM=${watcom_path}`);
const sep = (process.platform == "win32") ? ";" : ":";
const additional_path = (process.platform == "win32") ? "BINW" : "binw";
let bin_path = "";
for (var x of settings.path_subdirs) {
bin_path = bin_path + path.join(watcom_path, x) + sep;
}
bin_path = bin_path + path.join(watcom_path, additional_path);
core.addPath(bin_path);
const new_path = process.env["PATH"];
core.info(`Setted PATH=${new_path}`);
const originalInclude = process.env["INCLUDE"];
let inc_path = "";
for (var x of settings.inc_subdirs) {
inc_path = inc_path + path.join(watcom_path, x) + sep;
}
if (originalInclude) {
inc_path = inc_path + originalInclude;
let tmpp = path.join(watcom_path, settings.path_subdirs[0]);
core.info(`Check directory ${tmpp}.`);
if (fs.existsSync(tmpp)) {
if (settings.environment) {
core.startGroup("Setting environment.");
core.exportVariable("WATCOM", watcom_path);
core.info(`Setted WATCOM=${watcom_path}`);
const sep = (process.platform == "win32") ? ";" : ":";
const additional_path = (process.platform == "win32") ? "BINW" : "binw";
let bin_path = "";
for (var x of settings.path_subdirs) {
bin_path = bin_path + path.join(watcom_path, x) + sep;
}
bin_path = bin_path + path.join(watcom_path, additional_path);
core.addPath(bin_path);
const new_path = process.env["PATH"];
core.info(`Setted PATH=${new_path}`);
const originalInclude = process.env["INCLUDE"];
let inc_path = "";
for (var x of settings.inc_subdirs) {
inc_path = inc_path + path.join(watcom_path, x) + sep;
}
if (originalInclude) {
inc_path = inc_path + originalInclude;
}
core.exportVariable("INCLUDE", inc_path);
core.info(`Setted INCLUDE=${inc_path}`);
core.endGroup();
}
core.exportVariable("INCLUDE", inc_path);
core.info(`Setted INCLUDE=${inc_path}`);
core.endGroup();
} else {
throw new Error("OW image doesn't contain the required directory.");
}
} catch (error) {
if (error instanceof Error) {
Expand Down

0 comments on commit 923cbd8

Please sign in to comment.