Skip to content

ci: remove unnecessary Python setup from macOS CI#584

Merged
MeteorsLiu merged 5 commits into
xgo-dev:mainfrom
luoliwoshang:ci/fix-macos-python-312-dependency
Nov 13, 2025
Merged

ci: remove unnecessary Python setup from macOS CI#584
MeteorsLiu merged 5 commits into
xgo-dev:mainfrom
luoliwoshang:ci/fix-macos-python-312-dependency

Conversation

@luoliwoshang
Copy link
Copy Markdown
Contributor

@luoliwoshang luoliwoshang commented Nov 13, 2025

Summary

Fixes #585

Remove unnecessary Python 3.12 setup from macOS CI that was causing demo tests to fail with exit code 1.

Changes

.github/actions/setup-llcppg/action.yml

  • Remove brew install python@3.12 || true
  • Remove brew link --overwrite python@3.12

.github/workflows/go.yml

  • Remove entire Python symlink setup block (12 lines)
  • Simplify "Test demos" step to directly run the test script

Why This Works

The original code attempted to create a symlink for python3-embed pointing to python-3.12-embed for PyTorch compatibility. However:

  1. The project has no _pydemo directory
  2. Only _demo/cjsondemo exists, which doesn't require Python
  3. The pkg-config --variable=libdir python-3.12-embed command was failing because Python 3.12 wasn't installed
  4. This caused the entire "Test demos" step to exit early with code 1

Benefits

  • ✅ Fixes macOS-latest CI failures
  • ✅ Simplifies CI configuration
  • ✅ Faster build times (no Python installation)
  • ✅ Removes unused dependencies

Test Plan

  • Verify CI passes on macOS-latest
  • Confirm demo tests run successfully
  • Check that cjsondemo still works correctly

🤖 Generated with Claude Code

Fix macOS-latest CI failure in demo tests caused by missing python-3.12-embed.
The test_demo.sh script requires python-3.12-embed for pkg-config to create
the python3-embed symlink, but macOS-latest defaults to Python 3.13.

This change ensures python@3.12 is installed via Homebrew in the setup-llcppg
action for macOS runners, allowing the demo tests to complete successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @luoliwoshang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to stabilize the macOS CI pipeline by rectifying a version mismatch issue. The demo tests, which rely on Python 3.12 for embedding, were failing because the macOS-latest environment defaulted to Python 3.13, causing critical pkg-config commands to fail. The change introduces an explicit installation of Python 3.12 during the CI setup, thereby enabling the demo tests to execute as intended and ensuring the necessary symlinks are correctly established.

Highlights

  • CI Fix: Resolves macOS-latest CI failures in demo tests by ensuring Python 3.12 is available.
  • Dependency Management: Addresses the pkg-config --variable=libdir python-3.12-embed command failure by explicitly installing the required Python version.
  • Symlink Creation: Ensures the test_demo.sh script can successfully create the python3-embed symlink.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses the macOS CI failure by installing python@3.12. The change is simple and effective. I've added one suggestion to consolidate two of the brew install commands for better conciseness. Overall, this is a good fix.

Comment thread .github/actions/setup-llcppg/action.yml Outdated
Comment on lines +32 to +33
brew install zlib # for llgo test .
brew install python@3.12 # for pydemo tests
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.

medium

You can combine these two brew install commands into one for conciseness and to reduce the number of shell commands executed.

      brew install zlib python@3.12 # for llgo test & pydemo tests

@fennoai
Copy link
Copy Markdown
Contributor

fennoai Bot commented Nov 13, 2025

Overall Assessment: Approved with minor documentation suggestion

This PR correctly addresses the macOS CI failure by installing Python 3.12. The change is minimal, well-placed, and solves the immediate issue. I've left one inline comment suggesting a more accurate comment to better reflect the actual use case (python-3.12-embed pkg-config support rather than just "pydemo tests").

Note: The _pydemo directory doesn't exist yet, so this is a forward-looking change. The installation adds ~40-60 seconds to macOS CI runs.

Comment thread .github/actions/setup-llcppg/action.yml Outdated
run: |
brew install llvm@${{inputs.llvm}} bdw-gc openssl libffi libuv lld@${{inputs.llvm}}
brew install zlib # for llgo test .
brew install python@3.12 # for pydemo tests
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.

The comment "for pydemo tests" is somewhat misleading. The actual purpose is to provide the python-3.12-embed pkg-config module, as shown in go.yml lines 79-88 where it's used to create a python3-embed symlink workaround for PyTorch compatibility.

Consider updating to be more specific:

Suggested change
brew install python@3.12 # for pydemo tests
brew install python@3.12 # required for python-3.12-embed pkg-config module

This better reflects the actual use case and aligns with the TODO comment in go.yml explaining the PyTorch/Python 3.13 compatibility issue.

@fennoai
Copy link
Copy Markdown
Contributor

fennoai Bot commented Nov 13, 2025

Overall Assessment: Approved with minor documentation suggestion

This PR correctly addresses the macOS CI failure by installing Python 3.12. The change is minimal, well-placed, and solves the immediate issue. I've left one inline comment suggesting a more accurate comment to better reflect the actual use case (python-3.12-embed pkg-config support rather than just "pydemo tests").

Note: The _pydemo directory doesn't exist yet, so this is a forward-looking change. The installation adds ~40-60 seconds to macOS CI runs.

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.74%. Comparing base (7955d98) to head (b8aaa95).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #584      +/-   ##
==========================================
+ Coverage   84.19%   84.74%   +0.54%     
==========================================
  Files          27       27              
  Lines        2746     2314     -432     
==========================================
- Hits         2312     1961     -351     
+ Misses        391      310      -81     
  Partials       43       43              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

luoliwoshang and others added 2 commits November 13, 2025 15:42
Since python@3.12 is not automatically linked by Homebrew when other
Python versions exist, we need to explicitly add its pkgconfig directory
to PKG_CONFIG_PATH before running pkg-config.

This ensures pkg-config can find python-3.12-embed.pc even when
python@3.12 is installed but not symlinked to /usr/local.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Add || true to brew install python@3.12 for error tolerance
- Use brew link --overwrite to force symlink python@3.12 to /usr/local
- This ensures pkg-config can find python-3.12-embed without additional PKG_CONFIG_PATH setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
luoliwoshang and others added 2 commits November 13, 2025 16:23
Since python@3.12 is now force-linked with brew link --overwrite,
pkg-config can find it directly without additional PKG_CONFIG_PATH setup.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Since the project doesn't have _pydemo directory and doesn't require
Python dependencies, remove all Python-related setup code:
- Remove python@3.12 installation from macOS dependencies
- Remove python3-embed symlink workaround from test_demo step

This simplifies the CI configuration and removes unused dependencies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@luoliwoshang luoliwoshang changed the title ci: add python@3.12 to macOS CI dependencies ci: remove unnecessary Python setup from macOS CI Nov 13, 2025
@MeteorsLiu MeteorsLiu merged commit 6468411 into xgo-dev:main Nov 13, 2025
12 checks passed
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.

CI: macOS-latest demo tests fail with exit 1 due to unnecessary Python setup

2 participants