Commit a494a68
committed
When a go_library embeds another go_library that has cdeps but not
cgo=True (because it itself embeds a library with cgo=True), the cdeps
were not being propagated. This is a regression from v0.51.0.
In v0.50.1, cdeps and related cgo options were merged unconditionally:
source["cdeps"] = source["cdeps"] or s.cdeps
In v0.51.0 (PR #4030), the logic was changed to only merge these when
s.cgo is True:
if s.cgo:
source["cdeps"] = s.cdeps
This breaks the pattern where:
- Library A has cgo=True and C code
- Library B embeds A, adds cdeps, but doesn't set cgo=True
- Test embeds B
The cdeps from B don't propagate to the test because B doesn't have
cgo=True, causing undefined symbol errors during linking.
This fix restores the v0.50.1 behavior: merge cgo-related attributes
if the embedded library has them, regardless of the cgo flag.1 parent 1be32b0 commit a494a68
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
| |||
0 commit comments