Skip to content

Commit

Permalink
[ci] Update path for generated *.include.* files (#8980)
Browse files Browse the repository at this point in the history
Context: a7b5768
Context: a0b7aad

Ever since commit a0b7aad, the **Prepare .NET Release** >
**Push Internal** job has been failing:

	Step Xamarin.Android.Prepare.Step_CopyExtraResultFilesForCI failed: Could not find a part of the path 'D:\a\_work\1\s\src\monodroid\jni'.
	System.InvalidOperationException: Step Xamarin.Android.Prepare.Step_CopyExtraResultFilesForCI failed: Could not find a part of the path 'D:\a\_work\1\s\src\monodroid\jni'.
	 ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\a\_work\1\s\src\monodroid\jni'.
	   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
	   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
	   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
	   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
	   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
	   at System.IO.Directory.GetFiles(String path, String searchPattern, EnumerationOptions enumerationOptions)
	   at Xamarin.Android.Prepare.Step_CopyExtraResultFilesForCI.CopyExtraBuildFiles(String destinationRoot, Context context) in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Steps\Step_CopyExtraResultFilesForCI.cs:line 72
	   at Xamarin.Android.Prepare.Step_CopyExtraResultFilesForCI.<>c__DisplayClass1_0.<Execute>b__0() in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Steps\Step_CopyExtraResultFilesForCI.cs:line 24
	   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
	--- End of stack trace from previous location ---
	   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
	   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
	--- End of stack trace from previous location ---
	   at Xamarin.Android.Prepare.Step_CopyExtraResultFilesForCI.Execute(Context context) in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Steps\Step_CopyExtraResultFilesForCI.cs:line 22
	   at Xamarin.Android.Prepare.Step.Run(Context context) in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Application\Step.cs:line 42
	   at Xamarin.Android.Prepare.Scenario.Run(Context context, Log log) in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Application\Scenario.cs:line 37
	   --- End of inner exception stack trace ---
	   at Xamarin.Android.Prepare.Scenario.Run(Context context, Log log) in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Application\Scenario.cs:line 48
	   at Xamarin.Android.Prepare.Context.Execute() in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Application\Context.cs:line 511
	   at Xamarin.Android.Prepare.App.Run(String[] args) in D:\a\_work\1\s\build-tools\xaprepare\xaprepare\Main.cs:line 162

The `InvalidOperationException` is thrown because commit a7b5768
reorganized things; `src/monodroid/jni` *no longer exists*, and thus
attempting to read that directory will fail.

Update `Step_CopyExtraResultFilesForCI.CopyExtraBuildFiles()` to
instead look for `src/native/monodroid/*.include.*` files.
This should fix the `InvalidOperationException`.
  • Loading branch information
jonpryor committed May 28, 2024
1 parent 31ee349 commit c611743
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void CopyExtraBuildFiles (string destinationRoot, Context context)
filesToCopyPreserveRelative.AddRange (Directory.GetFiles (javaInteropBuildConfigDir, "*.props"));
}

filesToCopyPreserveRelative.AddRange (Directory.GetFiles (Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "src", "monodroid", "jni"), "*.include.*"));
filesToCopyPreserveRelative.AddRange (Directory.GetFiles (Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "src", "native", "monodroid"), "*.include.*"));

var buildConfigDir = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "bin", $"Build{context.Configuration}");
if (Directory.Exists (buildConfigDir)) {
Expand Down

0 comments on commit c611743

Please sign in to comment.