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

Allow using VS to run host tests when libraries use different config #91873

Merged
merged 5 commits into from
Mar 13, 2024

Conversation

vitek-karas
Copy link
Member

When building the host tests from VS, there are dependencies on projects from the libraries subset. If the libraries are prebuilt with different configuration (typically Release) the build in VS breaks because it can't find the project's output.

This change modifies the import of generators (which are the problematic projects) to let them override the configuration of the referenced projects.

It then adds the ability to set environment based on the -lc parameter to the build script when starting VS.

Also updates the doc to describe how to use this.

When building the host tests from VS, there are dependencies on projects from the libraries subset. If the libraries are prebuilt with different configuration (typically `Release`) the build in VS breaks because it can't find the project's output.

This change modifies the import of generators (which are the problematic projects) to let them override the configuration of the referenced projects.

It then adds the ability to set environment based on the `-lc` parameter to the build script when starting VS.

Also updates the doc to describe how to use this.
@vitek-karas vitek-karas added test-enhancement Improvements of test source code area-Host labels Sep 11, 2023
@vitek-karas vitek-karas self-assigned this Sep 11, 2023
@ghost
Copy link

ghost commented Sep 11, 2023

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

When building the host tests from VS, there are dependencies on projects from the libraries subset. If the libraries are prebuilt with different configuration (typically Release) the build in VS breaks because it can't find the project's output.

This change modifies the import of generators (which are the problematic projects) to let them override the configuration of the referenced projects.

It then adds the ability to set environment based on the -lc parameter to the build script when starting VS.

Also updates the doc to describe how to use this.

Author: vitek-karas
Assignees: vitek-karas
Labels:

test-enhancement, area-Host

Milestone: -

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

Please move the ShouldUnsetParentConfigurationAndPlatform property out of this file, into Directory.Build.props or Directory.Build.targets. It's now already set repo wide as generators.targets gets imported unconditionally but should be moved outside as it affects all types of P2Ps, not just the generator project ones.

@elinor-fung
Copy link
Member

Put it in the repo root Directory.Build.props and removed it from the libraries one.

@vitek-karas
Copy link
Member Author

Thanks a lot Elinor - and sorry I dropped the ball on this one... completely forgot about it.

@ViktorHofer ViktorHofer merged commit 578e829 into dotnet:main Mar 13, 2024
181 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host test-enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants