Skip to content

Commit

Permalink
[jenkins] try to fix Windows build issue
Browse files Browse the repository at this point in the history
+ ts-node scripts/patch-workspaces.ts
C:\Users\genie.theia\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
scripts/patch-workspaces.ts(16,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations.
scripts/patch-workspaces.ts(17,23): error TS2307: Cannot find module 'path' or its corresponding type declarations.

Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
  • Loading branch information
marcdumais-work committed Jun 20, 2023
1 parent 8e1826d commit 7f51255
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
25 changes: 14 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -245,24 +245,27 @@ spec:
}

def buildInstaller(int sleepBetweenRetries, boolean excludeBrowser) {
int MAX_RETRY = 3
int maxRetry = 3
String buildPackageCmd = 'yarn --frozen-lockfile --force && \
yarn build:extensions && yarn download:plugins && yarn electron build && yarn electron package'

checkout scm
if (excludeBrowser) {
sh "npm install -g ts-node typescript '@types/node'"
sh "ts-node scripts/patch-workspaces.ts"
sh 'ts-node scripts/patch-workspaces.ts'
}
sh "node --version"
sh "export NODE_OPTIONS=--max_old_space_size=4096"
sh "printenv && yarn cache dir"
sh "yarn cache clean"
sh 'node --version'
sh 'export NODE_OPTIONS=--max_old_space_size=4096'
sh 'printenv && yarn cache dir'
// sh 'yarn cache clean'
try {
sh(script: 'yarn --frozen-lockfile --force && yarn build')
/* groovylint-disable-next-line LineLength */
sh(script: buildPackageCmd)
} catch(error) {
retry(MAX_RETRY) {
retry(maxRetry) {
sleep(sleepBetweenRetries)
echo "yarn failed - Retrying"
sh(script: 'yarn --frozen-lockfile --force && yarn build')
sh(script: buildPackageCmd)
}
}

Expand Down Expand Up @@ -323,14 +326,14 @@ def notarizeInstaller(String ext) {
}

def updateMetadata(String executable, String yaml, String platform, int sleepBetweenRetries) {
int MAX_RETRY = 4
int maxRetry = 4
try {
sh "export NODE_OPTIONS=--max_old_space_size=4096"
sh "yarn install --force && yarn build:prod"
sh "yarn electron update:blockmap -e ${executable}"
sh "yarn electron update:checksum -e ${executable} -y ${yaml} -p ${platform}"
} catch(error) {
retry(MAX_RETRY) {
retry(maxRetry) {
sleep(sleepBetweenRetries)
echo "yarn failed - Retrying"
sh "yarn install --force && yarn build:prod"
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"yargs": "17.2.1"
},
"scripts": {

"lint": "lerna run lint",
"lint:fix": "lerna run lint:fix",
"clean": "lerna run clean && rimraf node_modules",
Expand Down
4 changes: 2 additions & 2 deletions scripts/patch-workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import * as fs from 'fs';
import * as path from 'path';
import * as fs from 'node:fs';
import * as path from 'node:path';

execute();

Expand Down

0 comments on commit 7f51255

Please sign in to comment.