Skip to content

Commit b1233b1

Browse files
NorthernMan54kkocdkodeepak1556dependabot[bot]Tyriar
authored
Node js 24 (#58)
* Port to NAPI (microsoft#644) * Port to NAPI The "5th pty bug" in microsoft#432 fixed also. * Fix help message in pty.cc * Move NAPI deps to devDependencies in package.json * Apply most of deepak1556's suggestions * Fix winpty * Fix conpty missing CloseHandle * Use unique_ptr to avoid `goto`s * Why macos failed? * fix: ci and minor cleanups * fix build failed on windows --------- Co-authored-by: deepak1556 <hop2deep@gmail.com> * build(deps): bump ip from 2.0.0 to 2.0.1 Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1. - [Commits](indutny/node-ip@v2.0.0...v2.0.1) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * api scan * fix job name * chore: fix APIScan software name (microsoft#667) * fix: comment out invalid API call (microsoft#669) * fix: assertion on node environment shutdown (microsoft#672) * Upgrade node-gyp to fix microsoft#643 and microsoft#646 (microsoft#673) * chore: remove deprecated api `process.binding` (microsoft#653) * Remove deprecated API `process.binding` Originally designed to work with ancient node.js 0.12 and io.js * Fix node `net.Socket` limitations nodejs/node#37780 * chore: migrate pipeline to use 1ES template (microsoft#676) * build(deps): bump tar from 6.2.0 to 6.2.1 Bumps [tar](https://github.com/isaacs/node-tar) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v6.2.0...v6.2.1) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * docs: add a note on Spectre-mitigated libraries (microsoft#679) * build(deps): bump braces from 3.0.2 to 3.0.3 Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](micromatch/braces@3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Include termios.h on freebsd * Get conpty.dll conditionally loading * Add conpty dlls and node headers * Add useConptyDll option * Copy conpty.dll and openconsole.exe depending on arch in postinstall * Ship third_party folder with module This needs to be there to copy over the right binary on postinstall Part of microsoft/vscode#224488 * Don't run CI for node 16 * Disable APIScan task * Fix winpty resize and reduce test flakiness * Publish third_party folder * Improve can't find conpty.dll exception message Part of microsoft/vscode#224488 * Get path of conpty.node for conpty.dll Part of microsoft/vscode#224488 * Update to newer version of conpty * Fix correct method being loaded when not using conptydll Part of microsoft/vscode#224488 * Copy right dll/exe based on npm_config_arch Part of microsoft/vscode#224488 Part of microsoft/vscode#225355 * Bring back clear impl Fixes microsoft#711 * Close piClient.hThread handle Fixes microsoft#717 * Move buffer_ to heap Resolves warning: src\win\path_util.cc(54): warning C6262: Function uses '131804' bytes of stack: exceeds /analyze:stacksize '16384'. Consider moving some data to heap. * Catch possible exceptions in ~Agent Fixes warning: deps\winpty\src\agent\Agent.cc(231): warning C4722: 'Agent::~Agent': destructor never returns, potential memory leak * yarn.lock -> package-lock.json Fixes microsoft#712 * Regenerate dependencies * Fix typo in trace log Follow up microsoft#720 * Move to compile commands on postinstall for fixing intellisense Fixes microsoft#707 * chore: use node 20 and fix build (microsoft#730) * chore: use node 20 and fix build * chore: bump macOS deployment target * spec: reduce flakyness * Revert "chore: bump macOS deployment target" This reverts commit d9d18b3. --------- Co-authored-by: deepak1556 <hop2deep@gmail.com> * chore: add new publish pipeline (microsoft#727) Also allows the CI pipeline to use the Unofficial template * fix: ensure proper cleanup of console process on shutdown * fix: publish pipeline broken APIScan task (microsoft#756) * chore: improve cleanup with useConptyDll mode * chore: update tests * chore: auto-publish beta versions (microsoft#757) * chore: work around blocked release integration (microsoft#758) * Update to conpty v1.22 (microsoft#759) * Update to conpty v1.22 Fixes microsoft#490 * Add logs to show the problem happening * spec: increase exit delay * refactor: input and output handling with conpty * Close the input read and output write handles after creating the client process * Call ReleasePseudoConsole after creating the client process which will cause the output read handle to close when there is no more data from the session * For manual termination via Kill, we close the input write handle and call into ClosePseudoConsole, we should then drain the output handle NB: ideally draining the output handle should have been enough to cause the client process to close but it doesn't work, we call TerminateProcess to fix this case. * chore: restore legacy conpty path --------- Co-authored-by: deepak1556 <hop2deep@gmail.com> * chore: remove old publishing stage (microsoft#761) * fix: restore conpty non-dll path (microsoft#766) * chore: add BinSkim flags to winpty (microsoft#767) * chore: add BinSkim flags to winpty * Apply PR feedback * conpty@1.22.250204002 * Change buffer size to 128KiB Fixes microsoft#765 * chore: match trigger with perf-bot's (microsoft#773) * chore: match exclude with latest conpty (microsoft#774) * chore: use folder wildcard (microsoft#775) * Revert "conpty@1.22.250204002" This reverts commit 247ae7d. * fix: gate conpty-exclusive call behind conpty check (microsoft#778) * NodeJS-24 * Node 20 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: kkocdko <31189892+kkocdko@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Co-authored-by: SteVen Batten <sbatten@microsoft.com> Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Co-authored-by: jpcastberg <jpcastberg@gmail.com>
1 parent e04bd02 commit b1233b1

18 files changed

Lines changed: 264 additions & 246 deletions

.github/workflows/Prepare prebuild environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
# Order reversed so newer versions are built first - Add new versions to the front (fail fast)
1818
# electronBuildTargets version 28 has an issue
1919
oldNodeBuildTargets: -t 17.0.1
20-
currentNodeBuildTargets: -t 23.0.0 -t 22.0.0 -t 21.0.0 -t 20.0.0 -t 19.0.0 -t 18.0.0
20+
currentNodeBuildTargets: -t 24.0.0 -t 23.0.0 -t 22.0.0 -t 21.0.0 -t 20.0.0 -t 19.0.0 -t 18.0.0
2121
oldElectronBuildTargets: -t 19.0.0 -t 18.0.0 -t 17.0.0
2222
electronBuildTargets: -t 29.0.0 -t 27.0.0 -t 26.0.0 -t 25.0.0 -t 24.0.0 -t 23.0.0 -t 22.0.0 -t 21.0.0 -t 20.0.0
2323
winIA32nodeBuildTargets: -t 17.0.1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ fixtures/space folder/
1414
prebuilds
1515
.vscode/ipch/
1616
.idea
17+
yarn.lock

.prebuild/Dockerfile.debian

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN [ "$(uname -m)" = "x86_64" ] && apt-get install -y g++-multilib gcc-multilib
1212

1313
## Linux 32 bit support was dropped with NodeJS 18.4.0
1414

15-
ENV NODE_VERSION 18.18.2
15+
ENV NODE_VERSION=18.18.2
1616

1717
RUN case "${QEMU_ARCH}" in \
1818
x86_64) NODE_ARCH='x64';; \

.prebuild/Dockerfile.oldDebian

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN wget -q https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz && tar xf
2121
&& cd Python-3.6.15 && ./configure --prefix=/usr --enable-optimizations --enable-shared && make -j8 build_all \
2222
&& make -j8 altinstall && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 50
2323

24-
ENV NODE_VERSION 16.20.2
24+
ENV NODE_VERSION=16.20.2
2525

2626
RUN case "${QEMU_ARCH}" in \
2727
x86_64) NODE_ARCH='x64';; \

azure-pipelines.yml

Lines changed: 14 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -24,164 +24,49 @@ extends:
2424
pool:
2525
name: 1es-oss-ubuntu-22.04-x64
2626
os: Linux
27-
strategy:
28-
matrix:
29-
node_18_x:
30-
node_version: 18.x
3127
steps:
3228
- task: NodeTool@0
3329
inputs:
34-
versionSpec: $(node_version)
30+
versionSpec: 20.x
3531
displayName: 'Install Node.js'
36-
- script: |
37-
npm i
32+
- script: npm ci
3833
displayName: 'Install dependencies and build'
39-
- script: |
40-
npm test
34+
- script: npm test
4135
displayName: 'Test'
42-
- script: |
43-
npm run lint
36+
- script: npm run lint
4437
displayName: 'Lint'
4538

4639
- job: macOS
4740
pool:
4841
name: Azure Pipelines
49-
vmImage: 'macOS-latest'
42+
vmImage: 'macOS-14'
5043
os: macOS
51-
strategy:
52-
matrix:
53-
node_18_x:
54-
node_version: 18.x
5544
steps:
5645
- task: NodeTool@0
5746
inputs:
58-
versionSpec: $(node_version)
47+
versionSpec: 20.x
5948
displayName: 'Install Node.js'
60-
- script: |
61-
python3 -m pip install setuptools
49+
- script: python3 -m pip install setuptools
6250
displayName: Install setuptools (macOS)
63-
- script: |
64-
npm i
51+
- script: npm ci
6552
displayName: 'Install dependencies and build'
66-
- script: |
67-
npm test
53+
- script: npm test
6854
displayName: 'Test'
69-
- script: |
70-
npm run lint
55+
- script: npm run lint
7156
displayName: 'Lint'
7257

7358
- job: Windows
7459
pool:
7560
name: 1es-oss-windows-2022-x64
7661
os: Windows
77-
strategy:
78-
matrix:
79-
node_18_x:
80-
node_version: 18.x
8162
steps:
8263
- task: NodeTool@0
8364
inputs:
84-
versionSpec: $(node_version)
65+
versionSpec: 20.x
8566
displayName: 'Install Node.js'
86-
- script: |
87-
npm i
67+
- script: npm ci
8868
displayName: 'Install dependencies and build'
89-
- script: |
90-
npm test
69+
- script: npm test
9170
displayName: 'Test'
92-
- script: |
93-
npm run lint
71+
- script: npm run lint
9472
displayName: 'Lint'
95-
96-
# - job: APIScan
97-
# dependsOn: []
98-
# pool:
99-
# name: 1es-oss-windows-2022-x64
100-
# os: Windows
101-
# strategy:
102-
# matrix:
103-
# node_18_x:
104-
# node_version: 18.x
105-
# steps:
106-
# - task: NodeTool@0
107-
# inputs:
108-
# versionSpec: $(node_version)
109-
# displayName: 'Install Node.js'
110-
# - pwsh: |
111-
# $includes = @'
112-
# {
113-
# 'target_defaults': {
114-
# 'conditions': [
115-
# ['OS=="win"', {
116-
# 'msvs_settings': {
117-
# 'VCCLCompilerTool': {
118-
# 'AdditionalOptions': [
119-
# '/Zi',
120-
# '/FS'
121-
# ],
122-
# },
123-
# 'VCLinkerTool': {
124-
# 'AdditionalOptions': [
125-
# '/profile'
126-
# ]
127-
# }
128-
# }
129-
# }]
130-
# ]
131-
# }
132-
# }
133-
# '@
134-
135-
# if (!(Test-Path "~/.gyp")) {
136-
# mkdir "~/.gyp"
137-
# echo $includes > "~/.gyp/include.gypi"
138-
# }
139-
# displayName: Create include.gypi
140-
# - script: |
141-
# npm i
142-
# displayName: 'Install dependencies and build'
143-
144-
# - task: APIScan@2
145-
# inputs:
146-
# softwareFolder: $(Build.SourcesDirectory)\build\Release
147-
# softwareName: 'vscode-node-pty'
148-
# softwareVersionNum: '1'
149-
# isLargeApp: false
150-
# toolVersion: 'Latest'
151-
# displayName: Run ApiScan
152-
# condition: succeeded()
153-
# env:
154-
# AzureServicesAuthConnectionString: $(apiscan-connectionstring)
155-
156-
# - task: PublishSecurityAnalysisLogs@3
157-
# inputs:
158-
# ArtifactName: CodeAnalysisLogs
159-
# ArtifactType: Container
160-
# PublishProcessedResults: false
161-
# AllTools: true
162-
163-
- stage: Release
164-
dependsOn: Build
165-
jobs:
166-
- job: Release
167-
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
168-
# Output artifact to produce SBOM and to run SDL checks
169-
templateContext:
170-
outputs:
171-
- output: pipelineArtifact
172-
targetPath: $(Build.SourcesDirectory)
173-
artifactName: drop
174-
pool:
175-
name: 1es-oss-ubuntu-22.04-x64
176-
os: Linux
177-
steps:
178-
- task: NodeTool@0
179-
inputs:
180-
versionSpec: '18.x'
181-
displayName: 'Install Node.js'
182-
- script: |
183-
npm i
184-
displayName: 'Install dependencies and build'
185-
- script: |
186-
NPM_AUTH_TOKEN="$(NPM_AUTH_TOKEN)" node ./scripts/publish.js
187-
displayName: 'Publish to npm'

build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
set -e
77

88
export oldNodeBuildTargets='-t 17.0.1 -t 18.0.0'
9-
export nodeBuildTargets='-t 23.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0'
9+
export nodeBuildTargets='-t 24.0.0 -t 23.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0'
1010

1111
export oldElectronBuildTargets='-t 17.0.0 -t 18.0.0 -t 19.0.0'
1212
export electronBuildTargets='-t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 -t 24.0.0 -t 25.0.0 -t 26.0.0 -t 27.0.0 -t 28.0.0'
@@ -45,8 +45,10 @@ export CMD="./.prebuild/build.sh .prebuild/prebuild.js ${nodeBuildTargets}"
4545
echo
4646
echo "--------------------------- $QEMU_ARCH - $DOCKERFILE -------------------------------"
4747
echo
48-
# docker build -f .prebuild/$DOCKERFILE --build-arg QEMU_ARCH=${QEMU_ARCH} -t multiarch-build .
49-
# docker run --rm -v $(pwd):/node-pty multiarch-build bash -c "$CMD"
48+
docker build -f .prebuild/$DOCKERFILE --build-arg QEMU_ARCH=${QEMU_ARCH} -t multiarch-build .
49+
docker run --rm -v $(pwd):/node-pty multiarch-build bash -c "$CMD"
50+
51+
exit 1
5052

5153
#docker run -v $(pwd):/node-pty multiarch-build ./.prebuild/build.sh .prebuild/prebuild.js ${nodeBuildTargets}
5254
#docker run --rm -v $(pwd):/node-pty multiarch-build ./.prebuild/build.sh .prebuild/prebuildify.js ${nodeBuildTargets}

deps/winpty/src/winpty.gyp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Add the 'src/gen' directory to the include path and force gyp to
2525
# run the script (re)generating the version header.
2626
'<!(cmd /c "cd shared && UpdateGenVersion.bat <(WINPTY_COMMIT_HASH)")',
27-
],
27+
]
2828
},
2929
'targets' : [
3030
{
@@ -41,12 +41,26 @@
4141
'-lshell32',
4242
'-luser32',
4343
],
44+
'msvs_configuration_attributes': {
45+
'SpectreMitigation': 'Spectre'
46+
},
4447
'msvs_settings': {
4548
# Specify this setting here to override a setting from somewhere
4649
# else, such as node's common.gypi.
4750
'VCCLCompilerTool': {
4851
'ExceptionHandling': '1', # /EHsc
52+
'AdditionalOptions': [
53+
'/guard:cf',
54+
'/w34244',
55+
'/w34267',
56+
'/ZH:SHA_256'
57+
]
4958
},
59+
'VCLinkerTool': {
60+
'AdditionalOptions': [
61+
'/guard:cf'
62+
]
63+
}
5064
},
5165
'sources' : [
5266
'agent/Agent.h',
@@ -129,12 +143,26 @@
129143
'-ladvapi32',
130144
'-luser32',
131145
],
146+
'msvs_configuration_attributes': {
147+
'SpectreMitigation': 'Spectre'
148+
},
132149
'msvs_settings': {
133150
# Specify this setting here to override a setting from somewhere
134151
# else, such as node's common.gypi.
135152
'VCCLCompilerTool': {
136153
'ExceptionHandling': '1', # /EHsc
154+
'AdditionalOptions': [
155+
'/guard:cf',
156+
'/w34244',
157+
'/w34267',
158+
'/ZH:SHA_256'
159+
]
137160
},
161+
'VCLinkerTool': {
162+
'AdditionalOptions': [
163+
'/guard:cf'
164+
]
165+
}
138166
},
139167
'sources' : [
140168
'include/winpty.h',

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@
6060
"@typescript-eslint/parser": "^2.27.0",
6161
"cross-env": "^5.1.4",
6262
"eslint": "^6.8.0",
63-
"node-abi": "^3.71.0",
6463
"mocha": "10",
64+
"node-abi": "^3.75.0",
6565
"node-gyp": "=10.1.0",
6666
"prebuild": "^13.0.1",
6767
"prebuildify": "^5.0.1",
6868
"ps-list": "^6.0.0",
6969
"typescript": "^3.8.3"
7070
}
71-
}
71+
}

0 commit comments

Comments
 (0)