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

Is it possible to skip the whole codesign stage? #2654

Open
neko-para opened this issue Feb 19, 2025 · 5 comments
Open

Is it possible to skip the whole codesign stage? #2654

neko-para opened this issue Feb 19, 2025 · 5 comments

Comments

@neko-para
Copy link

It seems that in this stage, rules would unzip the bundle, codesign it and re-zip it. These unzipping and zipping steps consume too much time if the app is large (e.g. my bundle is about 3GB). As I would always launch the app via lldb, which can bypass the codesign problem, I'd like to just skip this stage to speedup building.

For instance, it takes me 8s to link the final binary, 15s to bundle, and 60s to codesign (the whole stage). Also, I have an extra unzip genrule (unzip the bundle) which takes about 10s.
I've also tried tree_artifact_outputs option, but this results the codesign stage to cost 150s (which only saves the last unzip stage, which costs 10s).

# Expand the unprocessed archive into the temporary directory.
unzip -qq -d "$WORK_DIR" "$UNPROCESSED_ARCHIVE_PATH"

(
find . -type f -or -type l && \
find . -path "*/Info.plist" | sed -E 's|(/Contents)?/Info.plist$||g' \
) \
| sort \
| zip -qX \
--symlinks \
"-@" \
--compression-method \
"$COMPRESSION_METHOD" "$OUTPUT_BASENAME"

@neko-para
Copy link
Author

Sorry, it turns out that the bundletool_experimental.py in project has been altered by another developer, which incorrectly perform codesign on each dylib during copy files.

But skipping codesign stage is useful, anyway.

@adincebic
Copy link
Contributor

@neko-para you can skip the signing stage for simulator builds. Add the following to your bazelrc

build --features=apple.skip_codesign_simulator_bundles

@neko-para
Copy link
Author

@neko-para you can skip the signing stage for simulator builds. Add the following to your bazelrc

build --features=apple.skip_codesign_simulator_bundles

I've tried this, but it seems not working on macos application 🤔

@adincebic
Copy link
Contributor

@neko-para you can skip the signing stage for simulator builds. Add the following to your bazelrc

build --features=apple.skip_codesign_simulator_bundles

I've tried this, but it seems not working on macos application 🤔

I would expect that since there is no macOS simulator.

@brentleyjones
Copy link
Collaborator

--features=disable_legacy_signing and then possibly using the dossier:

% bazel build //path/to/ios_app \
--output_groups=+dossier \
--features=disable_legacy_signing \
--ios_multi_cpus=arm64
% ./dossier_codesigning_reader.py sign \
--codesign /usr/bin/codesign \
--dossier=bazel-bin/path/to/ios_app_dossier.zip \
--output_artifact=~/Desktop/ios_app.ipa \
bazel-bin/path/to/ios_app_dossier_with_bundle.ipa

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

No branches or pull requests

3 participants