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

Correct success for /preprocess /targets builds #8908

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

Forgind
Copy link
Member

@Forgind Forgind commented Jun 16, 2023

This is not yet a problem but only because neither /preprocess nor /targets are supported for solution files.

The root of the problem is if someone chooses to specify both /preprocess and /targets. If /preprocess fails but /targets succeeds, it currently will erroneously display success. This fixes that.

As I said, that scenario doesn't currently exist but only because /targets cannot succeed unless /preprocess succeeded, but that is not guaranteed going forward. Notably, if /preprocess is extended to support solution files before /targets is, this will become an issue.

This is not yet a problem but only because neither /preprocess nor /targets are supported for solution files.

The root of the problem is if someone chooses to specify both /preprocess and /targets. If /preprocess fails but /targets succeeds, it currently will erroneously display success. This fixes that.

As I said, that scenario doesn't currently exist but only because /targets cannot succeed unless /preprocess succeeded, but that is not guaranteed going forward. Notably, if /preprocess is extended to support solution files before /targets is, this will become an issue.
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

I still think the combination of -preprocess and -targets makes no sense and should be forbidden.

If it is allowed, I don't understand why we should attempt to print targets after preprocessing has failed--what's the scenario there?

@Forgind
Copy link
Member Author

Forgind commented Jun 21, 2023

I still think the combination of -preprocess and -targets makes no sense and should be forbidden.

@jrdodds commented just under your comment that the two operations are orthogonal and accept files in which to put the outputs. I'm inclined to agree with him. Is your concern here that you don't see a scenario in which someone could want to do this, or is there some reason you think it would actively hurt customers if they try to do it?

If it is allowed, I don't understand why we should attempt to print targets after preprocessing has failed--what's the scenario there?

Slight misunderstanding here—if preprocessing fails, we currently do continue on and still (if requested) try to print targets. I think there's an argument that if we fail to preprocess the project file, we should skip printing targets, but I'm not concerned with that issue in this PR. What does concern me is if we fail to preprocess then go on to try to create a list of targets and succeed for some reason because then the build result would be "success," and the user would be very confused.

@rainersigwald
Copy link
Member

I think it is nonsensical to use the "instead of build, preprocess the file" and "instead of build, list the targets in the file" options together.

if preprocessing fails, we currently do continue on and still (if requested) try to print targets.

Yes--I'm saying that is the bug.

@jrdodds
Copy link
Contributor

jrdodds commented Jun 21, 2023

Changing line 1285 to:

                if (isTargets && success)
                {

(i.e. stopping on a preprocess error regardless of what may follow) would make sense to me.

@rainersigwald
Copy link
Member

@Forgind is this ready to go?

@Forgind
Copy link
Member Author

Forgind commented Sep 7, 2023

@Forgind is this ready to go?

I think so, yeah. Just not very high priority 🙂

@Forgind Forgind added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Sep 7, 2023
@rainersigwald rainersigwald modified the milestones: VS 17.8, VS 17.9 Sep 19, 2023
@JaynieBai JaynieBai merged commit 4ec8852 into dotnet:main Oct 10, 2023
bulatgrzegorz pushed a commit to bulatgrzegorz/selective-condition-evaluator that referenced this pull request Oct 16, 2023
* Correct success

This is not yet a problem but only because neither /preprocess nor /targets are supported for solution files.

The root of the problem is if someone chooses to specify both /preprocess and /targets. If /preprocess fails but /targets succeeds, it currently will erroneously display success. This fixes that.

As I said, that scenario doesn't currently exist but only because /targets cannot succeed unless /preprocess succeeded, but that is not guaranteed going forward. Notably, if /preprocess is extended to support solution files before /targets is, this will become an issue.

* Make isTargets not run if !success

---------

Co-authored-by: Forgind <Forgind@users.noreply.github.com>
MichalPavlik pushed a commit that referenced this pull request Oct 17, 2023
* Correct success

This is not yet a problem but only because neither /preprocess nor /targets are supported for solution files.

The root of the problem is if someone chooses to specify both /preprocess and /targets. If /preprocess fails but /targets succeeds, it currently will erroneously display success. This fixes that.

As I said, that scenario doesn't currently exist but only because /targets cannot succeed unless /preprocess succeeded, but that is not guaranteed going forward. Notably, if /preprocess is extended to support solution files before /targets is, this will become an issue.

* Make isTargets not run if !success

---------

Co-authored-by: Forgind <Forgind@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants