Skip to content

Commit 00dd295

Browse files
Remove broken 'ghc-version: head' logic
1 parent 2fb94d9 commit 00dd295

File tree

4 files changed

+1
-77
lines changed

4 files changed

+1
-77
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: 'GitHub'
44
inputs:
55
ghc-version:
66
required: false
7-
description: 'Version of GHC to use. If set to "latest", it will always get the latest stable version. If set to "head", it will always get the latest build of GHC.'
7+
description: 'Version of GHC to use. If set to "latest", it will always get the latest stable version.'
88
default: 'latest'
99
cabal-version:
1010
required: false

dist/index.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13400,12 +13400,6 @@ async function installTool(tool, version, os) {
1340013400
}
1340113401
switch (os) {
1340213402
case 'linux':
13403-
if (tool === 'ghc' && version === 'head') {
13404-
if (!(await aptBuildEssential()))
13405-
break;
13406-
await ghcupGHCHead();
13407-
break;
13408-
}
1340913403
if (tool === 'ghc' && (0, compare_versions_1.compareVersions)('8.3', version)) {
1341013404
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
1341113405
// Atm, I do not know how to check whether we are on ubuntu-20.04.
@@ -13472,11 +13466,6 @@ async function stack(version, os) {
1347213466
.then(async (g) => g.glob());
1347313467
await tc.cacheDir(stackPath, 'stack', version);
1347413468
}
13475-
async function aptBuildEssential() {
13476-
core.info(`Installing build-essential using apt-get (for ghc-head)`);
13477-
const returnCode = await exec(`sudo -- sh -c "apt-get update && apt-get -y install build-essential"`);
13478-
return returnCode === 0;
13479-
}
1348013469
async function aptLibNCurses5() {
1348113470
core.info(`Installing libcurses5 and libtinfo5 using apt-get (for ghc < 8.3)`);
1348213471
const returnCode = await exec(`sudo -- sh -c "apt-get update && apt-get -y install libncurses5 libtinfo5"`);
@@ -13545,19 +13534,6 @@ async function ghcup(tool, version, os) {
1354513534
if (returnCode === 0)
1354613535
await exec(bin, ['set', tool, version]);
1354713536
}
13548-
async function ghcupGHCHead() {
13549-
core.info(`Attempting to install ghc head using ghcup`);
13550-
const bin = await ghcupBin('linux');
13551-
const returnCode = await exec(bin, [
13552-
'install',
13553-
'ghc',
13554-
'-u',
13555-
'https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-deb9-linux-integer-simple.tar.xz?job=validate-x86_64-linux-deb9-integer-simple',
13556-
'head'
13557-
]);
13558-
if (returnCode === 0)
13559-
await exec(bin, ['set', 'ghc', 'head']);
13560-
}
1356113537
async function getChocoPath(tool, version, revision) {
1356213538
// Environment variable 'ChocolateyToolsLocation' will be added to Hosted images soon
1356313539
// fallback to C:\\tools for now until variable is available

lib/installer.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,6 @@ async function installTool(tool, version, os) {
155155
}
156156
switch (os) {
157157
case 'linux':
158-
if (tool === 'ghc' && version === 'head') {
159-
if (!(await aptBuildEssential()))
160-
break;
161-
await ghcupGHCHead();
162-
break;
163-
}
164158
if (tool === 'ghc' && (0, compare_versions_1.compareVersions)('8.3', version)) {
165159
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
166160
// Atm, I do not know how to check whether we are on ubuntu-20.04.
@@ -227,11 +221,6 @@ async function stack(version, os) {
227221
.then(async (g) => g.glob());
228222
await tc.cacheDir(stackPath, 'stack', version);
229223
}
230-
async function aptBuildEssential() {
231-
core.info(`Installing build-essential using apt-get (for ghc-head)`);
232-
const returnCode = await exec(`sudo -- sh -c "apt-get update && apt-get -y install build-essential"`);
233-
return returnCode === 0;
234-
}
235224
async function aptLibNCurses5() {
236225
core.info(`Installing libcurses5 and libtinfo5 using apt-get (for ghc < 8.3)`);
237226
const returnCode = await exec(`sudo -- sh -c "apt-get update && apt-get -y install libncurses5 libtinfo5"`);
@@ -300,19 +289,6 @@ async function ghcup(tool, version, os) {
300289
if (returnCode === 0)
301290
await exec(bin, ['set', tool, version]);
302291
}
303-
async function ghcupGHCHead() {
304-
core.info(`Attempting to install ghc head using ghcup`);
305-
const bin = await ghcupBin('linux');
306-
const returnCode = await exec(bin, [
307-
'install',
308-
'ghc',
309-
'-u',
310-
'https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-deb9-linux-integer-simple.tar.xz?job=validate-x86_64-linux-deb9-integer-simple',
311-
'head'
312-
]);
313-
if (returnCode === 0)
314-
await exec(bin, ['set', 'ghc', 'head']);
315-
}
316292
async function getChocoPath(tool, version, revision) {
317293
// Environment variable 'ChocolateyToolsLocation' will be added to Hosted images soon
318294
// fallback to C:\\tools for now until variable is available

src/installer.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,6 @@ export async function installTool(
165165

166166
switch (os) {
167167
case 'linux':
168-
if (tool === 'ghc' && version === 'head') {
169-
if (!(await aptBuildEssential())) break;
170-
171-
await ghcupGHCHead();
172-
break;
173-
}
174168
if (tool === 'ghc' && compareVersions('8.3', version)) {
175169
// Andreas, 2022-12-09: The following errors out if we are not ubuntu-20.04.
176170
// Atm, I do not know how to check whether we are on ubuntu-20.04.
@@ -244,15 +238,6 @@ async function stack(version: string, os: OS): Promise<void> {
244238
await tc.cacheDir(stackPath, 'stack', version);
245239
}
246240

247-
async function aptBuildEssential(): Promise<boolean> {
248-
core.info(`Installing build-essential using apt-get (for ghc-head)`);
249-
250-
const returnCode = await exec(
251-
`sudo -- sh -c "apt-get update && apt-get -y install build-essential"`
252-
);
253-
return returnCode === 0;
254-
}
255-
256241
async function aptLibNCurses5(): Promise<boolean> {
257242
core.info(
258243
`Installing libcurses5 and libtinfo5 using apt-get (for ghc < 8.3)`
@@ -345,19 +330,6 @@ async function ghcup(tool: Tool, version: string, os: OS): Promise<void> {
345330
if (returnCode === 0) await exec(bin, ['set', tool, version]);
346331
}
347332

348-
async function ghcupGHCHead(): Promise<void> {
349-
core.info(`Attempting to install ghc head using ghcup`);
350-
const bin = await ghcupBin('linux');
351-
const returnCode = await exec(bin, [
352-
'install',
353-
'ghc',
354-
'-u',
355-
'https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-deb9-linux-integer-simple.tar.xz?job=validate-x86_64-linux-deb9-integer-simple',
356-
'head'
357-
]);
358-
if (returnCode === 0) await exec(bin, ['set', 'ghc', 'head']);
359-
}
360-
361333
async function getChocoPath(
362334
tool: Tool,
363335
version: string,

0 commit comments

Comments
 (0)