Skip to content

[com9] Add com9 compilation (instead of fixed .exe)#1281

Open
fso42 wants to merge 12 commits into
masterfrom
addCom9Compil
Open

[com9] Add com9 compilation (instead of fixed .exe)#1281
fso42 wants to merge 12 commits into
masterfrom
addCom9Compil

Conversation

@fso42
Copy link
Copy Markdown
Contributor

@fso42 fso42 commented May 27, 2026

Summary

Remove precompiled MoT-Voellmy binaries from version control and instead compile them at package time. A build script fetches the C source from the upstream GitHub repository and compiles for the target platform.

Changes

  • New build script (avaframe/com9MoTVoellmy/_buildMoTVoellmy.py): discovers the latest C source from the upstream repo via the GitHub API, caches it, and compiles with gcc
  • Pixi task: pixi run compilemot for manual compilation, optionally with a local .c file path
  • setup.py hook: compiles the binary automatically during pip install (best-effort, warns if gcc is missing)
  • CI wheels: CIBW_BEFORE_BUILD_* runs the build script in each platform environment
  • CI sdist: compiles Linux natively and cross-compiles Windows via mingw-w64, ships both binaries in the source tarball

fso42 added 3 commits May 27, 2026 11:42
Remove precompiled binaries from version control. Add build script
that fetches the C source from the upstream GitHub repo and compiles
for the current platform. Integration via setup.py hook, pixi task,
and CI (cibuildwheel + sdist cross-compilation).
@fso42 fso42 self-assigned this May 27, 2026
@fso42 fso42 added the enhancement New feature or request label May 27, 2026
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented May 27, 2026

Analysis for project AvaFrame

❌ 1 blocking issue (2 total)

Tool Category Rule Count
ruff Lint Local variable mock\_run is assigned to but never used 1
qlty Structure Function with many returns (count = 4): _compile 1

Comment thread avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
Comment thread avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented May 27, 2026

Qlty


Coverage Impact

⬆️ Merging this pull request will increase total coverage on master by 0.61%.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@fso42 fso42 changed the title Add com9 compilation (instead of fixed .exe) [com9] Add com9 compilation (instead of fixed .exe) May 27, 2026
Run full com9MoTVoellmyMain pipeline with simType=null, verify peak
files and config files are produced. Skip when MoT binary is absent.

Also add `pixi run compilemot` to CI so the binary is built before
tests run.
Comment thread avaframe/tests/test_com9MoTVoellmy.py
Comment thread avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
Comment thread avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
fso42 added 3 commits May 28, 2026 08:42
…y` build script

Relocated the `com9MoTVoellmy` build script to the `avaframe` directory across all platforms in the GitHub Actions workflow. Ensures correct script execution during the build process.
Set `CIBW_ENVIRONMENT` to include `GITHUB_TOKEN` in the PyPI build and upload workflow. Ensures access to GitHub secrets during the build process.
Remove the `-static` flag from the Linux build command in `_buildMoTVoellmy.py` to address compatibility issues with dynamic linking. Ensures smoother builds on Linux systems.
Comment thread avaframe/com9MoTVoellmy/_buildMoTVoellmy.py
if system != "Windows":
os.chmod(outPath, 0o755)

print(f"Compiled {outPath}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Function with many returns (count = 4): _compile [qlty:return-statements]

patch("os.chdir"),
patch("os.path.dirname"),
patch("os.path.abspath"),
patch("avaframe.com9MoTVoellmy.com9MoTVoellmy.mT.runAndCheckMoT") as mock_run,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Local variable mock_run is assigned to but never used [ruff:F841]

Suggested change
patch("avaframe.com9MoTVoellmy.com9MoTVoellmy.mT.runAndCheckMoT") as mock_run,
patch("avaframe.com9MoTVoellmy.com9MoTVoellmy.mT.runAndCheckMoT"),

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant