chore: initialize Python Win9x port workspace

This commit is contained in:
Hermes Agent
2026-08-17 03:41:21 +00:00
commit 5d53a62948
4 changed files with 183 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# External/vendor source trees
/cpython/
/MSVC600/
# Local compatibility build output
/build/
/out/
/compat-build/
# Wine and temporary artifacts
*.obj
*.pdb
*.ilk
*.dll
*.exe
*.lib
*.exp
*.pyc
__pycache__/
+76
View File
@@ -0,0 +1,76 @@
# Port Status — CPython 3.11.16 to Windows 98 SE
Date: 2026-08-17
Baseline: CPython `v3.11.16`
Compiler: MSVC 6.0 (`cl.exe` 12.00.8804), from external `MSVC600`
Host test environment: Linux + Wine
## Verified
- CPython source checkout is at the requested `v3.11.16` baseline.
- The MSVC600 tool bundle is present locally and its `VC98/bin/VCVARS32.BAT`
environment script runs under Wine.
- MSVC6 reports:
```text
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
```
- A direct compile probe reaches CPython 3.11 headers. The first unmodified
probe fails before linking, proving the compiler is being invoked against the
intended baseline.
- A project-local compatibility `inttypes.h` has been added under
`compat/msvc600/` as the first isolated shim. It is not yet wired into
CPython source or declared sufficient for the port.
## Current first-blocker evidence
The probe command was equivalent to:
```text
cl /nologo /I compat/msvc600 /I cpython/Include /I cpython/PC \
/c cpython/Programs/python.c
```
The next errors include:
- `Py_uintptr_t` / `Py_intptr_t` configuration failures in `Include/pyport.h`
- unsupported C `inline` syntax in `Include/object.h` and other public headers
- unsupported `__declspec(deprecated)` annotations
- additional C99/C99-era declarations and compatibility assumptions
Before the compatibility header was supplied, VC6 stopped immediately on the
missing `inttypes.h` include. The isolated header resolved only that first
missing-header error; it is intentionally not presented as a complete fix.
## Larger blockers to plan for
1. **Build-system mismatch:** CPython 3.11's Windows build expects Visual Studio
2017-era MSBuild/vcxproj tooling. VC6 cannot consume the build as-is. A
dedicated minimal VC6 makefile/project set is required.
2. **Compiler language gap:** CPython 3.11 source and headers use C99-era and
later MSVC features that VC6 does not implement. Compatibility macros and
carefully scoped source backports are required.
3. **Win9x API gap:** CPython 3.11's Windows layer assumes NT-family Unicode,
synchronization, process, filesystem, and networking APIs. Windows 98 has
no wide-character file APIs and lacks multiple newer kernel APIs.
4. **Runtime/library gap:** SSL, SQLite, ctypes, multiprocessing, asyncio,
Unicode filesystem behavior, and parts of subprocess will need explicit
feature gates or Win9x-specific implementations.
5. **Validation gap:** final success requires booting the built executable on
Windows 98 SE; Wine compilation alone is not proof of Win9x runtime
compatibility.
## Recommended next implementation slice
Do not attempt the complete CPython solution yet. First create a minimal VC6
build target for `pythoncore` plus `Programs/python.c`, then make the public
headers compile under VC6 through a clearly isolated compatibility layer. Keep
all changes small and testable. After the core links, address the Win9x API
surface one subsystem at a time.
## Scope boundary
This project does not vendor the 223 MB MSVC600 bundle into a distributable
repository. It records the external tool as a local build prerequisite. No
Microsoft compiler binaries or runtime files should be committed or published.
+54
View File
@@ -0,0 +1,54 @@
# Python Win9x
A clean-room effort to build a useful Python 3 runtime for Windows 98 SE and
other Windows 9x systems, using CPython **v3.11.16** as the language/runtime
baseline and Microsoft Visual C++ 6.0 as the initial 32-bit toolchain.
## Current state
This is an experimental porting workspace, not a completed Windows 98 build.
The CPython baseline is kept in `cpython/` at tag `v3.11.16`. The MSVC600
bundle is kept in `MSVC600/` as a local external prerequisite and is not part of
the distributable project source.
The first VC6 compiler probe succeeds under Wine. A direct compile of
`cpython/Programs/python.c` currently fails in CPython headers because VC6
lacks or does not understand several facilities used by CPython 3.11:
- C99 `inttypes.h` and related integer-format definitions
- C99 `inline` syntax in C mode
- newer `__declspec(deprecated)` annotations
- modern pointer-width/type configuration expected by `pyport.h`
- the CPython 3.11 Visual Studio/MSBuild project model
These are expected porting blockers and are recorded in `PORT_STATUS.md`.
## Toolchain policy
- Do not commit Microsoft compiler binaries or proprietary runtime files.
- Keep MSVC600 outside the source distribution or obtain it separately under
the user's own license/rights.
- The project is intended for private Gitea only.
- Do not copy proprietary Windows implementation code into the compatibility
layer.
## Intended milestones
1. Build a minimal CPython core with VC6 using a project-local compatibility
header layer.
2. Replace NT-only Windows APIs with ANSI/Win9x-compatible implementations or
explicit feature gates.
3. Produce a bootable 32-bit Python executable and test it on Windows 98 SE,
first with the core interpreter and basic file I/O.
4. Add sockets and a carefully scoped standard-library subset.
5. Backport selected newer Python language/library features only after the
runtime is stable on Win9x.
## Local prerequisites
- CPython v3.11.16 source in `cpython/`
- MSVC600 tools in `MSVC600/` (external/local-only)
- Wine for exercising the Windows compiler from Linux
- A Windows 98 SE VM or physical test machine for final compatibility checks
No full build is claimed yet.
+34
View File
@@ -0,0 +1,34 @@
#ifndef PYTHON_WIN9X_MSVC600_INTTYPES_H
#define PYTHON_WIN9X_MSVC600_INTTYPES_H
/* Minimal C99 integer-format compatibility for MSVC 6.0. */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef long int32_t;
typedef unsigned long uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef signed char int_least8_t;
typedef unsigned char uint_least8_t;
typedef short int_least16_t;
typedef unsigned short uint_least16_t;
typedef long int_least32_t;
typedef unsigned long uint_least32_t;
typedef __int64 int_least64_t;
typedef unsigned __int64 uint_least64_t;
#define PRId32 "ld"
#define PRIu32 "lu"
#define PRIx32 "lx"
#define PRIX32 "lX"
#define PRId64 "I64d"
#define PRIu64 "I64u"
#define PRIx64 "I64x"
#define PRIX64 "I64X"
#endif