virtualshell 1.1.4__tar.gz → 1.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- virtualshell-1.1.6/.github/workflows/test_build-only.yml +256 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/.github/workflows/workflow.yml +40 -22
- {virtualshell-1.1.4 → virtualshell-1.1.6}/.gitignore +3 -1
- virtualshell-1.1.6/CMakeLists.txt +128 -0
- virtualshell-1.1.6/CMakeSettings.json +15 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/PKG-INFO +151 -157
- virtualshell-1.1.6/README.md +253 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/helpers.hpp +34 -6
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/virtual_shell.hpp +4 -4
- virtualshell-1.1.6/cpp/lib/vs_shm/CMakeLists.txt +92 -0
- {virtualshell-1.1.4/win_pwsh_dll → virtualshell-1.1.6/cpp/lib/vs_shm}/src/object_serializer.cpp +5 -3
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/src/binder.cpp +1 -1
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/src/py_proxy.cpp +5 -1
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/src/virtual_shell.cpp +17 -22
- {virtualshell-1.1.4 → virtualshell-1.1.6}/pyproject.toml +4 -3
- virtualshell-1.1.6/src/virtualshell/__init__.py +57 -0
- virtualshell-1.1.6/src/virtualshell/_globals.py +11 -0
- virtualshell-1.1.6/src/virtualshell/_version.py +1 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/src/virtualshell/shell.py +3 -1
- {virtualshell-1.1.4 → virtualshell-1.1.6}/src/virtualshell/zero_copy_bridge_shell.py +75 -34
- virtualshell-1.1.4/CMakeLists.txt +0 -76
- virtualshell-1.1.4/README.md +0 -259
- virtualshell-1.1.4/src/virtualshell/__init__.py +0 -44
- virtualshell-1.1.4/src/virtualshell/_version.py +0 -1
- virtualshell-1.1.4/src/virtualshell/win_pwsh.dll +0 -0
- virtualshell-1.1.4/win_pwsh_dll/CMakeLists.txt +0 -79
- {virtualshell-1.1.4 → virtualshell-1.1.6}/LICENSE +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/bench/bench.csv +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/bench/bench.json +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/bench/vs_bench.py +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/cmd_state.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/config.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/dev_debug.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/execution_result.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/io_pump.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/powershell_process.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/process.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/py_bridge.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/py_proxy.hpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/include/timeout_watcher.hpp +0 -0
- {virtualshell-1.1.4/win_pwsh_dll → virtualshell-1.1.6/cpp/lib/vs_shm}/include/vs_shm.h +0 -0
- {virtualshell-1.1.4/win_pwsh_dll → virtualshell-1.1.6/cpp/lib/vs_shm}/src/vs_shm.cpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/src/io_pump.cpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/cpp/src/powershell_process.cpp +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/src/virtualshell/errors.py +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/src/virtualshell/generate_psobject.py +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/src/virtualshell/get-session.ps1 +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/src/virtualshell/save-session.ps1 +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/src/virtualshell/zero_copy_bridge.ps1 +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Getting started/Getting started.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Getting started/Installation.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Getting started/Quickstart.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Help/FAQ.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Help/Troubleshooting.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Home.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Project/Benchmarks.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Project/Changelog.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Project/Design & Architecture.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/API Overview.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Asynchronous Execution.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Configuration.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Error Handling.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Performance Tips.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Running Scripts.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Security Notes.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Synchronous Execution.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/Zero-Copy Bridge.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/generate_psobject.md +0 -0
- {virtualshell-1.1.4 → virtualshell-1.1.6}/wiki/Usage/make_proxy.md +0 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
name: Test Build-Only
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
target:
|
|
7
|
+
description: "Test build"
|
|
8
|
+
required: true
|
|
9
|
+
default: "*"
|
|
10
|
+
type: choice
|
|
11
|
+
options: ["*","linux-x86_64", "linux-aarch64", "macos", "windows"]
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: test-build-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
wheels-linux-x86_64:
|
|
19
|
+
if: inputs.target == '*' || inputs.target == 'linux-x86_64'
|
|
20
|
+
name: Wheels (Linux x86_64)
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
include:
|
|
26
|
+
- python: "cp312-*"
|
|
27
|
+
label: "cp312"
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- name: Set up Python (host)
|
|
34
|
+
uses: actions/setup-python@v5
|
|
35
|
+
with:
|
|
36
|
+
python-version: "3.12"
|
|
37
|
+
|
|
38
|
+
- name: Install cibuildwheel
|
|
39
|
+
run: |
|
|
40
|
+
python -m pip install -U pip
|
|
41
|
+
python -m pip install cibuildwheel
|
|
42
|
+
|
|
43
|
+
- name: Build wheels with cibuildwheel (manylinux x86_64)
|
|
44
|
+
env:
|
|
45
|
+
CIBW_BUILD: ${{ matrix.python }}
|
|
46
|
+
CIBW_ARCHS_LINUX: "x86_64"
|
|
47
|
+
CIBW_SKIP: "*-musllinux_* *-manylinux_i686"
|
|
48
|
+
CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
|
|
49
|
+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
|
|
50
|
+
|
|
51
|
+
CMAKE_GENERATOR: Ninja
|
|
52
|
+
PYBIND11_FINDPYTHON: "ON"
|
|
53
|
+
CIBW_BEFORE_BUILD_LINUX: "python -m pip install ninja"
|
|
54
|
+
run: |
|
|
55
|
+
python -m cibuildwheel --platform linux --output-dir wheelhouse .
|
|
56
|
+
|
|
57
|
+
- name: Upload wheels (Linux x86_64)
|
|
58
|
+
uses: actions/upload-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: wheels-linux-x86_64-${{ matrix.label }}-attempt${{ github.run_attempt }}
|
|
61
|
+
path: wheelhouse/*.whl
|
|
62
|
+
overwrite: true
|
|
63
|
+
|
|
64
|
+
wheels-linux-aarch64:
|
|
65
|
+
if: inputs.target == '*' || inputs.target == 'linux-aarch64'
|
|
66
|
+
name: Wheels (Linux aarch64)
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
strategy:
|
|
69
|
+
fail-fast: false
|
|
70
|
+
matrix:
|
|
71
|
+
include:
|
|
72
|
+
- python: "cp312-*"
|
|
73
|
+
label: "cp312"
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v4
|
|
76
|
+
with:
|
|
77
|
+
fetch-depth: 0
|
|
78
|
+
|
|
79
|
+
- name: Set up QEMU for cross-arch Docker
|
|
80
|
+
uses: docker/setup-qemu-action@v3
|
|
81
|
+
with:
|
|
82
|
+
platforms: arm64
|
|
83
|
+
|
|
84
|
+
- name: Set up Python (host)
|
|
85
|
+
uses: actions/setup-python@v5
|
|
86
|
+
with:
|
|
87
|
+
python-version: "3.12"
|
|
88
|
+
|
|
89
|
+
- name: Install cibuildwheel
|
|
90
|
+
run: |
|
|
91
|
+
python -m pip install -U pip
|
|
92
|
+
python -m pip install cibuildwheel
|
|
93
|
+
|
|
94
|
+
- name: Build wheels with cibuildwheel (manylinux aarch64 via QEMU)
|
|
95
|
+
env:
|
|
96
|
+
CIBW_BUILD: ${{ matrix.python }}
|
|
97
|
+
CIBW_ARCHS_LINUX: "aarch64"
|
|
98
|
+
CIBW_SKIP: "*-musllinux_*"
|
|
99
|
+
CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
|
|
100
|
+
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
|
|
101
|
+
CMAKE_GENERATOR: Ninja
|
|
102
|
+
PYBIND11_FINDPYTHON: "ON"
|
|
103
|
+
CIBW_BEFORE_BUILD_LINUX: "python -m pip install ninja"
|
|
104
|
+
run: |
|
|
105
|
+
python -m cibuildwheel --platform linux --output-dir wheelhouse .
|
|
106
|
+
|
|
107
|
+
- name: Upload wheels (Linux aarch64)
|
|
108
|
+
uses: actions/upload-artifact@v4
|
|
109
|
+
with:
|
|
110
|
+
name: wheels-linux-aarch64-${{ matrix.label }}-attempt${{ github.run_attempt }}
|
|
111
|
+
path: wheelhouse/*.whl
|
|
112
|
+
overwrite: true
|
|
113
|
+
|
|
114
|
+
wheels-macos:
|
|
115
|
+
if: inputs.target == '*' || inputs.target == 'macos'
|
|
116
|
+
name: Wheels (universal2 macOS)
|
|
117
|
+
runs-on: macos-latest
|
|
118
|
+
strategy:
|
|
119
|
+
fail-fast: false
|
|
120
|
+
matrix:
|
|
121
|
+
include:
|
|
122
|
+
- python: "cp312-*"
|
|
123
|
+
label: "cp312"
|
|
124
|
+
|
|
125
|
+
steps:
|
|
126
|
+
- uses: actions/checkout@v4
|
|
127
|
+
with:
|
|
128
|
+
fetch-depth: 0
|
|
129
|
+
|
|
130
|
+
- name: Set up Python (host)
|
|
131
|
+
uses: actions/setup-python@v5
|
|
132
|
+
with:
|
|
133
|
+
python-version: "3.12"
|
|
134
|
+
|
|
135
|
+
- name: Install cibuildwheel
|
|
136
|
+
run: |
|
|
137
|
+
python -m pip install -U pip
|
|
138
|
+
python -m pip install cibuildwheel
|
|
139
|
+
|
|
140
|
+
- name: Build wheels with cibuildwheel (universal2)
|
|
141
|
+
env:
|
|
142
|
+
CIBW_BUILD: ${{ matrix.python }}
|
|
143
|
+
CIBW_ARCHS_MACOS: "universal2"
|
|
144
|
+
CIBW_MACOSX_DEPLOYMENT_TARGET: "11.0"
|
|
145
|
+
CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
|
|
146
|
+
CIBW_BUILD_VERBOSITY: "1"
|
|
147
|
+
CIBW_BEFORE_BUILD_MACOS: "python -m pip install ninja"
|
|
148
|
+
|
|
149
|
+
CMAKE_ARGS: >-
|
|
150
|
+
-G Ninja
|
|
151
|
+
-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64
|
|
152
|
+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
|
|
153
|
+
|
|
154
|
+
PYBIND11_FINDPYTHON: "ON"
|
|
155
|
+
CMAKE_GENERATOR: "Ninja"
|
|
156
|
+
CMAKE_OSX_ARCHITECTURES: "arm64;x86_64"
|
|
157
|
+
CMAKE_OSX_DEPLOYMENT_TARGET: "11.0"
|
|
158
|
+
MACOSX_DEPLOYMENT_TARGET: "11.0"
|
|
159
|
+
|
|
160
|
+
run: |
|
|
161
|
+
python -m cibuildwheel --platform macos --output-dir wheelhouse .
|
|
162
|
+
|
|
163
|
+
- name: Upload wheels (macOS)
|
|
164
|
+
uses: actions/upload-artifact@v4
|
|
165
|
+
with:
|
|
166
|
+
name: wheels-macos-${{ matrix.label }}-attempt${{ github.run_attempt }}
|
|
167
|
+
path: wheelhouse/*.whl
|
|
168
|
+
overwrite: true
|
|
169
|
+
|
|
170
|
+
wheels-windows:
|
|
171
|
+
if: inputs.target == '*' || inputs.target == 'windows'
|
|
172
|
+
name: Wheels (Windows x64)
|
|
173
|
+
runs-on: windows-latest
|
|
174
|
+
strategy:
|
|
175
|
+
fail-fast: false
|
|
176
|
+
matrix:
|
|
177
|
+
python: ["cp312-win_amd64"]
|
|
178
|
+
|
|
179
|
+
steps:
|
|
180
|
+
- uses: actions/checkout@v4
|
|
181
|
+
with:
|
|
182
|
+
fetch-depth: 0
|
|
183
|
+
|
|
184
|
+
- name: Set up Python (host)
|
|
185
|
+
uses: actions/setup-python@v5
|
|
186
|
+
with:
|
|
187
|
+
python-version: "3.12"
|
|
188
|
+
|
|
189
|
+
- name: Install cibuildwheel
|
|
190
|
+
shell: pwsh
|
|
191
|
+
run: |
|
|
192
|
+
py -3 -m pip install -U pip
|
|
193
|
+
py -3 -m pip install -U cibuildwheel
|
|
194
|
+
|
|
195
|
+
- name: Build wheels with cibuildwheel (MSVC)
|
|
196
|
+
shell: cmd
|
|
197
|
+
env:
|
|
198
|
+
CIBW_BUILD: ${{ matrix.python }}
|
|
199
|
+
CIBW_SKIP: "*-win32"
|
|
200
|
+
CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
|
|
201
|
+
CIBW_BUILD_VERBOSITY: "1"
|
|
202
|
+
CIBW_ENVIRONMENT_WINDOWS: >
|
|
203
|
+
CMAKE_GENERATOR="Visual Studio 17 2022"
|
|
204
|
+
CMAKE_GENERATOR_PLATFORM=x64
|
|
205
|
+
SKBUILD_CMAKE_GENERATOR="Visual Studio 17 2022"
|
|
206
|
+
PYBIND11_FINDPYTHON=ON
|
|
207
|
+
CMAKE_BUILD_TYPE=Release
|
|
208
|
+
run: |
|
|
209
|
+
@echo on
|
|
210
|
+
|
|
211
|
+
REM Find latest VS and load MSVC environment
|
|
212
|
+
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set VSINSTALL=%%i
|
|
213
|
+
if not defined VSINSTALL (
|
|
214
|
+
echo ERROR: Visual Studio with C++ tools not found.
|
|
215
|
+
exit /b 1
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -arch=x64
|
|
219
|
+
|
|
220
|
+
REM Make sure stale vars don't force wrong compiler
|
|
221
|
+
set CC=
|
|
222
|
+
set CXX=
|
|
223
|
+
set CMAKE_C_COMPILER=
|
|
224
|
+
set CMAKE_CXX_COMPILER=
|
|
225
|
+
|
|
226
|
+
REM Debug: verify we are on MSVC
|
|
227
|
+
where cl
|
|
228
|
+
cl /Bv
|
|
229
|
+
where cmake
|
|
230
|
+
where ninja
|
|
231
|
+
|
|
232
|
+
py -3 -m cibuildwheel --output-dir wheelhouse .
|
|
233
|
+
|
|
234
|
+
- name: Upload wheels (Windows)
|
|
235
|
+
uses: actions/upload-artifact@v4
|
|
236
|
+
with:
|
|
237
|
+
name: wheels-windows-${{ matrix.python }}-attempt${{ github.run_attempt }}
|
|
238
|
+
path: wheelhouse\*.whl
|
|
239
|
+
overwrite: true
|
|
240
|
+
|
|
241
|
+
sdist:
|
|
242
|
+
runs-on: ubuntu-latest
|
|
243
|
+
steps:
|
|
244
|
+
- uses: actions/checkout@v4
|
|
245
|
+
with: { fetch-depth: 0 }
|
|
246
|
+
- uses: actions/setup-python@v5
|
|
247
|
+
with: { python-version: "3.12" }
|
|
248
|
+
- run: |
|
|
249
|
+
python -m pip install -U pip build twine
|
|
250
|
+
python -m build --sdist --outdir dist .
|
|
251
|
+
python -m twine check dist/*
|
|
252
|
+
- uses: actions/upload-artifact@v4
|
|
253
|
+
with:
|
|
254
|
+
name: sdist
|
|
255
|
+
path: dist/*.tar.gz
|
|
256
|
+
|
|
@@ -171,24 +171,21 @@ jobs:
|
|
|
171
171
|
env:
|
|
172
172
|
CIBW_BUILD: ${{ matrix.python }}
|
|
173
173
|
CIBW_ARCHS_MACOS: "universal2"
|
|
174
|
-
CIBW_MACOSX_DEPLOYMENT_TARGET: "11.0"
|
|
174
|
+
CIBW_MACOSX_DEPLOYMENT_TARGET: "11.0"
|
|
175
175
|
CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
|
|
176
176
|
CIBW_BUILD_VERBOSITY: "1"
|
|
177
177
|
CIBW_BEFORE_BUILD_MACOS: "python -m pip install ninja"
|
|
178
178
|
|
|
179
|
-
# ---- Tving CMake til universal2 via både CMAKE_ARGS og env ----
|
|
180
|
-
# skbuild-core leser CMAKE_ARGS direkte og sender videre til CMake.
|
|
181
179
|
CMAKE_ARGS: >-
|
|
182
180
|
-G Ninja
|
|
183
181
|
-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64
|
|
184
182
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
|
|
185
183
|
|
|
186
|
-
# Disse brukes i tillegg (belt and suspenders)
|
|
187
184
|
PYBIND11_FINDPYTHON: "ON"
|
|
188
185
|
CMAKE_GENERATOR: "Ninja"
|
|
189
186
|
CMAKE_OSX_ARCHITECTURES: "arm64;x86_64"
|
|
190
187
|
CMAKE_OSX_DEPLOYMENT_TARGET: "11.0"
|
|
191
|
-
MACOSX_DEPLOYMENT_TARGET: "11.0"
|
|
188
|
+
MACOSX_DEPLOYMENT_TARGET: "11.0"
|
|
192
189
|
|
|
193
190
|
run: |
|
|
194
191
|
python -m cibuildwheel --platform macos --output-dir wheelhouse .
|
|
@@ -207,6 +204,7 @@ jobs:
|
|
|
207
204
|
fail-fast: false
|
|
208
205
|
matrix:
|
|
209
206
|
python: ["cp38-win_amd64", "cp39-win_amd64", "cp310-win_amd64", "cp311-win_amd64", "cp312-win_amd64", "cp313-win_amd64"]
|
|
207
|
+
|
|
210
208
|
steps:
|
|
211
209
|
- uses: actions/checkout@v4
|
|
212
210
|
with:
|
|
@@ -218,20 +216,47 @@ jobs:
|
|
|
218
216
|
python-version: "3.12"
|
|
219
217
|
|
|
220
218
|
- name: Install cibuildwheel
|
|
219
|
+
shell: pwsh
|
|
221
220
|
run: |
|
|
222
221
|
py -3 -m pip install -U pip
|
|
223
|
-
py -3 -m pip install cibuildwheel
|
|
222
|
+
py -3 -m pip install -U cibuildwheel
|
|
224
223
|
|
|
225
224
|
- name: Build wheels with cibuildwheel (MSVC)
|
|
225
|
+
shell: cmd
|
|
226
226
|
env:
|
|
227
227
|
CIBW_BUILD: ${{ matrix.python }}
|
|
228
228
|
CIBW_SKIP: "*-win32"
|
|
229
229
|
CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
|
|
230
|
+
CIBW_BUILD_VERBOSITY: "1"
|
|
230
231
|
CIBW_ENVIRONMENT_WINDOWS: >
|
|
231
232
|
CMAKE_GENERATOR="Visual Studio 17 2022"
|
|
232
|
-
CMAKE_GENERATOR_PLATFORM=
|
|
233
|
+
CMAKE_GENERATOR_PLATFORM=x64
|
|
234
|
+
SKBUILD_CMAKE_GENERATOR="Visual Studio 17 2022"
|
|
233
235
|
PYBIND11_FINDPYTHON=ON
|
|
236
|
+
CMAKE_BUILD_TYPE=Release
|
|
234
237
|
run: |
|
|
238
|
+
@echo on
|
|
239
|
+
|
|
240
|
+
REM Find latest VS and load MSVC environment
|
|
241
|
+
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set VSINSTALL=%%i
|
|
242
|
+
if not defined VSINSTALL (
|
|
243
|
+
echo ERROR: Visual Studio with C++ tools not found.
|
|
244
|
+
exit /b 1
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -arch=x64
|
|
248
|
+
|
|
249
|
+
set CC=
|
|
250
|
+
set CXX=
|
|
251
|
+
set CMAKE_C_COMPILER=
|
|
252
|
+
set CMAKE_CXX_COMPILER=
|
|
253
|
+
|
|
254
|
+
REM Debug: verify we are on MSVC
|
|
255
|
+
where cl
|
|
256
|
+
cl /Bv
|
|
257
|
+
where cmake
|
|
258
|
+
where ninja
|
|
259
|
+
|
|
235
260
|
py -3 -m cibuildwheel --output-dir wheelhouse .
|
|
236
261
|
|
|
237
262
|
- name: Upload wheels (Windows)
|
|
@@ -270,8 +295,14 @@ jobs:
|
|
|
270
295
|
needs: [wheels-linux-x86_64, wheels-linux-aarch64, wheels-macos, wheels-windows, sdist]
|
|
271
296
|
runs-on: ubuntu-latest
|
|
272
297
|
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
|
|
298
|
+
|
|
273
299
|
permissions:
|
|
274
300
|
contents: read
|
|
301
|
+
id-token: write
|
|
302
|
+
|
|
303
|
+
environment:
|
|
304
|
+
name: release
|
|
305
|
+
url: https://pypi.org/p/virtualshell
|
|
275
306
|
|
|
276
307
|
steps:
|
|
277
308
|
- name: Download wheel artifacts
|
|
@@ -293,15 +324,6 @@ jobs:
|
|
|
293
324
|
find dist_in -type f \( -name "*.whl" -o -name "*.tar.gz" \) -exec cp {} dist/ \;
|
|
294
325
|
ls -l dist
|
|
295
326
|
|
|
296
|
-
- name: Ensure dists exist
|
|
297
|
-
run: |
|
|
298
|
-
shopt -s nullglob
|
|
299
|
-
files=(dist/*.whl dist/*.tar.gz)
|
|
300
|
-
if [ ${#files[@]} -eq 0 ]; then
|
|
301
|
-
echo "No distributions found to publish."
|
|
302
|
-
exit 1
|
|
303
|
-
fi
|
|
304
|
-
|
|
305
327
|
- name: Twine check
|
|
306
328
|
run: |
|
|
307
329
|
python -m pip install -U twine
|
|
@@ -316,7 +338,7 @@ jobs:
|
|
|
316
338
|
echo "repo=pypi" >> $GITHUB_OUTPUT
|
|
317
339
|
fi
|
|
318
340
|
|
|
319
|
-
- name: Publish to TestPyPI (
|
|
341
|
+
- name: Publish to TestPyPI (trusted)
|
|
320
342
|
if: steps.target.outputs.repo == 'testpypi'
|
|
321
343
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
322
344
|
with:
|
|
@@ -324,15 +346,11 @@ jobs:
|
|
|
324
346
|
packages-dir: dist
|
|
325
347
|
skip-existing: true
|
|
326
348
|
verbose: true
|
|
327
|
-
user: __token__
|
|
328
|
-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
329
349
|
|
|
330
|
-
- name: Publish to PyPI (
|
|
350
|
+
- name: Publish to PyPI (trusted)
|
|
331
351
|
if: steps.target.outputs.repo == 'pypi'
|
|
332
352
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
333
353
|
with:
|
|
334
354
|
packages-dir: dist
|
|
335
355
|
skip-existing: false
|
|
336
356
|
verbose: true
|
|
337
|
-
user: __token__
|
|
338
|
-
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.20)
|
|
2
|
+
project(virtualshell LANGUAGES CXX)
|
|
3
|
+
|
|
4
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
5
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
6
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
7
|
+
|
|
8
|
+
# Enforce 64-bit build on Windows
|
|
9
|
+
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
10
|
+
message(FATAL_ERROR
|
|
11
|
+
"32-bit build detected (x86). virtualshell requires 64-bit (x64).\n"
|
|
12
|
+
"Open 'x64 Native Tools Command Prompt for VS' and retry."
|
|
13
|
+
)
|
|
14
|
+
endif()
|
|
15
|
+
|
|
16
|
+
# Find Python and pybind11
|
|
17
|
+
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
|
|
18
|
+
find_package(pybind11 CONFIG QUIET)
|
|
19
|
+
if(NOT pybind11_FOUND)
|
|
20
|
+
execute_process(
|
|
21
|
+
COMMAND ${Python3_EXECUTABLE} -c "import pybind11; print(pybind11.get_cmake_dir())"
|
|
22
|
+
OUTPUT_VARIABLE pybind11_DIR
|
|
23
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
24
|
+
RESULT_VARIABLE pybind11_RESULT
|
|
25
|
+
)
|
|
26
|
+
file(TO_CMAKE_PATH "${pybind11_DIR}" pybind11_DIR)
|
|
27
|
+
if(pybind11_RESULT EQUAL 0)
|
|
28
|
+
find_package(pybind11 CONFIG REQUIRED PATHS ${pybind11_DIR} NO_DEFAULT_PATH)
|
|
29
|
+
else()
|
|
30
|
+
message(FATAL_ERROR "pybind11 not found. Install with: pip install pybind11")
|
|
31
|
+
endif()
|
|
32
|
+
endif()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# Source files
|
|
37
|
+
set(SRC
|
|
38
|
+
cpp/src/binder.cpp
|
|
39
|
+
cpp/src/io_pump.cpp
|
|
40
|
+
cpp/src/powershell_process.cpp
|
|
41
|
+
cpp/src/virtual_shell.cpp
|
|
42
|
+
cpp/src/py_proxy.cpp
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
file(GLOB_RECURSE VS_HEADERS CONFIGURE_DEPENDS
|
|
46
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/cpp/include/*.h"
|
|
47
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/cpp/include/*.hpp"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
pybind11_add_module(_core MODULE ${SRC} ${VS_HEADERS})
|
|
51
|
+
target_include_directories(_core PRIVATE cpp/include)
|
|
52
|
+
|
|
53
|
+
# Link platform-specific libraries
|
|
54
|
+
if(WIN32)
|
|
55
|
+
target_link_libraries(_core PRIVATE Python3::Module)
|
|
56
|
+
elseif(UNIX)
|
|
57
|
+
find_package(Threads REQUIRED)
|
|
58
|
+
target_link_libraries(_core PRIVATE Threads::Threads dl)
|
|
59
|
+
endif()
|
|
60
|
+
|
|
61
|
+
# Set output directory for the built module
|
|
62
|
+
if(DEFINED ENV{SKBUILD_STATE} AND "$ENV{SKBUILD_STATE}" STREQUAL "editable")
|
|
63
|
+
set(_VS_OUTDIR "${PROJECT_SOURCE_DIR}/src/virtualshell")
|
|
64
|
+
elseif(DEFINED SKBUILD_PLATLIB_DIR)
|
|
65
|
+
set(_VS_OUTDIR "${SKBUILD_PLATLIB_DIR}/virtualshell")
|
|
66
|
+
else()
|
|
67
|
+
set(_VS_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/virtualshell")
|
|
68
|
+
endif()
|
|
69
|
+
|
|
70
|
+
# Configure target properties
|
|
71
|
+
set_target_properties(_core PROPERTIES
|
|
72
|
+
OUTPUT_NAME "_core"
|
|
73
|
+
LIBRARY_OUTPUT_DIRECTORY "${_VS_OUTDIR}"
|
|
74
|
+
RUNTIME_OUTPUT_DIRECTORY "${_VS_OUTDIR}"
|
|
75
|
+
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${_VS_OUTDIR}"
|
|
76
|
+
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${_VS_OUTDIR}"
|
|
77
|
+
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${_VS_OUTDIR}"
|
|
78
|
+
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${_VS_OUTDIR}"
|
|
79
|
+
CXX_VISIBILITY_PRESET hidden
|
|
80
|
+
VISIBILITY_INLINES_HIDDEN ON
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Compiler-specific options
|
|
84
|
+
if(MSVC)
|
|
85
|
+
target_compile_options(_core PRIVATE /permissive- /Zc:__cplusplus /EHsc /utf-8 /bigobj)
|
|
86
|
+
else()
|
|
87
|
+
target_compile_options(_core PRIVATE -O3 -fvisibility=hidden)
|
|
88
|
+
endif()
|
|
89
|
+
|
|
90
|
+
install(TARGETS _core
|
|
91
|
+
LIBRARY DESTINATION virtualshell
|
|
92
|
+
RUNTIME DESTINATION virtualshell
|
|
93
|
+
ARCHIVE DESTINATION virtualshell
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Build and link the vs_shm library on Windows
|
|
97
|
+
if(WIN32 AND MSVC)
|
|
98
|
+
add_subdirectory(cpp/lib/vs_shm)
|
|
99
|
+
|
|
100
|
+
set_target_properties(_vs_shm PROPERTIES
|
|
101
|
+
RUNTIME_OUTPUT_DIRECTORY "${_VS_OUTDIR}"
|
|
102
|
+
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${_VS_OUTDIR}"
|
|
103
|
+
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${_VS_OUTDIR}"
|
|
104
|
+
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${_VS_OUTDIR}"
|
|
105
|
+
LIBRARY_OUTPUT_DIRECTORY "${_VS_OUTDIR}"
|
|
106
|
+
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${_VS_OUTDIR}"
|
|
107
|
+
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${_VS_OUTDIR}"
|
|
108
|
+
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${_VS_OUTDIR}"
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
add_dependencies(_core _vs_shm)
|
|
112
|
+
|
|
113
|
+
add_custom_command(TARGET _core POST_BUILD
|
|
114
|
+
COMMAND ${CMAKE_COMMAND} -E make_directory "${_VS_OUTDIR}"
|
|
115
|
+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
116
|
+
"$<TARGET_FILE:_vs_shm>"
|
|
117
|
+
"${_VS_OUTDIR}/$<TARGET_FILE_NAME:_vs_shm>"
|
|
118
|
+
VERBATIM
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
install(TARGETS _vs_shm
|
|
122
|
+
RUNTIME DESTINATION virtualshell
|
|
123
|
+
LIBRARY DESTINATION virtualshell
|
|
124
|
+
ARCHIVE DESTINATION virtualshell
|
|
125
|
+
)
|
|
126
|
+
endif()
|
|
127
|
+
|
|
128
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configurations": [
|
|
3
|
+
{
|
|
4
|
+
"name": "x64-Release",
|
|
5
|
+
"generator": "Ninja",
|
|
6
|
+
"configurationType": "Release",
|
|
7
|
+
"inheritEnvironments": [ "msvc_x64_x64" ],
|
|
8
|
+
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
|
9
|
+
"installRoot": "${projectDir}\\out\\install\\${name}",
|
|
10
|
+
"cmakeCommandArgs": "",
|
|
11
|
+
"buildCommandArgs": "",
|
|
12
|
+
"ctestCommandArgs": ""
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|