Skip to content

Conversation

@FaithfulinLOVE
Copy link
Collaborator

@FaithfulinLOVE FaithfulinLOVE commented Nov 27, 2025

Note

Enables Python integration on Windows by adding safe/compat DLL loading, Windows-friendly start/bootstrap scripts, CI jobs (incl. Ollama) and broad test/BUILD tweaks; also adjusts requirements and symbol handling.

  • CI (Windows):
    • Enable long path support; add Python integration job (incl. Ollama setup), artifact handling, and run pytest suites.
  • Runtime/Loader (Windows):
    • Add ten_module_load_with_path_search() using LoadLibraryA and use it in python_addon_loader to locate python310.dll via PATH.
    • Normalize paths and load libten_runtime_python as .pyd on Windows with global symbol visibility.
  • Python binding:
    • Add os.add_dll_directory for ten_runtime import on Windows; export full API in __init__.py.
    • Fix Python C-API format specifiers ("Osn", "O!n") for pointer-sized args.
    • Make uvloop optional on Windows.
  • Apps/Tests:
    • Add Windows bootstrap.py/start.py scripts that set PYTHONPATH and copy .dll.pyd.
    • Update test cases to handle venv Scripts/, call platform-specific bootstrap/start, and add DLL directories via add_dll_directory.
    • Shorten/rename targets (e.g., cpp_app_mproc_python) and skip leak test on Windows; extend pytest ignores.

Written by Cursor Bugbot for commit 307eb81. This will update automatically on new commits. Configure here.

@FaithfulinLOVE FaithfulinLOVE force-pushed the pytest branch 3 times, most recently from 847cfc2 to 86064ad Compare December 4, 2025 11:15
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Write-Output "[Ollama] Zip size (bytes): $zipSize"
if ($zipSize -lt 1000000000) {
Write-Error "[Ollama] Zip file seems too small (<1GB), aborting."
exit 1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Ollama zip size check threshold is too large

The check $zipSize -lt 1000000000 (less than 1GB) will always fail and abort because the Ollama Windows CLI zip file is typically only ~100-300MB. The threshold of 1GB is far too large for a sanity check. This will cause the test-integration-python job to always fail when trying to validate the downloaded Ollama zip file. The threshold should likely be something like 1MB (1000000) or less to catch failed/partial downloads.

Fix in Cursor Fix in Web

@halajohn halajohn merged commit bef4f68 into main Dec 8, 2025
8 of 10 checks passed
@halajohn halajohn deleted the pytest branch December 8, 2025 01:58
shell: pwsh
run: |
Write-Output "Enabling Windows long path support..."
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Registry modification fails if property already exists

The New-ItemProperty -Force command will fail with "The property already exists" error if the LongPathsEnabled registry value is already present on the Windows runner. The -Force parameter only overrides read-only attributes, not existing properties. This could cause intermittent CI failures if GitHub updates their runner images to have this setting pre-configured. Using Set-ItemProperty instead would be idempotent and work regardless of whether the property exists.

Additional Locations (2)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants