Skip to content

fix(erlang_xrl_yrl): install a release-tar erlang before running erlc - #12

Open
TrapsterDK wants to merge 1 commit into
bazelverse:mainfrom
TrapsterDK:pr1
Open

TrapsterDK wants to merge 1 commit into
bazelverse:mainfrom
TrapsterDK:pr1

Conversation

@TrapsterDK

Copy link
Copy Markdown

Fixes #11.

Problem
erlang_xrl_yrl passes maybe_install_erlang to format(), but its script template has no {maybe_install_erlang} line. With a toolchain that ships erlang as a release tar, the tar is never unpacked for this action. erlc then works only if another action already unpacked it under the install path.

Change
Add the placeholder to the script, as erlang_bytecode2 does. One line.

Test

  • private/xrl_yrl_test: analysis tests with a fake release-tar toolchain. They check that the ERLC action for a .xrl and a .yrl target runs tar --extract and has the tar as an input. Both fail on main and pass with the fix.
  • test/xrl_yrl: builds a .xrl and a .yrl with the default toolchain and checks the generated modules. This is a smoke test; the analysis tests above are the regression test.

Test output (OTP 29.1.2, Bazel 9.2.0, --nohome_rc)

The PR was also checked alone on main (5/5 root tests pass). The output below is from all four of my PRs stacked (bazel test //... in the root, then in test/).

//:util_tests_test_0 (cached) PASSED in 0.0s
//private:app_file_test (cached) PASSED in 0.0s
//private:util_tests_test_0 (cached) PASSED in 0.0s
//private/ct_auto_sname_test:auto_sname_posix_test (cached) PASSED in 0.0s
//private/ct_auto_sname_test:auto_sname_windows_test (cached) PASSED in 0.0s
//private/ct_auto_sname_test:default_posix_test (cached) PASSED in 0.0s
//private/ct_auto_sname_test:no_sname_posix_test (cached) PASSED in 0.0s
//private/ct_auto_sname_test:no_sname_windows_test (cached) PASSED in 0.1s
//private/otp_tree_test:erl_eval_with_release_tar_test (cached) PASSED in 0.0s
//private/otp_tree_test:erl_eval_with_tree_test (cached) PASSED in 0.1s
//private/otp_tree_test:erl_runs_from_tree_test (cached) PASSED in 0.0s
//private/otp_tree_test:eunit_with_tree_test (cached) PASSED in 0.0s
//private/otp_tree_test:template_vars_with_tree_test (cached) PASSED in 0.0s
//private/xrl_yrl_test:lexer_installs_erlang_test (cached) PASSED in 0.1s
//private/xrl_yrl_test:parser_installs_erlang_test (cached) PASSED in 0.0s
Executed 0 out of 15 tests: 15 tests pass.
//app_file:test_applications_preserved PASSED in 0.1s
//ct_no_sname:no_sname_SUITE PASSED in 3.2s
//custom_vars:custom_var_test PASSED in 0.0s
//dot_app_to_json:dialyze PASSED in 0.9s
//dot_app_to_json:dot_app_to_json_SUITE PASSED in 3.2s
//dot_app_to_json:xref PASSED in 0.6s
//erl_attrs_to_json:dialyze PASSED in 0.9s
//erl_attrs_to_json:erl_attrs_to_json_SUITE PASSED in 3.5s
//erl_attrs_to_json:xref PASSED in 0.3s
//rebar_config_to_json:dialyze PASSED in 0.9s
//rebar_config_to_json:rebar_config_to_json_SUITE PASSED in 3.2s
//rebar_config_to_json:xref PASSED in 0.6s
//shard_suite:dialyze PASSED in 0.9s
//shard_suite:eunit PASSED in 0.5s
//shard_suite:shard_suite_SUITE PASSED in 3.6s
//shard_suite:xref PASSED in 0.6s
//xrl_yrl:xrl_yrl_test PASSED in 0.1s
Executed 17 out of 18 tests: 17 tests pass and 1 was skipped.

Assisted by Claude.

The ERLC action of erlang_xrl_yrl formats maybe_install_erlang into its
script, but the template had no {maybe_install_erlang} placeholder. With
a toolchain that ships erlang as a release tar, the tar was never
unpacked, so erlc only worked if another action had unpacked it first.

Add the placeholder, as erlang_bytecode2 does. Add analysis tests that
check the ERLC action unpacks the release tar, and a test/ package that
builds a .xrl and a .yrl.

Assisted by Claude.
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

Successfully merging this pull request may close these issues.

erlang_xrl_yrl does not install a release-tar erlang before running erlc

1 participant