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

Add bundle_id parameter to apple_resource_bundle #1182

Merged
merged 2 commits into from Jun 9, 2021
Merged

Add bundle_id parameter to apple_resource_bundle #1182

merged 2 commits into from Jun 9, 2021

Conversation

steeve
Copy link
Contributor

@steeve steeve commented Jun 9, 2021

This enables having resource bundles with assets in them, since a bundle_id is
required for those.

Fix #639

@google-cla google-cla bot added the cla: yes label Jun 9, 2021
@steeve
Copy link
Contributor Author

steeve commented Jun 9, 2021

I am unable to update the documentation:

$  bazel run //doc:update
INFO: Analyzed target //doc:update (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/steeve/code/github.com/znly/rules_apple/doc/BUILD.bazel:28:12: Generating proto for Starlark doc for resources_doc failed (Exit 1) stardoc failed: error executing command bazel-out/host/bin/external/io_bazel_stardoc/stardoc/stardoc '--input=//apple:resources.bzl' '--workspace_name=build_bazel_rules_apple' '--dep_roots=.' '--dep_roots=external/build_bazel_rules_apple' ... (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
com.google.devtools.build.skydoc.SkydocMain$StarlarkEvaluationException: File external/rules_cc/cc/defs.bzl imported '//cc/private/rules_impl:cc_flags_supplier.bzl', yet external/rules_cc/cc/private/rules_impl/cc_flags_supplier.bzl was not found, even at roots [., external/build_bazel_rules_apple].
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:412)
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:402)
	at com.google.devtools.build.skydoc.SkydocMain.eval(SkydocMain.java:260)
	at com.google.devtools.build.skydoc.SkydocMain.main(SkydocMain.java:163)
Caused by: java.nio.file.NoSuchFileException: external/rules_cc/cc/private/rules_impl/cc_flags_supplier.bzl
	at com.google.devtools.build.skydoc.SkydocMain.getInputSource(SkydocMain.java:454)
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:385)
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:402)
	... 3 more
Stardoc documentation generation failed: File external/rules_cc/cc/defs.bzl imported '//cc/private/rules_impl:cc_flags_supplier.bzl', yet external/rules_cc/cc/private/rules_impl/cc_flags_supplier.bzl was not found, even at roots [., external/build_bazel_rules_apple].
Target //doc:update failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.628s, Critical Path: 0.50s
INFO: 1 process: 1 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

The workaround in bazelbuild/stardoc#92 doesn't work, it fails right after with:

$ bazel run //doc:update
Starting local Bazel server and connecting to it...
INFO: Analyzed target //doc:update (39 packages loaded, 572 targets configured).
INFO: Found 1 target...
ERROR: /Users/steeve/code/github.com/znly/rules_apple/doc/BUILD.bazel:28:12: Generating proto for Starlark doc for tvos.doc_doc failed (Exit 1) stardoc failed: error executing command bazel-out/host/bin/external/io_bazel_stardoc/stardoc/stardoc '--input=//apple:tvos.doc.bzl' '--workspace_name=build_bazel_rules_apple' '--dep_roots=.' '--dep_roots=external/build_bazel_rules_apple' ... (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
com.google.devtools.build.skydoc.SkydocMain$StarlarkEvaluationException: File apple/internal/tvos_rules.bzl imported '@build_bazel_rules_apple//apple/internal/aspects:swift_dynamic_framework_aspect.bzl', yet apple/internal/aspects/swift_dynamic_framework_aspect.bzl was not found, even at roots [., external/build_bazel_rules_apple].
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:412)
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:402)
	at com.google.devtools.build.skydoc.SkydocMain.eval(SkydocMain.java:260)
	at com.google.devtools.build.skydoc.SkydocMain.main(SkydocMain.java:163)
Caused by: java.nio.file.NoSuchFileException: apple/internal/aspects/swift_dynamic_framework_aspect.bzl
	at com.google.devtools.build.skydoc.SkydocMain.getInputSource(SkydocMain.java:454)
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:385)
	at com.google.devtools.build.skydoc.SkydocMain.recursiveEval(SkydocMain.java:402)
	... 3 more
Stardoc documentation generation failed: File apple/internal/tvos_rules.bzl imported '@build_bazel_rules_apple//apple/internal/aspects:swift_dynamic_framework_aspect.bzl', yet apple/internal/aspects/swift_dynamic_framework_aspect.bzl was not found, even at roots [., external/build_bazel_rules_apple].
Target //doc:update failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.869s, Critical Path: 0.66s
INFO: 1 process: 1 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

@thii
Copy link
Member

thii commented Jun 9, 2021

bazel test //doc:all
bazel run //doc:update

This enables having resource bundles with assets in them, since a bundle_id is
required for those.

Signed-off-by: Steeve Morin <[email protected]>
Copy link
Member

@thii thii left a comment

Choose a reason for hiding this comment

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

Can you add a simple test? (There's infoplist_contents_test)

@thii
Copy link
Member

thii commented Jun 9, 2021

Nevermind, you have the tests now :)

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

Successfully merging this pull request may close these issues.

When bulding a resources bundle, should add plist if there are images.
3 participants