Repository navigation
feat(erlang_app, ct_suite): forward target_compatible_with and tags - #14
Open
TrapsterDK wants to merge 1 commit into
Open
TrapsterDK wants to merge 1 commit into
TrapsterDK wants to merge 1 commit into
Conversation
erlang_app and test_erlang_app had no way to mark their generated targets as incompatible with a platform or to tag them. ct_suite passed target_compatible_with to the test but not to the suite's bytecode target, so the suite still compiled on platforms it cannot run on. Add target_compatible_with and tags to erlang_app (default None, so nothing changes) and pass them to erlang_bytecode, app_file, the appup copy and erlang_app_info. ct_suite now passes target_compatible_with to the suite's erlang_bytecode as well. Add a test/ package whose targets are all incompatible and whose BUILD file fails at loading time if a generated rule misses either attribute. Assisted by Claude.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13.
Problem
erlang_appandtest_erlang_appcannot mark their generated targets as incompatible with a platform, or tag them.ct_suitepassestarget_compatible_withto the test but not to the suite's bytecode target, so the suite still compiles on platforms where it cannot run.Change
erlang_app: new argumentstarget_compatible_withandtags, both defaultNone. They are passed toerlang_bytecode,app_file, the appupcopy_fileanderlang_app_info.ct_suite: also passestarget_compatible_withto the suite'serlang_bytecode.Test
test/erlang_app_attrs: an app, a test app and a suite, all withtags = ["attrs_fixture"]andtarget_compatible_with = ["@platforms//:incompatible"]. A macro in the same BUILD file walksnative.existing_rules()and fails at loading time if a generated rule misses either attribute.bazel test //...skips the incompatible suite, andbazel query --output=buildshows the tag on each target. On main the package fails to load (_erlang_app() got unexpected keyword arguments: tags, target_compatible_with).Test output (OTP 29.1.2, Bazel 9.2.0,
--nohome_rc)The PR was also checked alone on
main(rootbazel test //...passes). The output below is from all four of my PRs stacked (bazel test //...in the root, then intest/).Assisted by Claude.