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

RBE refactor - build fails to copy MacOSX SDK due to Too many levels of symbolic links #140977

Closed
keyonghan opened this issue Jan 4, 2024 · 7 comments
Assignees
Labels
P1 High-priority issues at the top of the work list team-infra Owned by Infrastructure team triaged-infra Triaged by Infrastructure team

Comments

@keyonghan
Copy link
Contributor

keyonghan commented Jan 4, 2024

RBE refactoring is WIP: flutter/engine#49416.

Linux mac_unopt fails when copying MacOSX SDK to CAS: https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20Engine%20Drone/606402/overview

'/Volumes/Work/s/w/ir/x/w/recipe_cleanup/out-cas-directorysxzsrkv_/host_debug_unopt_arm64/gen/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/Headers/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby/ruby', "[Errno 62] Too many levels of symbolic links:

@keyonghan keyonghan self-assigned this Jan 4, 2024
@keyonghan keyonghan added team-infra Owned by Infrastructure team P1 High-priority issues at the top of the work list labels Jan 4, 2024
@keyonghan
Copy link
Contributor Author

src/out/host_debug_unopt_arm64/gen/SDKs/MacOSX13.3.sdk is a symlink pointing to osx_sdk/xcode_14e300c/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk.

Too many levels of symbolic links happens due to some defult symlinks related to ruby from the xcode CIPD pacakge.

@keyonghan
Copy link
Contributor Author

keyonghan commented Jan 4, 2024

Have tried a couple of LED runs based on the drone build:

Failed:

  • Attempt1: remove symlink, copy target to src/out, copy directly from xcode/sdk (self.m.path['cache'].join('osx_sdk', 'xcode_14e300c', 'XCode.app', 'Contents', 'Developer', 'Platforms', 'MacOSX.platform', 'Developer', 'SDKs', 'MacOSX13.3.sdk') to build_dir.join('gen', 'SDKs', 'MacOSX13.3.sdk') - Too many levels of symbolic links
  • Attempt2: remove symlink, copy target to src/out, zip xcode/sdk - Not all files were readable
  • Attempt3: remove symlink, copy target to src/out, recreate symlink in src/out pointing to xcode/sdk - infra error when uploaded to cas
  • Attempt4: copy target to src/out with symlinks=True - infra error when uploaded to cas

Succeeded:

  • Attempt5: remove symlink, copy target to src/out, upload without MacOS_SDK - Pass

@keyonghan
Copy link
Contributor Author

Following up with the above Attempt5. By removing symlink and upload to CAS without MacOS_SDK, it also passes on parent build:
Linux mac_unopt
Mac mac_ios_engine
Mac mac_host_engine

Since this affects only the digest uploaded to CAS, it would not affect artifacts uploaded to GCS and then should not affect Framework side.

@keyonghan keyonghan added the triaged-infra Triaged by Infrastructure team label Jan 4, 2024
@keyonghan
Copy link
Contributor Author

To make it work, I have to manually remove the symlinks of MacOS SDK in three locations:

src/out/`build name`/gen/SDKs - host_debug_unopt & host_debug_unopt_arm64
src/out/`build name`/clang_x64/gen/SDKs - ios_debug_sim
src/out/`build name`/clang_arm64/gen/SDKs - ios_debug_sim_arm64_extension_safe

@zanderso Are these three locations enough? Is there any way to auto retrieve these three locations, I mean clang_x64/clang_arm64?

@zanderso
Copy link
Member

zanderso commented Jan 4, 2024

I suspect those locations are enough. As for clang_x64 and clang_arm64, there isn't any way to programmatically retrieve those locations from somewhere that I can think of off the top of my head, but those are the standard names for the output directory for targets that are cross-built during our GN build.

You might also walk the tree looking for paths that end in .../gen/SDKs/, and assume that the contents is the symlinks that need to be removed.

@keyonghan
Copy link
Contributor Author

https://flutter-review.googlesource.com/c/recipes/+/53803 is a potential fix. But a better approach to move the MacOS SDK to a different location works. Closing.

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 High-priority issues at the top of the work list team-infra Owned by Infrastructure team triaged-infra Triaged by Infrastructure team
Projects
None yet
Development

No branches or pull requests

2 participants