Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildCheck suggestion: Evaluation time Item points to the output of a project #11247

Open
JanKrivanek opened this issue Jan 9, 2025 · 1 comment
Labels
Area: BuildCheck BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck'

Comments

@JanKrivanek
Copy link
Member

Context

Inspired by #6198 and https://github.com/benvillalobos/msbuildism/tree/main/including-generated-files

When adding an evaluation time item update/include that is attempting to point to build execution time produced files - such item can either plainly not work as intended or worse behave differently based on build order leading to possible undeterministic behavior of the build

Goal

Implement a Check with the following rule: items updates/include happening during evaluation time are not allowed to reference outputs or intermediate outputs of projects that are part of the build.

@JanKrivanek JanKrivanek added Area: BuildCheck BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck' labels Jan 9, 2025
@rainersigwald
Copy link
Member

I'm not sure this is a good idea; it's perfectly ok in several cases to have an item that doesn't exist on disk yet, as long as it does before it's used. In general, you want to discover reference items from other projects by asking them (the normal p2p protocol) but for some more advanced scenarios a "dangling reference" is ok.

The only time I think it would be required is for a task defined in another project (since the UsingTasks are processed before targets) but I bet users have done this a bunch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BuildCheck BuildCheck Suggestion Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck'
Projects
None yet
Development

No branches or pull requests

2 participants