bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
507 stars 262 forks source link

Is it possible to direct macos_bundle to *not* create the zip archive? #1947

Open photex opened 1 year ago

photex commented 1 year ago

Howdy!

I'm developing a plugin for an application and find the the output of macos_bundle is adding some friction.

What would be ideal is that I would bazel build //plugin:foo and have my bazel-bin/plugin/foo.aaxbundle in a stable location so that I can reliably test and debug in the host app.

Is this somehow possible to acheive?

keith commented 1 year ago

Does passing --define=apple.experimental.tree_artifact_outputs=1 work for that case?

photex commented 1 year ago

Yes! :D Awesome

enso on  main [!?]
❯ bazel build //plugin/enso:aaxplugin
INFO: Invocation ID: d703df4c-8b0a-41cf-9257-cb777772c6e3
INFO: Build option --define has changed, discarding analysis cache.
INFO: Analyzed target //plugin/enso:aaxplugin (0 packages loaded, 1545 targets configured).
INFO: Found 1 target...
Target //plugin/enso:aaxplugin up-to-date:
  bazel-bin/plugin/enso/Enso.aaxplugin
INFO: Elapsed time: 0.260s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

If I build //... there is something strange where bazel-bin is being removed? But I don't think that's related to rules_apple is it?

enso on  main [!?]
❯ bazel build //...
INFO: Invocation ID: cfcdbb8e-d14f-4253-a589-3ffaeb5656b8
INFO: Analyzed 7 targets (0 packages loaded, 876 targets configured).
INFO: Found 7 targets...
WARNING: cleared convenience symlink(s) bazel-bin, bazel-testlogs because their destinations would be ambiguous
INFO: Elapsed time: 0.193s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

Because now I'd have to use the troublesome path bazel-enso/bazel-out/applebin_macos-darwin_arm64-fastbuild-ST-84f77cfb5f58/bin/plugin/enso. This doesn't seem stable to me.

keith commented 1 year ago

https://github.com/bazelbuild/bazel/issues/12389