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

iphoneos framework very large size issue (build-apple-framework.sh) #1353

Open
wonhee-jeong opened this issue Mar 15, 2024 · 7 comments
Open
Labels
enhancement New feature or request

Comments

@wonhee-jeong
Copy link

Problem

When building the iphoneos framework in the build-apple-framework.sh script, bitcode is enabled and the binary size is very large (more than 500MB).
Bitcode is disabled in scripts in the react native repository.

Solution

In build-apple-framework.sh, set -DHERMES_ENABLE_BITCODE:BOOLEAN=false

cmake -S . -B "build_$1" -G "$BUILD_SYSTEM" \
    -DHERMES_APPLE_TARGET_PLATFORM:STRING="$1" \
    -DCMAKE_OSX_ARCHITECTURES:STRING="$2" \
    -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$3" \
    -DHERMES_ENABLE_DEBUGGER:BOOLEAN="$enable_debugger" \
    -DHERMES_ENABLE_INTL:BOOLEAN=true \
    -DHERMES_ENABLE_LIBFUZZER:BOOLEAN=false \
    -DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \
    -DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \
    -DHERMES_ENABLE_BITCODE:BOOLEAN=false \
    -DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \
    -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \
    -DHERMES_ENABLE_TOOLS:BOOLEAN="$build_cli_tools" \
    -DIMPORT_HERMESC:PATH="$PWD/build_host_hermesc/ImportHermesc.cmake" \
    -DCMAKE_INSTALL_PREFIX:PATH=../destroot \
    -DCMAKE_BUILD_TYPE="$BUILD_TYPE"
@wonhee-jeong wonhee-jeong added the enhancement New feature or request label Mar 15, 2024
@tmikov
Copy link
Contributor

tmikov commented Mar 15, 2024

The iOS build scrips in the Hermes directory are outdated and unmaintained. We should just delete them.

@wonhee-jeong
Copy link
Author

Thank you for the kind explanation.
That was just an example script.

@ZkGator
Copy link

ZkGator commented Apr 26, 2024

What is the correct/recommended way to build ios framework if those scripts under utils are no longer relevant?

@tmikov
Copy link
Contributor

tmikov commented Apr 26, 2024

@ZkGator
Copy link

ZkGator commented Apr 27, 2024

Thanks a lot!
P.S. What'd be the option for those who want to build and use Hermes as a standalone artifact?

@tmikov
Copy link
Contributor

tmikov commented Apr 29, 2024

@ZkGator Hermes uses CMake and can be built for any supported OS and likely for some unsupported ones. That hasn't changed. Check our CI scripts for examples. The only thing we are no longer doing is providing a packaged configuration script for iOS framework and a podspec, but those are available from React Native in the link above.

@ZkGator
Copy link

ZkGator commented Apr 29, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants