Skip to content

Support resources of arbitrary size in rebar3 #2956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aronisstav
Copy link
Contributor

Removes arbitrary restriction to 2, 3, 4, or 6-element tuples for (possibly custom) resource specifications.

-spec get_resource_type(tuple(), [resource()]) -> {ok, resource()}.
get_resource_type(Source, Resources) when tuple_size(Source) > 0 ->
Type = element(1, Source),
get_resource(Type, Source, Resources);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Location and Source aren't the same. In some cases the Location is pulled out of the tuple.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! The reason I originally flattened everything is that a custom resource of size 2-4 can have whatever it likes in its tuple elements, so I thought that being picky about Source and Location is maybe too specific, especially if all this generates is an error message (which may not be the case).

I restored the existing clauses, and merely extended the size 6 case to cover all sizes > 4. The main motivation for the PR is to properly add support a custom resource I am using for some private code, which needs 5 args and previously raised a mere Failed to fetch and copy dep:.

Removes arbitrary restriction to 2, 3, 4, or 6-element tuples for (possibly custom) resource specifications.
@aronisstav aronisstav force-pushed the feature/allow-resources-of-any-size branch from f8af7eb to 54ce6ce Compare June 12, 2025 06:59
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