-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Upgrade Node.js from v16.18.1 to v18.13.0 #144012
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
Changes from all commits
04c3298
d9ccb6c
0beb3ac
283887d
b5aeb71
64341f5
afd74bd
ec9a884
0fbfdc4
292f64e
d131aad
e3a175c
75c2a73
ca2a1c3
ec5b5b4
5f9df2b
93bb7a4
5e98895
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
16.18.1 | ||
18.13.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
16.18.1 | ||
18.13.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,50 +41,50 @@ interface Package { | |
const packages: Package[] = [ | ||
{ | ||
name: 're2', | ||
version: '1.17.4', | ||
version: '1.17.7', | ||
destinationPath: 'node_modules/re2/build/Release/re2.node', | ||
extractMethod: 'gunzip', | ||
archives: { | ||
'darwin-x64': { | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/darwin-x64-93.gz', | ||
sha256: '9558c5cb39622e9b3653203e772b129d6c634e7dbd7af1b244352fc1d704601f', | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/darwin-x64-108.gz', | ||
sha256: '4ed378c5a7fe6134b717afe7642254aff1ed7a881cbcaa53a012ac3efab49f99', | ||
}, | ||
'linux-x64': { | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/linux-x64-93.gz', | ||
sha256: '4d06747b266c75b6f7ced93977692c0586ce6a52924cabb569bd966378941aa1', | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/linux-x64-108.gz', | ||
sha256: '197a617ca2965f220848561afed71ff6df653f6d79910cf38e866c84ab38a236', | ||
}, | ||
|
||
// ARM builds are currently done manually as Github Actions used in upstream project | ||
// do not natively support an ARM target. | ||
|
||
// From a AWS Graviton instance running Ubuntu: | ||
// * install build-essential package | ||
// From an AWS Graviton instance running Ubuntu or a GCE T2A instance running Debian: | ||
// * install build-essential package: `sudo apt-get update` + `sudo apt install build-essential` | ||
// * install nvm and the node version used by the Kibana repository | ||
// * `npm install [email protected].4` | ||
// * `npm install [email protected].7` | ||
// * re2 will build itself on install | ||
// * `cp node_modules/re2/build/Release/re2.node > linux-arm64-$(node -e "console.log(process.versions.modules)") | ||
// * `cp node_modules/re2/build/Release/re2.node linux-arm64-$(node -e "console.log(process.versions.modules)")` | ||
// * `gzip linux-arm64-*` | ||
// * capture the sha256 with: `shasum -a 256 linux-arm64-*` | ||
// * upload the `linux-arm64-*.gz` artifact to the `yarn-prebuilt-assets` bucket in GCS using the correct version number | ||
// * upload the `linux-arm64-*.gz` artifact to the `yarn-prebuilt-artifacts` bucket in GCS using the correct version number | ||
'linux-arm64': { | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/linux-arm64-93.gz', | ||
sha256: '25409584f76f3d6ed85463d84adf094eb6e256ed1cb0b754b95bcbda6691fc26', | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/linux-arm64-108.gz', | ||
sha256: 'a690087a1a1fd9887aac1abdab68d1992600e218be10783da6d3381cca950c1a', | ||
}, | ||
|
||
// A similar process is necessary for building on ARM macs: | ||
// * bootstrap and re2 will build itself on install | ||
// * `cp node_modules/re2/build/Release/re2.node > darwin-arm64-$(node -e "console.log(process.versions.modules)") | ||
// * `cp node_modules/re2/build/Release/re2.node darwin-arm64-$(node -e "console.log(process.versions.modules)")` | ||
// * `gzip darwin-arm64-*` | ||
// * capture the sha256 with: `shasum -a 256 darwin-arm64-*` | ||
// * upload the `darwin-arm64-*.gz` artifact to the `yarn-prebuilt-assets` bucket in GCS using the correct version number | ||
// * upload the `darwin-arm64-*.gz` artifact to the `yarn-prebuilt-artifacts` bucket in GCS using the correct version number | ||
'darwin-arm64': { | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/darwin-arm64-93.gz', | ||
sha256: 'd4b708749ddef1c87019f6b80e051ed0c29ccd1de34f233c47d8dcaddf803872', | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/darwin-arm64-108.gz', | ||
sha256: '42afc32137ff5c5bebae5d68347a9786906748c2f28e06194d8950707f2ae90e', | ||
}, | ||
|
||
'win32-x64': { | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/win32-x64-93.gz', | ||
sha256: '0320d0c0385432944c6fb3c8c8fcd78d440ce5626f7618f9ec71d88e44820674', | ||
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/win32-x64-108.gz', | ||
sha256: 'ff72fe02de652262659c8e17e44a932f3c873362233756b40d1a97538d05de92', | ||
}, | ||
}, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
* 2.0. | ||
*/ | ||
|
||
import { finished } from 'stream/promises'; | ||
|
||
import tar from 'tar'; | ||
import yauzl from 'yauzl'; | ||
|
||
|
@@ -16,19 +18,20 @@ export async function untarBuffer( | |
buffer: Buffer, | ||
filter = (entry: ArchiveEntry): boolean => true, | ||
onEntry = (entry: ArchiveEntry): void => {} | ||
): Promise<unknown> { | ||
) { | ||
const deflatedStream = bufferToStream(buffer); | ||
// use tar.list vs .extract to avoid writing to disk | ||
const inflateStream = tar.list().on('entry', (entry: tar.FileStat) => { | ||
const path = entry.header.path || ''; | ||
const inflateStream = tar.list().on('entry', (entry) => { | ||
const path = entry.path || ''; | ||
if (!filter({ path })) return; | ||
streamToBuffer(entry).then((entryBuffer) => onEntry({ buffer: entryBuffer, path })); | ||
streamToBuffer(entry as unknown as NodeJS.ReadableStream).then((entryBuffer) => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
onEntry({ buffer: entryBuffer, path }) | ||
); | ||
}); | ||
|
||
return new Promise((resolve, reject) => { | ||
inflateStream.on('end', resolve).on('error', reject); | ||
deflatedStream.pipe(inflateStream); | ||
}); | ||
deflatedStream.pipe(inflateStream); | ||
|
||
await finished(inflateStream); | ||
Comment on lines
-28
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the types |
||
} | ||
|
||
export async function unzipBuffer( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing the
path
via theheader
works but isn't supported according to the types. Instead it seems that you're supposed to access it directly via the rootpath
property where it's copied to in the constructor:https://github.com/npm/node-tar/blob/26a496e5fa74eeaa0c3539511560fc181ef56557/lib/read-entry.js#L50