Commit 5775f77
committed
fix: resolve cross-package C++ header staging issue (Issue #38)
CRITICAL FIX: Properly stage local CcInfo headers for cross-package dependencies
Root Cause Analysis:
- Code intentionally excluded CcInfo headers from staging, assuming they were external libraries
- This broke local cross-package dependencies using relative includes like #include "foundation/types.h"
- Headers within same component also needed directory structure preservation
Solution:
1. Modified dependency collection logic in cpp/defs.bzl:
- External CcInfo headers (path contains "external/") → Use include paths only (no staging)
- Local CcInfo headers (same workspace) → Stage with directory structure for relative includes
2. Enhanced header staging in file_ops_actions.bzl:
- Preserve directory structure for all headers to support relative includes
- Handle cases where source files use #include "foundation/types.h" patterns
Testing:
- ✅ foundation_lib builds successfully with preserved directory structure
- ✅ consumer_component successfully includes cross-package headers
- ✅ External library dependencies continue to work via include paths
Impact:
- Resolves Issue #38 cross-package header staging problems
- Maintains backward compatibility for external library dependencies
- Enables proper modular C++ component development1 parent 54f7013 commit 5775f77
2 files changed
+42
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
| |||
482 | 493 | | |
483 | 494 | | |
484 | 495 | | |
485 | | - | |
| 496 | + | |
486 | 497 | | |
487 | 498 | | |
488 | 499 | | |
| |||
491 | 502 | | |
492 | 503 | | |
493 | 504 | | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
500 | 517 | | |
501 | 518 | | |
502 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
286 | | - | |
| 284 | + | |
| 285 | + | |
287 | 286 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
301 | | - | |
| 303 | + | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
| |||
0 commit comments