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

[Fix] Exception in iosDynamicFramework Post-Merge workflow #21262

Merged
merged 20 commits into from
Jul 12, 2024
Merged

Conversation

mszhanyi
Copy link
Contributor

@mszhanyi mszhanyi commented Jul 5, 2024

Description

the exception was caused by 3dd6fcc

Why I add skip_macos_test
because there's new an exception in https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1425579&view=logs&j=c90c5af3-67d5-5936-5a62-71c93ebfca65&t=01038f35-8e78-5801-1aa1-d9647bb65858

2024-07-05T14:41:09.3864740Z mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-akksnidsbpojopfdqrclgsoqqerv/Build/Products/Debug/macos_package_testUITests.xctest/Contents/Frameworks
2024-07-05T14:41:09.3933430Z mkdir: /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-akksnidsbpojopfdqrclgsoqqerv/Build/Products/Debug/macos_package_testUITests.xctest: Operation not permitted
2024-07-05T14:41:09.3996760Z /var/folders/0f/b0mzpg5d31z074x3z5lzkdxc0000gn/T/tmp97ycvwq5/apple_package_test/Pods/Target Support Files/Pods-macos_package_testUITests/Pods-macos_package_testUITests-frameworks.sh: line 7: realpath: command not found
2024-07-05T14:41:09.4003170Z :18: error: Unexpected failure
2024-07-05T14:41:11.1323470Z error: Sandbox: mkdir(72212) deny(1) file-write-create /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-akksnidsbpojopfdqrclgsoqqerv/Build/Products/Debug/macos_package_testUITests.xctest (in target 'macos_package_testUITests' from project 'apple_package_test')
2024-07-05T14:41:11.1325620Z 
2024-07-05T14:41:11.8731110Z 
2024-07-05T14:41:11.8733040Z Test session results, code coverage, and logs:
2024-07-05T14:41:11.8734820Z 	/Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-akksnidsbpojopfdqrclgsoqqerv/Logs/Test/Test-macos_package_test-2024.07.05_14-40-38-+0000.xcresult
2024-07-05T14:41:11.8735530Z 
2024-07-05T14:41:11.8906210Z Testing failed:
2024-07-05T14:41:11.8911060Z 	Sandbox: mkdir(72212) deny(1) file-write-create /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-akksnidsbpojopfdqrclgsoqqerv/Build/Products/Debug/macos_package_testUITests.xctest
2024-07-05T14:41:11.8912570Z 	Unexpected failure
2024-07-05T14:41:11.8913690Z 	Testing cancelled because the build failed.
2024-07-05T14:41:11.8914380Z 
2024-07-05T14:41:11.8914970Z ** TEST FAILED **
2024-07-05T14:41:11.8915480Z 
2024-07-05T14:41:11.8915780Z 
2024-07-05T14:41:11.8916750Z The following build commands failed:
2024-07-05T14:41:11.8919280Z 	PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-akksnidsbpojopfdqrclgsoqqerv/Build/Intermediates.noindex/apple_package_test.build/Debug/macos_package_testUITests.build/Script-059136A7770CA5376C30F2FD.sh (in target 'macos_package_testUITests' from project 'apple_package_test')
2024-07-05T14:41:11.8922180Z (1 failure)

And I find macos test is skipped in

- script: |
python3 tools/ci_build/github/apple/test_apple_packages.py \
--fail_if_cocoapods_missing \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/xcframework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out" \
--variant Full \
--skip_macos_test \
--mac_catalyst_enabled
displayName: "Test Apple framework"
as well.
Maybe it is an known issue.

Motivation and Context

@mszhanyi mszhanyi requested a review from a team as a code owner July 5, 2024 12:35
@mszhanyi mszhanyi requested a review from skottmckay July 5, 2024 15:25
@edgchen1
Copy link
Contributor

edgchen1 commented Jul 5, 2024

And I find macos test is skipped in

- script: |
python3 tools/ci_build/github/apple/test_apple_packages.py \
--fail_if_cocoapods_missing \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/xcframework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out" \
--variant Full \
--skip_macos_test \
--mac_catalyst_enabled
displayName: "Test Apple framework"
as well.
Maybe it is an known issue.

It's skipped there because that build doesn't include a MacOS framework.

python3 tools/ci_build/github/apple/build_apple_framework.py \
--build_dir "$(Build.BinariesDirectory)/ios_framework" \
tools/ci_build/github/apple/default_full_ios_framework_build_settings.json

See the build settings file:
https://github.com/microsoft/onnxruntime/blob/9ef28f092f575ce15bfc40c7663e649e75809c53/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json

This one does:

python tools/ci_build/github/apple/build_apple_framework.py \
--build_dir "$(Build.BinariesDirectory)/ios_framework" \
--build_dynamic_framework \
tools/ci_build/github/apple/default_full_apple_framework_build_settings.json

https://github.com/microsoft/onnxruntime/blob/9ef28f092f575ce15bfc40c7663e649e75809c53/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json

@snnn
Copy link
Member

snnn commented Jul 8, 2024

 line 7: realpath: command not found

Why do we have this error? Which bash script it was executing?

@mszhanyi
Copy link
Contributor Author

mszhanyi commented Jul 9, 2024

I installed realpath in MacOS, but there's still exceptions that
https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1425914&view=results
mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-czndqrumonhwrcfnzjpzvusppkaz/Build/Products/Debug/macos_package_testUITests.xctest/Contents/Frameworks
mkdir: /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-czndqrumonhwrcfnzjpzvusppkaz/Build/Products/Debug/macos_package_testUITests.xctest: Operation not permitted

@edgchen1 do you know where the mkdir is called. I don't find it in the repo.

And I'm a little confused that why there's macOS since the stage name is called iosDynamicFramewok

@edgchen1
Copy link
Contributor

edgchen1 commented Jul 9, 2024

@edgchen1 do you know where the mkdir is called. I don't find it in the repo.

mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-czndqrumonhwrcfnzjpzvusppkaz/Build/Products/Debug/macos_package_testUITests.xctest/Contents/Frameworks
mkdir: /Users/runner/Library/Developer/Xcode/DerivedData/apple_package_test-czndqrumonhwrcfnzjpzvusppkaz/Build/Products/Debug/macos_package_testUITests.xctest: Operation not permitted
/private/var/folders/0f/b0mzpg5d31z074x3z5lzkdxc0000gn/T/tmpl8pn_rhn/apple_package_test/Pods/Target Support Files/Pods-macos_package_testUITests/Pods-macos_package_testUITests-frameworks.sh:18: error: Unexpected failure

This Pods-macos_package_testUITests-frameworks.sh script looks like some generated CocoaPods thing.

And I'm a little confused that why there's macOS since the stage name is called iosDynamicFramewok

That's a good point. This was changed in #20773. It used to point to an iOS-only build settings file but that one got deleted.

It might be simpler to change it back to an iOS-only build for now. It looks like there are other things to fix for MacOS.

I think tools/ci_build/github/apple/default_full_ios_framework_build_settings.json is too heavy as it has quite a few sysroot/arch combinations. E.g., we could use another one which only builds iphonesimulator/x86_64.

Yi Zhang added 2 commits July 11, 2024 10:48
@mszhanyi
Copy link
Contributor Author

mszhanyi commented Jul 11, 2024

Since we need other things to fix for MacOS, I add a new setting files only for iOS and skip macos test that the pipeline can pass.
https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1429950&view=results

@mszhanyi mszhanyi requested a review from edgchen1 July 12, 2024 00:00
@snnn snnn merged commit f2ebd1c into main Jul 12, 2024
98 of 101 checks passed
@snnn snnn deleted the zhanyi/postios branch July 12, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants