Skip to content

Commit

Permalink
build: update dependencies to clean up yarn audit (electron#1046)
Browse files Browse the repository at this point in the history
* build: update dependencies to clean up yarn audit

* build: use yarn resolutions to fix nan error

* spec: update tests

* fix: do not force stdc++17

* build: skip engines check for dev deps
  • Loading branch information
MarshallOfSound authored Dec 5, 2022
1 parent a328ed2 commit caa3c82
Show file tree
Hide file tree
Showing 9 changed files with 1,167 additions and 2,889 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps-test: &steps-test
nvm use 12.22.4
;;
esac
- run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile --ignore-engines
- save_cache:
paths:
- node_modules
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
steps:
- checkout
- *step-restore-cache
- run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile --ignore-engines
- run: npx @continuous-auth/[email protected]
- run: npx [email protected]

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"yargs": "^17.0.1"
},
"devDependencies": {
"@continuous-auth/semantic-release-npm": "^2.0.0",
"@continuous-auth/semantic-release-npm": "^3.0.0",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/chai": "^4.2.12",
"@types/chai-as-promised": "^7.1.3",
Expand All @@ -73,7 +73,7 @@
"chai-as-promised": "^7.1.1",
"codecov": "^3.7.2",
"cross-env": "^7.0.2",
"electron": "^12.0.2",
"electron": "^22.0.0",
"eslint": "^7.7.0",
"eslint-plugin-mocha": "^9.0.0",
"mocha": "^9.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/clang-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export async function getClangEnvironmentVars(electronVersion: string, targetArc
env: {
CC: `"${path.resolve(clangDir, 'clang')}" ${clangArgs.join(' ')}`,
CXX: `"${path.resolve(clangDir, 'clang++')}" ${clangArgs.join(' ')}`,
CFLAGS: `${cxxflags.join(' ')}`,
CXXFLAGS: `${cxxflags.join(' ')}`
},
args: gypArgs,
Expand Down
4 changes: 2 additions & 2 deletions src/sysroot-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const sysrootArchAliases = {
ia32: 'i386',
}

const SYSROOT_BASE_URL = 'https://s3.amazonaws.com/electronjs-sysroots/toolchain'
const SYSROOT_BASE_URL = 'https://dev-cdn.electronjs.org/linux-sysroots'

export async function downloadLinuxSysroot(electronVersion: string, targetArch: string): Promise<string> {
d('fetching sysroot for Electron:', electronVersion);
Expand All @@ -25,7 +25,7 @@ export async function downloadLinuxSysroot(electronVersion: string, targetArch:
const linuxArch = sysrootArchAliases[targetArch] || targetArch;
const electronSysroots = JSON.parse(await fetch(`https://raw.githubusercontent.com/electron/electron/v${electronVersion}/script/sysroots.json`, 'text'));

const { Sha1Sum: sha, Tarball: fileName } = electronSysroots[`sid_${linuxArch}`];
const { Sha1Sum: sha, Tarball: fileName } = electronSysroots[`sid_${linuxArch}`] || electronSysroots[`bullseye_${linuxArch}`];
const sysrootURL = `${SYSROOT_BASE_URL}/${sha}/${fileName}`;
let sysrootBuffer = await fetch(sysrootURL, 'buffer');

Expand Down
2 changes: 1 addition & 1 deletion test/arch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('uname()', () => {
if (process.platform !== 'win32') {
it('should return the correct arch for your system', () => {
// assumes that the tests will always be run on an x64 system 😬
expect(uname()).to.equal('x86_64');
expect(uname()).to.equal(process.arch === 'arm64' ? 'arm64' : 'x86_64');
});
}
});
Expand Down
3 changes: 3 additions & 0 deletions test/fixture/native-app1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
},
"optionalDependencies": {
"bcrypt": "3.0.6"
},
"resolutions": {
"bcrypt/nan": "2.17.0"
}
}
2 changes: 1 addition & 1 deletion test/helpers/module-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function resetTestModule(testModulePath: string, installModules = t
path.resolve(testModulePath, 'package.json')
);
if (installModules) {
await spawn('npm', ['install'], { cwd: testModulePath });
await spawn('yarn', ['install'], { cwd: testModulePath });
}
resetMSVSVersion();
}
Expand Down
4 changes: 2 additions & 2 deletions test/rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('rebuilder', () => {
skipped++;
});
await rebuilder;
expect(skipped).to.equal(6);
expect(skipped).to.equal(7);
});

it('should rebuild all modules again when disabled but the electron ABI changed', async () => {
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('rebuilder', () => {
let built = 0;
rebuilder.lifecycle.on('module-done', () => built++);
await rebuilder;
expect(built).to.equal(2);
expect(built).to.equal(3);
});
});

Expand Down
Loading

0 comments on commit caa3c82

Please sign in to comment.