Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 6 additions & 10 deletions .github/build-bochscpu.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$ErrorActionPreference = "Stop"

Push-Location

New-Item -ItemType Directory -Name bxbuild
Expand All @@ -9,7 +8,7 @@ git clone https://github.com/yrp604/bochscpu-build.git
git clone https://github.com/yrp604/bochscpu.git
git clone https://github.com/yrp604/bochscpu-ffi.git

bash -c "cd bochscpu-build && bash prep.sh && cd Bochs/bochs && bash .conf.cpu-msvc"
bash -c "cd bochscpu-build && bash prep.sh && cd Bochs/bochs && bash .conf.cpu-msvc && find ./cpu . -type f -name Makefile -exec sed -i 's?/MT?/MD?g' {} \;"

Set-Location bochscpu-build\Bochs\bochs
$env:CL = "/MP$env:NUMBER_OF_PROCESSORS"
Expand All @@ -19,18 +18,15 @@ nmake cpu\avx\libavx.a
nmake cpu\cpudb\libcpudb.a
nmake cpu\libcpu.a

# Don't actually need the rest
# nmake

Remove-Item -Recurse -Force -ErrorAction Ignore ..\..\..\bochscpu\bochs
Remove-Item -Recurse -Force -ErrorAction Ignore ..\..\..\bochscpu\lib

New-Item -ItemType Directory -Name ..\..\..\bochscpu\lib
Copy-Item cpu\libcpu.a ..\..\..\bochscpu\lib\cpu.lib
Copy-Item cpu\fpu\libfpu.a ..\..\..\bochscpu\lib\fpu.lib
Copy-Item cpu\avx\libavx.a ..\..\..\bochscpu\lib\avx.lib
Copy-Item cpu\cpudb\libcpudb.a ..\..\..\bochscpu\lib\cpudb.lib
Copy-Item cpu\softfloat3e\libsoftfloat.a ..\..\..\bochscpu\lib\softfloat.lib
Copy-Item -Verbose cpu\libcpu.a ..\..\..\bochscpu\lib\cpu.lib
Copy-Item -Verbose cpu\fpu\libfpu.a ..\..\..\bochscpu\lib\fpu.lib
Copy-Item -Verbose cpu\avx\libavx.a ..\..\..\bochscpu\lib\avx.lib
Copy-Item -Verbose cpu\cpudb\libcpudb.a ..\..\..\bochscpu\lib\cpudb.lib
Copy-Item -Verbose cpu\softfloat3e\libsoftfloat.a ..\..\..\bochscpu\lib\softfloat.lib

New-Item -ItemType Directory -Name ..\..\..\bochscpu\bochs
Copy-Item -Recurse -Force . ..\..\..\bochscpu
Expand Down
76 changes: 42 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,26 @@ on:

env:
NB_CPU: 1
VERSION: '0.4.0'
BOCHS_REV: 3cf98b28541d337270c34b1068113fef294551a2
VERSION: '0.5.0'
# BOCHS_REV: f75e315b289ca3409ed02bce0e141bb3fccdb35c
BOCHS_REV: b64f49ea56e191a2d3a3f010d9f6b167c5beb7a0

jobs:
bochscpu:
strategy:
fail-fast: false
matrix:
variant:
- {os: windows-2019, arch: x64}
- {os: windows-2022, arch: x64}
- {os: ubuntu-22.04, arch: x64}
- {os: ubuntu-24.04, arch: x64}
- {os: ubuntu-24.04-arm, arch: arm64}
- {os: macos-13, arch: x64}
- {os: macos-14, arch: arm64}
- {os: macos-15, arch: arm64}
# - {os: windows-2019, arch: x64}
# - {os: windows-2022, arch: x64}
- {os: windows-2025, arch: x64}
# - {os: windows-11-arm, arch: arm64}
# - {os: ubuntu-22.04, arch: x64}
# - {os: ubuntu-24.04, arch: x64}
# - {os: ubuntu-24.04-arm, arch: arm64}
# - {os: macos-13, arch: x64}
# - {os: macos-14, arch: arm64}
# - {os: macos-15, arch: arm64}
runs-on: ${{ matrix.variant.os }}
name: bochscpu / ${{ matrix.variant.os }} / ${{ matrix.variant.arch }}
steps :
Expand Down Expand Up @@ -62,11 +65,14 @@ jobs:
- name: Build BochsCPU (Windows)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.os, 'windows-')
run: |
mkdir artifact
mkdir artifact/debug
mkdir artifact/release
mkdir artifact/relwithdebinfo
.\.github\build-bochscpu.ps1
mkdir artifact; mkdir artifact/release; mkdir artifact/debug; mkdir artifact/relwithdebinfo
cp -Verbose bxbuild/bochscpu-ffi/target/release/*.lib artifact/release/
cp -Verbose bxbuild/bochscpu-ffi/target/debug/*.lib artifact/debug/
cp -Verbose bxbuild/bochscpu-ffi/target/debug/*.lib artifact/relwithdebinfo/
cp -Verbose bxbuild/bochscpu-ffi/target/release/*.lib artifact/release/
cp -Verbose bxbuild/bochscpu-ffi/target/release/*.lib artifact/relwithdebinfo/

- name: Build BochsCPU (Linux & MacOS)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.os, 'windows-') == false
Expand All @@ -75,7 +81,7 @@ jobs:
mkdir artifact artifact/Release artifact/Debug artifact/RelWithDebInfo
cp -v bxbuild/bochscpu-ffi/target/release/lib*.a artifact/Release/
cp -v bxbuild/bochscpu-ffi/target/debug/lib*.a artifact/Debug/
cp -v bxbuild/bochscpu-ffi/target/debug/lib*.a artifact/RelWithDebInfo/
cp -v bxbuild/bochscpu-ffi/target/release/lib*.a artifact/RelWithDebInfo/

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -91,14 +97,15 @@ jobs:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
variant:
- {os: windows-2019, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: windows-2022, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-22.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-24.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-24.04-arm, arch: arm64, config: RelWithDebInfo, py-arch: arm64}
- {os: macos-13, arch: x64, config: Release, py-arch: x64}
- {os: macos-14, arch: arm64, config: Release, py-arch: arm64}
- {os: macos-15, arch: arm64, config: Release, py-arch: arm64}
# - {os: windows-2019, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: windows-2022, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: windows-2025, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-22.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-24.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-24.04-arm, arch: arm64, config: RelWithDebInfo, py-arch: arm64}
# - {os: macos-13, arch: x64, config: Release, py-arch: x64}
# - {os: macos-14, arch: arm64, config: Release, py-arch: arm64}
# - {os: macos-15, arch: arm64, config: Release, py-arch: arm64}
runs-on: ${{ matrix.variant.os }}
name: bindings / ${{ matrix.variant.os }} / ${{ matrix.python-version }} / ${{ matrix.variant.config }}
env:
Expand Down Expand Up @@ -199,10 +206,10 @@ jobs:
matrix:
python-version: ['3.13']
variant:
- {os: windows-2022, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-24.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-24.04-arm, arch: arm64, config: RelWithDebInfo, py-arch: arm64}
- {os: macos-15, arch: arm64, config: Release, py-arch: arm64}
- {os: windows-2025, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-24.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-24.04-arm, arch: arm64, config: RelWithDebInfo, py-arch: arm64}
# - {os: macos-15, arch: arm64, config: Release, py-arch: arm64}
runs-on: ${{ matrix.variant.os }}
steps:
- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -238,14 +245,15 @@ jobs:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
variant:
- {os: windows-2019, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: windows-2022, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-22.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-24.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: ubuntu-24.04-arm, arch: arm64, config: RelWithDebInfo, py-arch: arm64}
- {os: macos-13, arch: x64, config: Release, py-arch: x64}
- {os: macos-14, arch: arm64, config: Release, py-arch: arm64}
- {os: macos-15, arch: arm64, config: Release, py-arch: arm64}
# - {os: windows-2019, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: windows-2022, arch: x64, config: RelWithDebInfo, py-arch: x64}
- {os: windows-2025, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-22.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-24.04, arch: x64, config: RelWithDebInfo, py-arch: x64}
# - {os: ubuntu-24.04-arm, arch: arm64, config: RelWithDebInfo, py-arch: arm64}
# - {os: macos-13, arch: x64, config: Release, py-arch: x64}
# - {os: macos-14, arch: arm64, config: Release, py-arch: arm64}
# - {os: macos-15, arch: arm64, config: Release, py-arch: arm64}
runs-on: ubuntu-24.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: PyPI upload of ${{ matrix.variant.os }}/${{ matrix.variant.arch }}/${{ matrix.variant.config }}/py${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION True)
project(
bochscpu-python
LANGUAGES CXX
VERSION 0.4.0
VERSION 0.5.0
DESCRIPTION "Python bindings for BochsCPU"
HOMEPAGE_URL https://github.com/hugsy/bochscpu-python
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "bochscpu-python"
version = "0.4.0"
version = "0.5.0"
description = "Python bindings for BochsCPU."
readme = "./README.md"
license.file = "./LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion python/src/bochscpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PyType_Slot slots[] = {
NB_MODULE(_bochscpu, m)
{
m.doc() = "The native `bochscpu` module";
m.attr("__version__") = "0.4.0";
m.attr("__version__") = "0.5.0";

//
// Submodules
Expand Down
Loading