Skip to content

Conversation

@keith
Copy link
Contributor

@keith keith commented Sep 11, 2025

This inlines this into the executable rules instead.

Fixes #605
Fixes #621

@aspect-workflows
Copy link

aspect-workflows bot commented Sep 11, 2025

Test

All tests were cache hits

45 tests (100.0%) were fully cached saving 1m 49s.

@keith keith force-pushed the ks/remove-determine_main-rule branch from b449adf to 62920f5 Compare September 11, 2025 19:38
This inlines this into the executable rules instead.

Fixes aspect-build#605
Fixes aspect-build#621
@keith keith force-pushed the ks/remove-determine_main-rule branch from 62920f5 to 012a826 Compare September 11, 2025 19:46
# NB: we don't use the py_binary macro here, because we want our `main` attribute to be used
# exactly as specified here, rather than follow rules_python semantics.
py_binary_rule(
py_binary(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't follow what this was testing, but it was trying to force a main file w/o any srcs. if im missing something this case likely doesn't work with this change

arrdem added a commit that referenced this pull request Nov 5, 2025
Determining the main using suffix matching was always a goofy idea. The underlying rules have long required that main be a label. Rip out determine_main and provide minimal default semantics for main as part of the existing wrapper macros.

Those too should go away, but for now we have them.

Replaces #641 with thanks to Keith.
@arrdem
Copy link
Collaborator

arrdem commented Nov 5, 2025

Closing in favor of just ditching this behavior.

@arrdem arrdem closed this Nov 5, 2025
arrdem added a commit that referenced this pull request Nov 5, 2025
Determining the main using suffix matching was always a goofy idea. The
underlying rules have long required that main be a label. Rip out
determine_main and provide minimal default semantics for main as part of
the existing wrapper macros.

Those too should go away, but for now we have them.

Replaces #641 with thanks to Keith.
arrdem added a commit that referenced this pull request Nov 7, 2025
Vendor `rules_python`'s `determine_main` and remove the need for a
separate `determine_main` target which complicates exec properties.

Replaces #641 with thanks to Keith.
Fixes #605
Fixes #621

Note that `py_venv_*` already mandates that a `main=` label be provided,
so this is for legacy `py_binary` only. Should be removed in 2.0.

### Changes are visible to end-users: no

- Searched for relevant documentation and updated as needed: yes
- Breaking change (forces users to change their own code or config): no
- Suggested release notes appear below: yes

The internal `determine_main` targets have been eliminated, simplifying some advanced usages.

### Test plan

- Covered by existing test cases

---------

Co-authored-by: aspect-marvin[bot] <[email protected]>
@keith keith deleted the ks/remove-determine_main-rule branch November 19, 2025 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants