-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): build Go wrapper from source on CI runner #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -633,20 +633,24 @@ def _validate_wrapper_bundle( | |||||||||
| _validate_schema(payload, schema) | ||||||||||
|
|
||||||||||
| def _build_go_binary(self, binary: Path) -> bool: | ||||||||||
| if binary.exists(): | ||||||||||
| return True | ||||||||||
|
|
||||||||||
| go_source = binary.parent | ||||||||||
| # Always rebuild from source when `go` is available. Trusting a | ||||||||||
| # pre-existing binary is unsafe because it may have been built on a | ||||||||||
| # different OS/arch (e.g. macOS arm64 committed into the repo) and | ||||||||||
| # would raise OSError: [Errno 8] Exec format error on linux-amd64 | ||||||||||
| # CI runners. The Go module has no external deps, so this is fast. | ||||||||||
| if shutil.which("go") is None: | ||||||||||
| return False | ||||||||||
|
Comment on lines
641
to
642
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If Consider returning
Suggested change
|
||||||||||
|
|
||||||||||
| go_source = binary.parent | ||||||||||
| build = subprocess.run( | ||||||||||
| ["go", "build", "-o", str(binary), "."], | ||||||||||
| cwd=str(go_source), | ||||||||||
| capture_output=True, | ||||||||||
| text=True, | ||||||||||
| ) | ||||||||||
| if build.returncode != 0: | ||||||||||
| print(build.stdout) | ||||||||||
| print(build.stderr, file=__import__("sys").stderr) | ||||||||||
|
Comment on lines
+652
to
+653
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||
| return False | ||||||||||
| return binary.exists() | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Add an FR trace reference (for example via
# @trace FR-..., a@pytest.mark.requirement("FR-..."), or a docstring trace) in this modified test area so the file satisfies the repository's mandatory test-to-requirement traceability rule. [custom_rule]Severity Level: Minor⚠️
Why it matters? 🤔
The repository rule requires test files and new test functions to include an FR trace marker, requirement annotation, docstring trace, or FR-based test name. The modified test area shown here contains only explanatory comments and no FR-XXX-NNN reference or equivalent trace marker, so the violation is real.
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖