Skip to content

Conversation

itowlson
Copy link
Collaborator

@itowlson itowlson commented Oct 2, 2025

Fixes #3283.

return Ok(());
}

let (components_to_build, has_cycle) = sort(components_to_build);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should comment why we're sorting. This code is pretty opaque when you don't have the context of #3283.

let (components_to_build, has_cycle) = sort(components_to_build);

if has_cycle {
terminal::warn!("Cyclic dependency detected");
Copy link
Collaborator

Choose a reason for hiding this comment

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

While this just be more confusing than actionable? What do we expect users to do with this information?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rylev Good question. It's less "actionable" than it is "if you see errors where a consumer is not 'seeing' changes to the dependency interface then this could be why." But maybe it's so pathological a case that it's not worth flagging...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like something only someone with deep knowledge would be able to take action on which would indicate debug being a more appropriate logging level.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will become a thing we'll have to show more prominently before too long. Or rather, I think it should :)

Specifically, if and when we add features that require build outputs of dependencies as inputs to the dependee's build process.

It might make sense to look at the error message cargo reports for cyclic dependencies between crates as inspiration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tschneidereit In the interests of getting this PR over the line, I propose we cross that bridge when we come to it...

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yes, my apologies: I hadn't meant to say that this needs to happen now or otherwise nothing can possibly land.

@itowlson itowlson force-pushed the build-deps-before-components branch from 07c7281 to 1ff8a8f Compare October 2, 2025 19:57
@itowlson itowlson enabled auto-merge October 6, 2025 03:19
@itowlson itowlson force-pushed the build-deps-before-components branch from 1ff8a8f to fdf1345 Compare October 6, 2025 19:18
@michelleN michelleN moved this from Todo to In Progress in Spin v3.5.0 Oct 6, 2025
@michelleN michelleN removed this from Spin v3.5.0 Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build dependencies before triggered components
3 participants