Skip to content

Conversation

@HoloRin
Copy link
Collaborator

@HoloRin HoloRin commented May 1, 2023

in erlang_bytecode2 rule

@HoloRin HoloRin added this to the 3.10.0 milestone May 2, 2023
@HoloRin HoloRin force-pushed the beam_transition branch 4 times, most recently from 7b4887e to 62bb217 Compare May 4, 2023 10:20
@HoloRin HoloRin modified the milestones: 3.10.0, 3.11.0 May 4, 2023
@HoloRin HoloRin force-pushed the beam_transition branch from 62bb217 to 874b3d2 Compare May 4, 2023 18:13
@HoloRin
Copy link
Collaborator Author

HoloRin commented May 11, 2023

Like there is for rules_docker, there should probably be a flag to disable these transitions (--@io_bazel_rules_docker//transitions:enable=false).

@HoloRin HoloRin force-pushed the beam_transition branch 5 times, most recently from d1a2f0b to 92fa2e4 Compare May 24, 2023 08:04
@HoloRin HoloRin force-pushed the beam_transition branch from 92fa2e4 to 8b3621d Compare June 8, 2023 12:05
@HoloRin
Copy link
Collaborator Author

HoloRin commented Jun 15, 2023

Like there is for rules_docker, there should probably be a flag to disable these transitions (--@io_bazel_rules_docker//transitions:enable=false).

Done

@HoloRin
Copy link
Collaborator Author

HoloRin commented Jun 15, 2023

It has occurred to me that it's possible we want to also represent the beam version with this transition, to be able to for instance target an otp 26 runtime, but compile with 25. I think this should be possible, if we indicate the otp version in the host or exec platform definition as well. The transition will then have to handle this compatibility, and also the @erlang_config repository will have to define cpu's for each beam version instead of the single beam cpu that this PR currently contains.

@HoloRin HoloRin force-pushed the beam_transition branch 2 times, most recently from 7910f04 to 1ffb5c5 Compare June 16, 2023 12:29
@HoloRin
Copy link
Collaborator Author

HoloRin commented Jun 19, 2023

It has occurred to me that it's possible we want to also represent the beam version with this transition, to be able to for instance target an otp 26 runtime, but compile with 25. I think this should be possible, if we indicate the otp version in the host or exec platform definition as well. The transition will then have to handle this compatibility, and also the @erlang_config repository will have to define cpu's for each beam version instead of the single beam cpu that this PR currently contains.

Thinking further about this, I'm inclined not to force/resolve the compatibility in the analysis phase of the build. This is partly because I can't think of how to achieve it without projecting out rules for each erlang version an annotating with exec_compatible_with & target_compatible_with and letting platform flags filter, and I see this being problematic when you just want to run with the host erlang, and see what happens. If we did just try to handle it with transitions, then I think we would need additional custom build settings to indicate what erlang jump is intended. Neither of these sound very good to me and so long as this PR is compatible with using host_platform/platform to set 2 erlang versions and test for example otp 25 bytecode running on otp 26, then this is sufficient with beam as a custom cpu that does not encode it's otp version.

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.

2 participants