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

error CS0006: Metadata file '.../maccatalyst-arm64/StartupHookForFunctionalTest.dll' could not be found #80976

Open
EgorBo opened this issue Jan 21, 2023 · 9 comments
Labels
Milestone

Comments

@EgorBo
Copy link
Member

EgorBo commented Jan 21, 2023

runtime-extra-platforms fails on ios/tvos/maccatalyst with:

CSC : error CS0006: Metadata file '/Users/runner/work/1/s/artifacts/bin/StartupHookForFunctionalTest/Release/net8.0/iossimulator-x64/StartupHookForFunctionalTest.dll' could not be found [/Users/runner/work/1/s/src/tests/FunctionalTests/iOS/Simulator/StartupHook/iOS.Simulator.StartupHook.Test.csproj]
##[error]CSC(0,0): error CS0006: (NETCORE_ENGINEERING_TELEMETRY=Build) Metadata file '/Users/runner/work/1/s/artifacts/bin/StartupHookForFunctionalTest/Release/net8.0/iossimulator-x64/StartupHookForFunctionalTest.dll' could not be found

Build FAILED.

e.g. https://dev.azure.com/dnceng-public/public/_build/results?buildId=144305&view=logs&jobId=cbf7f906-06a1-5744-2b19-594b1486a781&j=07effcfd-c63d-5008-e811-03b29530f5cb&t=46984e67-96b8-5591-f4ad-dfc0b5406724

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 21, 2023
@ghost
Copy link

ghost commented Jan 21, 2023

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

runtime-extra-platforms fails on ios/tvos/maccatalyst with:

CSC : error CS0006: Metadata file '/Users/runner/work/1/s/artifacts/bin/StartupHookForFunctionalTest/Release/net8.0/iossimulator-x64/StartupHookForFunctionalTest.dll' could not be found [/Users/runner/work/1/s/src/tests/FunctionalTests/iOS/Simulator/StartupHook/iOS.Simulator.StartupHook.Test.csproj]
##[error]CSC(0,0): error CS0006: (NETCORE_ENGINEERING_TELEMETRY=Build) Metadata file '/Users/runner/work/1/s/artifacts/bin/StartupHookForFunctionalTest/Release/net8.0/iossimulator-x64/StartupHookForFunctionalTest.dll' could not be found

Build FAILED.

e.g. https://dev.azure.com/dnceng-public/public/_build/results?buildId=144305&view=logs&jobId=cbf7f906-06a1-5744-2b19-594b1486a781&j=07effcfd-c63d-5008-e811-03b29530f5cb&t=46984e67-96b8-5591-f4ad-dfc0b5406724

Author: EgorBo
Assignees: -
Labels:

untriaged, area-Infrastructure-mono

Milestone: -

@mdh1418
Copy link
Member

mdh1418 commented Feb 15, 2023

@steveisok @lambdageek
I think this is because our iOS default workflow

<Target Name="_CopyTestArchive"
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'">
<Error Condition="'$(TestArchiveTestsDir)' == ''" Text="TestArchiveTestsDir property to archive the test folder must be set." />
<!-- Adjust the variable names -->
<PropertyGroup Condition="'$(GenerateXcodeProject)' == 'true'">
<_AppBundleDir>$(AppBundlePath)/../</_AppBundleDir>
</PropertyGroup>
<MakeDir Condition="'$(GenerateXcodeProject)' == 'true'" Directories="$(TestArchiveTestsDir)" />
<ZipDirectory Condition="'$(GenerateXcodeProject)' == 'true'"
SourceDirectory="$(_AppBundleDir)"
DestinationFile="$([MSBuild]::NormalizePath('$(TestArchiveTestsDir)', '$(TestProjectName).zip'))"
Overwrite="true" />
<RemoveDir Condition="'$(NeedsToBuildAppsOnHelixLocal)' != 'true'" Directories="$(OutDir)" />
</Target>
will remove the $(OutDir)

Removing directory "/Users/mihw/runtime/runtime_ios/artifacts/bin/StartupHookForFunctionalTest/release/net8.0/iossimulator-arm64/".

Afterwards, the CoreCompile target step sees /Users/mihw/runtime/runtime_ios/artifacts/bin/StartupHookForFunctionalTest/release/net8.0/iossimulator-arm64/StartupHookForFunctionalTest.dll as a reference but the directory was removed.

@steveisok
Copy link
Member

@mdh1418 can we skip this test until there's a fix?

@mdh1418
Copy link
Member

mdh1418 commented Feb 15, 2023

Yeah, I can skip it. I think the problem inherently because this test has a ProjectReference

<ProjectReference Include="..\..\..\TestAssets\StartupHookForFunctionalTest\StartupHookForFunctionalTest.csproj" />

but its not clear to me how this ends up with a reference to /Users/mihw/runtime/runtime_ios/artifacts/bin/StartupHookForFunctionalTest/release/net8.0/iossimulator-arm64/StartupHookForFunctionalTest.dll in CoreCompiled as opposed to the libraries tests which also have ProjectReference but dont have this problem.

@lambdageek
Copy link
Member

ProjectReferences should work.
Why are we deleting that other directory?

@lambdageek
Copy link
Member

Maybe the ProjectReference should be Private?
We want the hook dll to be copied into the functional test's bin directory

@mdh1418
Copy link
Member

mdh1418 commented Mar 2, 2023

ProjectReferences should work. Why are we deleting that other directory?

We were deleting that directory as a means to help conserve disk space, but upon some investigations in #82313 (comment), we still have plenty of disk space left even if we retain $(OutDir).

@mdh1418
Copy link
Member

mdh1418 commented Apr 5, 2023

@lambdageek @steveisok
It doesn't look like making the ProjectReference private resolves the underlying problem.
From some investigation, the problem is that the Android build targets are being hit during the ResolveProjectRefernces target, probably because when resolving StartupHookForFunctionalTest.csproj, the publish target is hit, and because we use Publish as an AfterTargets

<AndroidBuildAfterThisTarget Condition="'$(AndroidBuildAfterThisTarget)' == ''">Publish</AndroidBuildAfterThisTarget>
, the Android build is kicked off, thus hitting _CopyTestArchive and removing the output directory before we actually try to compile the actual project in CoreCompile

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Jun 21, 2024
@steveisok steveisok added this to the Future milestone Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants