Skip to content

fix: make the generated Makefile build an importable module - #415

Merged
b-long merged 1 commit into
masterfrom
split/1-fix-makefile
Nov 5, 2026
Merged

b-long merged 1 commit into
masterfrom
split/1-fix-makefile

Conversation

@b-long

@b-long b-long commented Nov 5, 2026

Copy link
Copy Markdown
Member

The Makefile that gopy gen writes linked _ against a separate _go shared library with no rpath, so the result failed to import:

ImportError: simple_go.so: cannot open shared object file

It now has cgo compile .c into a single shared library, the same way gopy build does, named with the interpreter's extension suffix. The extraGccArgs plumbing only fed the old link line, so it is removed.

TestMakefile builds _examples/simple with the generated Makefile and runs its test.py.

Closes: #413

The Makefile that `gopy gen` writes linked _<pkg> against a separate
<pkg>_go shared library with no rpath, so the result failed to import:

    ImportError: simple_go.so: cannot open shared object file

It now has cgo compile <pkg>.c into a single shared library, the same way
`gopy build` does, named with the interpreter's extension suffix.  The
extraGccArgs plumbing only fed the old link line, so it is removed.

TestMakefile builds _examples/simple with the generated Makefile and runs
its test.py.
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.79%. Comparing base (67e890d) to head (d0844a8).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
bind/gen.go 75.00% 3 Missing ⚠️
bind/utils.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #415      +/-   ##
==========================================
+ Coverage   74.31%   74.79%   +0.47%     
==========================================
  Files          25       25              
  Lines        4653     4658       +5     
==========================================
+ Hits         3458     3484      +26     
+ Misses        960      934      -26     
- Partials      235      240       +5     

☔ View full report in Codecov by Harness.
📢 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.

@b-long
b-long merged commit d81ecee into master Nov 5, 2026
26 checks passed
@b-long
b-long deleted the split/1-fix-makefile branch November 5, 2026 02:26
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.

The Makefile that gopy gen writes doesn't produce an importable module.

1 participant