• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 28575780130
93%

Build:
DEFAULT BRANCH: main
Ran 02 Jul 2026 08:27AM UTC
Jobs 11
Files 1766
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Jul 2026 08:18AM UTC coverage: 92.827% (+0.001%) from 92.826%
28575780130

push

github

web-flow
Accept new `#cgo` directives introduced by go 1.24 (#23439)

(First of all thank you for the great build tool!)

Go 1.24 [introduced](https://go.dev/doc/go1.24#cgo) new `#cgo`
directives for performance improvements. Unfortunately the current pants
go plugin does not understand the directives and results in the
following error when building:

```
21:02:21.05 [ERROR] Failed to analyze github.com/pantsbuild/pants/testprojects/src/go/pants_test/cgo/directives for dependency inference:
invalid Go sources encountered
nocallback_noescape.go: cgo error: nocallback_noescape.go: invalid #cgo line: #cgo nocallback addNumbers
```

The error message was obtained by running the new test `./pants test
testprojects/src/go/pants_test/cgo/directives:` with the following diff
(to recognize code under `testprojects/src/go/`).

```diff
diff --git a/pants.toml b/pants.toml
index fde22eaf8e..f3e4f56313 100644
--- a/pants.toml
+++ b/pants.toml
@@ -72,7 +72,7 @@ pants_ignore.add = [

 build_ignore.add = [
   # Disable Go targets by default so Pants developers do not need Go installed.
-  "testprojects/src/go/**",
+  # "testprojects/src/go/**",
 ]

 unmatched_build_file_globs = "error"
```

This PR fixes the issue by changing `saveCgo` function in go package
analyzer. Specifically I updated `saveCgo` based on
https://github.com/golang/go/blob/go1.26.4/src/go/build/build.go#L1710-L1713
(i.e. catch up with upstream) so that `#cgo nocallback` directive is not
rejected.

I also added a simple cgo test case. Please let me know if you have a
better idea how to test this feature.

20 of 20 new or added lines in 1 file covered. (100.0%)

93774 of 101020 relevant lines covered (92.83%)

3.7 hits per line

Jobs
ID Job ID Ran Files Coverage
1 test_python_linux_x86_64_1/10 - 28575780130.1 02 Jul 2026 08:29AM UTC 1207
48.78
GitHub Action Run
2 test_python_linux_arm64 - 28575780130.2 02 Jul 2026 08:27AM UTC 1190
51.74
GitHub Action Run
3 test_python_linux_x86_64_0/10 - 28575780130.3 02 Jul 2026 08:27AM UTC 1231
57.26
GitHub Action Run
4 test_python_linux_x86_64_5/10 - 28575780130.4 02 Jul 2026 08:28AM UTC 1224
59.91
GitHub Action Run
5 test_python_linux_x86_64_8/10 - 28575780130.5 02 Jul 2026 08:30AM UTC 1210
52.77
GitHub Action Run
6 test_python_linux_x86_64_9/10 - 28575780130.6 02 Jul 2026 08:29AM UTC 1218
53.76
GitHub Action Run
7 test_python_linux_x86_64_3/10 - 28575780130.7 02 Jul 2026 08:28AM UTC 1209
53.57
GitHub Action Run
8 test_python_linux_x86_64_4/10 - 28575780130.8 02 Jul 2026 08:32AM UTC 1241
58.85
GitHub Action Run
9 test_python_linux_x86_64_2/10 - 28575780130.9 02 Jul 2026 08:28AM UTC 1211
58.57
GitHub Action Run
10 test_python_linux_x86_64_6/10 - 28575780130.10 02 Jul 2026 08:27AM UTC 1202
49.24
GitHub Action Run
11 test_python_linux_x86_64_7/10 - 28575780130.11 02 Jul 2026 08:29AM UTC 1212
50.75
GitHub Action Run
Source Files on build 28575780130
  • Tree
  • List 1766
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28575780130
  • 9410e860 on github
  • Prev Build on main (#28545400239)
  • Next Build on main (#28578038934)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc