Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eng - add checksum validation support to nodejs and extensions #184877

Merged
merged 29 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
aebbee5
eng - add `checksum` validation support to `remote`
bpasero Jun 12, 2023
e7ba203
eng - wire in more `checksum` support
bpasero Jun 12, 2023
c3d2080
eng - renames for remote fetching
bpasero Jun 12, 2023
6c76b57
eng - renames for remote fetching
bpasero Jun 12, 2023
f2d5604
eng - disable verbose
bpasero Jun 12, 2023
e3ac4b1
eng - always fetch verbose in CI
bpasero Jun 12, 2023
d0a7216
eng - :lipstick:
bpasero Jun 12, 2023
1ef4450
eng - add checksums for node
bpasero Jun 12, 2023
4d5b746
eng - report checksum matches
bpasero Jun 12, 2023
acc153f
eng - fix build
bpasero Jun 12, 2023
a6620d4
eng - warn when not being able to check sum
bpasero Jun 12, 2023
2e8d72a
eng - support checksums for built in extensions
bpasero Jun 12, 2023
d362a34
eng - clear todo
bpasero Jun 12, 2023
8229c05
eng - add nodejs metadata to product.json
bpasero Jun 13, 2023
551e33d
:up: version
bpasero Jun 13, 2023
ec7d57f
:up: distro
bpasero Jun 13, 2023
8a6c193
update distro
bpasero Jun 13, 2023
67fb55d
eng - switch to checksum file
bpasero Jun 13, 2023
08be002
cleanup alpine
bpasero Jun 13, 2023
d762c99
fix alpine
bpasero Jun 13, 2023
13b5143
fix bug
bpasero Jun 13, 2023
ed75d29
Merge branch 'main' into ben/remote-checksums
bpasero Jun 13, 2023
e087908
eng - fetch all from remote
bpasero Jun 14, 2023
867f1a1
eng - :lipstick:
bpasero Jun 14, 2023
19c6c8b
eng - print checksums
bpasero Jun 14, 2023
51a8bf4
eng - fix missing import
bpasero Jun 14, 2023
2f727dd
:up: distro
bpasero Jun 14, 2023
ee1b6ae
Merge branch 'main' into ben/remote-checksums
bpasero Jun 14, 2023
96b8182
undo version change
bpasero Jun 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions build/gulpfile.reh.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const rename = require('gulp-rename');
const replace = require('gulp-replace');
const filter = require('gulp-filter');
const { getProductionDependencies } = require('./lib/dependencies');
const { assetFromGithub } = require('./lib/github');
const vfs = require('vinyl-fs');
const packageJson = require('../package.json');
const flatmap = require('gulp-flatmap');
Expand Down Expand Up @@ -155,21 +154,23 @@ if (defaultNodeTask) {
}

function nodejs(platform, arch) {
const { remote } = require('./lib/gulpRemoteSource');
const { fetchUrls, fetchGithub } = require('./lib/fetch');
const untar = require('gulp-untar');

if (arch === 'ia32') {
arch = 'x86';
}

const checksumSha256 = product.nodejs.sha256[platform][arch];

if (platform === 'win32') {
if (product.nodejsRepository) {
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from ${product.nodejsRepository}...`);
return assetFromGithub(product.nodejsRepository, nodeVersion, name => name === `win-${arch}-node.exe`)
if (product.nodejs.repository !== 'https://nodejs.org') { // custom node.js builds are currently only supported for windows
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from ${product.nodejs.repository}...`);
return fetchGithub(product.nodejs.repository, { version: product.nodejs.version, name: `win-${arch}-node.exe`, checksumSha256 })
.pipe(rename('node.exe'));
}
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from https://nodejs.org`);
return remote(`/dist/v${nodeVersion}/win-${arch}/node.exe`, { base: 'https://nodejs.org', verbose: true })
return fetchUrls(`/dist/v${nodeVersion}/win-${arch}/node.exe`, { base: 'https://nodejs.org', checksumSha256 })
.pipe(rename('node.exe'));
}

Expand All @@ -184,7 +185,7 @@ function nodejs(platform, arch) {
arch = 'armv7l';
}
log(`Downloading node.js ${nodeVersion} ${platform} ${arch} from https://nodejs.org`);
return remote(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', verbose: true })
return fetchUrls(`/dist/v${nodeVersion}/node-v${nodeVersion}-${platform}-${arch}.tar.gz`, { base: 'https://nodejs.org', checksumSha256 })
.pipe(flatmap(stream => stream.pipe(gunzip()).pipe(untar())))
.pipe(filter('**/node'))
.pipe(util.setExecutableBit('**'))
Expand Down
2 changes: 1 addition & 1 deletion build/lib/builtInExtensions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/lib/builtInExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const mkdirp = require('mkdirp');
export interface IExtensionDefinition {
name: string;
version: string;
sha256: string;
repo: string;
platforms?: string[];
metadata: {
Expand Down
Loading