-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Change LibrariesConfiguration defaults in tests #75033
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We explicitly chose to use release libraries here as we generally want to use release libraries in these tests in local builds. I’m not sure if we want to change this default.
cc: @trylek @hoyosjs @jkotas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is aligning the behavior of product and test build scripts:
Before:
./build.sh -c Debug
=>src/tests/build.sh Debug -p:LibrariesConfiguration=Release
./build.sh -c Release
=>src/tests/build.sh Release
./build.sh -c Debug -lc Release
=>src/tests/build.sh Debug
After:
./build.sh -c Debug
=>src/tests/build.sh Debug
./build.sh -c Release
=>src/tests/build.sh Release
./build.sh -c Debug -lc Release
=>src/tests/build.sh Debug -p:LibrariesConfiguration=Release
IMO, it is easier to reason about instead of remembering this one-off rule.
Additionally, we can also add a shorthand
-lc
option in test build script.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current default is documented in number of places (e.g. https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/coreclr/windows-test-instructions.md#building-tests).
Local workflow of number of engineers on the team depend on the current default.
-p:LibrariesConfiguration=Release
is very long to type for the most common use case. This would need shorthand, like-lc
shorthand used for the main build script.Would it make sense to change the runtime to pick the last flavor of libraries by default, similar to how libraries tests pick up the last flavor of runtime by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a shorthand for libraries configuration (lc).
Correct me if I'm wrong but I don't think that libraries pick-up the last built runtime. Instead they use the passed in runtime configuration which defaults to Debug.
Additionally, when building clr and libs we always need to explicitly pass in -rc Release. It might make more sense to default to Release and only pick Debug/Checked if Release doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lc
is available ineng/build
, but not insrc/tests/build
scripts.The reason why folks use
src/tests/build
scripts directly more often than other internal scripts (src/coreclr/build-runtime
,src/native/libs/build-native
andsrc/native/corehost/build
) is becauseeng/build
is not wired to tests build script. Consequently, we have the ability to build sources and libraries tests in one step, e.g.build clr+libs -test
, but for runtime tests, it is always a two-step process, with different argument syntax (-c {Config}
vs.-{Config}
) and defaults.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment was about libraries tests. When you are building and running libraries tests (iterating on a single test, without building the runtime and libraries), they will pick up the runtime flavor that you have built last.
Depends on which component you are working on. If you are working on runtime, you typically pass in -lc Release.
Do you mean default to Release everywhere and let people override when they want a Debug flavor of a specific component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I care less about defaulting the libraries' configuration to Release as I never build/run the runtime or the installer/host tests but when iterating on libraries themselves and running tests, we (the team) usually pass in
-rc Release
//p:RuntimeConfiguration=Release
(to the root build).We probably mean the same thing but just to be accurate: When running framework dependent tests, the host and runtime is used that is part of in the artifacts/bin/testhost folder. The testhost folder is populated by the "libs.pretest" subset / pretest.proj msbuild project which runs when the subset is explicitly invoked or as part of the parent subset. "libs". The runtime and host bits are determined by the provided
RuntimeConfiguration
andHostConfiguration
msbuild properties, and both default to Debug.In addition to that, the testhost folder itself also encodes the configuration in its path which means when building libraries tests, the corresponding testhost folder is used (either Debug or Release).
For self-contained deployment, the story is entirely different and I believe that the
RuntimeConfiguration
flag is honored just-in-time as part of the library test project's build/test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for each invocation. I build once from root with e.g.:
and then when iterating on an individual library I just do:
without explicitly specifying
/p:RuntimeConfiguration=Release
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. That's also the documented Quick Start workflow: https://github.com/dotnet/runtime/tree/main/docs/workflow/building/libraries#quick-start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, that was an overlook from my side. Thanks for clarifying that.