-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
NativeAOT the XUnitLogChecker #103795
NativeAOT the XUnitLogChecker #103795
Conversation
This breaks the dependency on having dotnet installed.
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
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.
Thanks for submitting this change, it's looking good so far. Left some questions.
Don't forget to run the nativeaot azp run if the regular run looks good.
src/libraries/tests.proj
Outdated
@@ -762,7 +762,8 @@ | |||
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(IsXUnitLogCheckerSupported)' == 'true'"> | |||
<ProjectReference | |||
Include="$(RepoRoot)src\tests\Common\XUnitLogChecker\XUnitLogChecker.csproj" | |||
AdditionalProperties="%(AdditionalProperties);Configuration=Release;OutDir=$(XUnitLogCheckerLibrariesOutDir)" /> | |||
Targets="Publish" | |||
AdditionalProperties="%(AdditionalProperties);_IsPublishing=true;Configuration=Release;PublishDir=$(XUnitLogCheckerLibrariesOutDir)" /> |
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.
For my own education, why is _IsPublishing
being passed? Why isn't int sufficient to specify Targets="Publish"
here?
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 tricky. In short, _IsPublishing
is required for publishing, but not set when you're using msbuild /t:publish
, only when you're doing dotnet publish
.
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
I think this is ready for review. |
@carlossanlop Would appreciate another review when you get a chance. Also @dotnet/runtime-infrastructure |
ping @carlossanlop |
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 left a couple minor suggestions, but otherwise it LGTM. Before merging, could you execute a few more /azp runs? There were many failures that never showed up in the default CI legs. Is there any you could think of that could potentially show an edge-case behavior?
var crashReport = JsonNode.Parse(contents)!; | ||
var threads = (JsonArray)crashReport["payload"]!["threads"]!; |
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.
Hopefully we will not see null objects where the !
was added.
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. And if we do, we would throw an exception anyway, so I figure any further checking is a waste.
int timeout = environmentVar != null ? int.Parse(environmentVar) : DEFAULT_TIMEOUT_MS; | ||
bool collectCrashDumps = Environment.GetEnvironmentVariable(COLLECT_DUMPS_ENVIRONMENT_VAR) != null; | ||
string crashDumpFolder = Environment.GetEnvironmentVariable(CRASH_DUMP_FOLDER_ENVIRONMENT_VAR); | ||
string? crashDumpFolder = Environment.GetEnvironmentVariable(CRASH_DUMP_FOLDER_ENVIRONMENT_VAR); |
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.
For these two env vars and the ones in the other files, should we throw if they're not found?
@@ -401,7 +400,7 @@ | |||
<XUnitLogCheckerArgs Condition="'$(TestWrapperTargetsWindows)' != 'true'">$(XUnitLogCheckerArgs) %24HELIX_DUMP_FOLDER</XUnitLogCheckerArgs> | |||
<XUnitLogCheckerArgs Condition="'$(TestWrapperTargetsWindows)' == 'true'">$(XUnitLogCheckerArgs) %25HELIX_DUMP_FOLDER%25</XUnitLogCheckerArgs> | |||
|
|||
<XUnitLogCheckerCommand>dotnet $(XUnitLogCheckerHelixPath)XUnitLogChecker.dll $(XUnitLogCheckerArgs)</XUnitLogCheckerCommand> | |||
<XUnitLogCheckerCommand>$(XUnitLogCheckerHelixPath)XUnitLogChecker$(ExeSuffix) $(XUnitLogCheckerArgs)</XUnitLogCheckerCommand> |
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.
So you're now putting XUnitLogChecker.exe in the root helix path. Nice.
@@ -767,7 +767,8 @@ | |||
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(IsXUnitLogCheckerSupported)' == 'true'"> | |||
<ProjectReference | |||
Include="$(RepoRoot)src\tests\Common\XUnitLogChecker\XUnitLogChecker.csproj" | |||
AdditionalProperties="%(AdditionalProperties);Configuration=Release;OutDir=$(XUnitLogCheckerLibrariesOutDir)" /> | |||
Targets="Publish" | |||
AdditionalProperties="%(AdditionalProperties);_IsPublishing=true;Configuration=Release;PublishDir=$(XUnitLogCheckerLibrariesOutDir);ROOTFS_DIR=$(ROOTFS_DIR);RuntimeIdentifier=$(OutputRID)" /> |
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 me if I'm wrong: the 'Runtime Identifier' additional property here is the equivalent of using the CLI command argument -r <rid>
?
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.
Yup, that's correct
Targets="Build" /> | ||
Targets="Publish" | ||
Properties="_IsPublishing=true;Configuration=Release;PublishDir=$(XunitTestBinBase)/XUnitLogChecker;RuntimeIdentifier=$(RuntimeIdentifier)" | ||
Condition="$(IsXUnitLogCheckerSupported)" /> |
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 not on you obviously, but I wish we had standardized names for arguments like the RID. In tests.proj, it's OutputRID
, and here it is RuntimeIdentifier
.
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.
Yeah, I'm not sure what the reasoning is here. I would have to do some archeology to figure out our naming convention on this.
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
@agocke The Fuzzlyn pipeline run is failing on Linux after this PR (not 100% sure it's because of this PR, but seems related?): https://dev.azure.com/dnceng-public/public/_build/results?buildId=794868&view=results
Any idea what needs to be done? |
Looks like the bfd linker isn’t installed on that machine. We can use lld instead by setting linker flavor. We just need to find the conditions in which it needs to be set. Local builds often have bfd so that’s the default. Maybe we can condition on running in ci. |
I think perhaps the problem is that we should be passing |
bfd is installed, which is for per-arch and it is installed for the host arch, and lld is not installed (which is multi arch). That's the problem. We added UsePublishedCrossgen2=false bailout property for similar reasons in running running test infra. Or we could just install lld by running |
Actually, this is using the cross build image now so lld should be installed, no? |
Actually I came here from Jan’s PR, which indicates superpmi test leg isn’t using the container https://dev.azure.com/dnceng-public/public/_build/results?buildId=795908&view=logs&jobId=b65b05e1-c985-593c-6ffc-1fb9e008884e&j=b65b05e1-c985-593c-6ffc-1fb9e008884e&t=a3a60a19-d0c2-5a1d-1fde-5ca19d3821ea not sure if lld is installed on that host VM. |
This breaks the dependency on having dotnet installed when running tests.
This breaks the dependency on having dotnet installed.