Skip to content

Conversation

@cottsay
Copy link
Member

@cottsay cottsay commented May 6, 2025

There were two bugs in a previous change to recursive dependency enumeration. The first relates specifically to defaultdict behaviors, and the other to lambda capture.

Fixes #646

Keeping in draft until I can add tests.

CI is blocked on colcon/ci#40

There were two bugs in a previous change to recursive dependency
enumeration. The first relates specifically to defaultdict behaviors,
and the other to lambda capture.

Fixes 520052d
Copy link
Member

@christophebedard christophebedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but tests would definitely be good!

Comment on lines +117 to +118
non_map_categories = recursive_categories
recursive_categories = defaultdict(lambda: non_map_categories)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading up on lambda captures, you might be able to do this (pardon the line length):

Suggested change
non_map_categories = recursive_categories
recursive_categories = defaultdict(lambda: non_map_categories)
recursive_categories = defaultdict(lambda recursive_categories=recursive_categories: recursive_categories)

but it's not really better than the current solution.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, kind of a horse a piece. It's a tricky behavior - I wish the syntax was cleaner.

@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.08%. Comparing base (250164b) to head (c9bc733).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #693      +/-   ##
==========================================
+ Coverage   87.04%   87.08%   +0.03%     
==========================================
  Files          69       69              
  Lines        4077     4081       +4     
  Branches      703      704       +1     
==========================================
+ Hits         3549     3554       +5     
  Misses        417      417              
+ Partials      111      110       -1     

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

@cottsay
Copy link
Member Author

cottsay commented Jul 24, 2025

Alright, the latest change adds a test that exercises this and hides the critical part of the fix that caused the regression behind a feature flag.

The intention is to release this in a disabled state and make an announcement about it so folks can try it out and fix any regressed dependencies before we fix the bug unconditionally down the road.

For reference, the feature flag is: COLCON_FEATURE_FLAGS=restore_build_isolation.

@cottsay cottsay marked this pull request as ready for review July 24, 2025 19:33
@cottsay cottsay merged commit afd1de1 into master Jul 25, 2025
40 checks passed
@cottsay cottsay deleted the cottsay/recursive-dep-bug branch July 25, 2025 22:19
@cottsay cottsay added this to the 0.19.1 milestone Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

3 participants