Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@godofredoc
Copy link
Contributor

This is to simplify the migration to engine_v2 recipes and can potentially simplify the existing recipes moving most of the logic to the engine repository.

Bug: flutter/flutter#81855

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

This is to simplify the migration to engine_v2 recipes and can
potentially simplify the existing recipes moving most of the logic to
the engine repository.

Bug: flutter/flutter#81855
@zanderso zanderso requested review from jmagman and zanderso August 4, 2022 20:33
Comment on lines 41 to 44
# TODO(gw280): Remove --simulator-out-dir alias when all recipes are updated
parser.add_argument(
'--simulator-x64-out-dir', '--simulator-out-dir', type=str, required=True
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

parser.add_argument('--clang-dir', type=str, default='clang_x64')
parser.add_argument('--x64-out-dir', type=str)
parser.add_argument('--arm64-out-dir', type=str, required=True)
parser.add_argument('--armv7-out-dir', type=str, required=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing should be using this arg anymore as of https://flutter-review.googlesource.com/c/recipes/+/29060, all armv7 logic should be removed. I guess we missed that cleanup in

if args.armv7_out_dir:

Suggested change
parser.add_argument('--armv7-out-dir', type=str, required=False)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument is still here, are we calling it somewhere?

Comment on lines 88 to 155
framework = os.path.join(dst, 'Flutter.framework')
simulator_framework = os.path.join(dst, 'sim', 'Flutter.framework')
arm64_framework = os.path.join(arm64_out_dir, 'Flutter.framework')
simulator_x64_framework = os.path.join(
simulator_x64_out_dir, 'Flutter.framework'
)
if args.simulator_arm64_out_dir is not None:
simulator_arm64_framework = os.path.join(
args.simulator_arm64_out_dir, 'Flutter.framework'
)
simulator_arm64_dylib = os.path.join(simulator_arm64_framework, 'Flutter')

arm64_dylib = os.path.join(arm64_framework, 'Flutter')
simulator_x64_dylib = os.path.join(simulator_x64_framework, 'Flutter')

if not os.path.isdir(arm64_framework):
print('Cannot find iOS arm64 Framework at %s' % arm64_framework)
return 1

if not os.path.isdir(simulator_x64_framework):
print('Cannot find iOS x64 simulator Framework at %s' % simulator_framework)
return 1

if not os.path.isfile(arm64_dylib):
print('Cannot find iOS arm64 dylib at %s' % arm64_dylib)
return 1

if not os.path.isfile(simulator_x64_dylib):
print('Cannot find iOS simulator dylib at %s' % simulator_dylib)
return 1

if not os.path.isfile(DSYMUTIL):
print('Cannot find dsymutil at %s' % DSYMUTIL)
return 1

shutil.rmtree(framework, True)
shutil.copytree(arm64_framework, framework)
framework_binary = os.path.join(framework, 'Flutter')
process_framework(args, framework, framework_binary)

if args.simulator_arm64_out_dir is not None:
shutil.rmtree(simulator_framework, True)
shutil.copytree(simulator_arm64_framework, simulator_framework)

simulator_framework_binary = os.path.join(simulator_framework, 'Flutter')

# Create the arm64/x64 simulator fat framework.
subprocess.check_call([
'lipo', simulator_x64_dylib, simulator_arm64_dylib, '-create',
'-output', simulator_framework_binary
])
process_framework(args, simulator_framework, simulator_framework_binary)
simulator_framework = simulator_framework
else:
simulator_framework = simulator_x64_framework

# Create XCFramework from the arm-only fat framework and the arm64/x64 simulator frameworks, or just the
# x64 simulator framework if only that one exists.
xcframeworks = [simulator_framework, framework]
create_xcframework(location=dst, name='Flutter', frameworks=xcframeworks)

# Add the x64 simulator into the fat framework
subprocess.check_call([
'lipo', arm64_dylib, simulator_x64_dylib, '-create', '-output',
framework_binary
])

process_framework(args, framework, framework_binary)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pull this out into a function called create_framework or something similar so it's the same abstraction level as generate_gen_snapshot and zip_archive?

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm w/ nit after addressing @jmagman's comments.

import subprocess
import shutil
import sys
import os
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please alphabetize imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with nit about removing last armv7 reference.

parser.add_argument('--clang-dir', type=str, default='clang_x64')
parser.add_argument('--x64-out-dir', type=str)
parser.add_argument('--arm64-out-dir', type=str, required=True)
parser.add_argument('--armv7-out-dir', type=str, required=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument is still here, are we calling it somewhere?

@godofredoc
Copy link
Contributor Author

LGTM, with nit about removing last armv7 reference.

Removed it, I missed it in the last commit.

@godofredoc godofredoc added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 5, 2022
@auto-submit auto-submit bot merged commit 76cd7b0 into flutter:main Aug 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 5, 2022
betrevisan pushed a commit to betrevisan/engine that referenced this pull request Aug 5, 2022
emilyabest pushed a commit to emilyabest/engine that referenced this pull request Aug 12, 2022
@godofredoc godofredoc deleted the add_full_ios branch January 12, 2024 19:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants