-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The same build tool currently relies on the standard library's filepath.Glob for resolving task inputs. This implementation does not support the recursive double-star syntax (e.g., src/**/*.go), which forces users to explicitly list subdirectories or limits task definitions to flat directory structures.
This limitation contradicts the documentation examples and common user expectations for modern build tools. This issue proposes replacing the standard globbing mechanism with a library that supports recursive pattern matching (such as github.com/bmatcuk/doublestar) to allow flexible file selection across nested directory trees.
Goals
- Recursive Matching: Enable users to define inputs using
**to match files in arbitrary subdirectories. - Determinism: Ensure that the order of resolved files remains strictly deterministic (lexicographically sorted) to preserve the stability of input hashes and caching.
- Safety: Prevent infinite loops caused by symbolic links during recursive directory walking.
Acceptance Criteria
- Core Syntax Support: The
ResolveInputsmethod ininternal/adapters/fs/resolver.gocorrectly expands patterns containing**segments.- Example:
src/**/*.gomatches.gofiles insrc/,src/foo/, andsrc/foo/bar/.
- Example:
- Deterministic Output: The list of resolved file paths is strictly sorted lexicographically before being returned, ensuring consistent hashes across different environments.
- Symlink Safety: The walker either ignores symbolic links or implements cycle detection to prevent infinite recursion loop errors.
- Test Coverage: New test cases in
internal/adapters/fs/resolver_test.goverify:- Matching of deeply nested files.
- Correct sorting of results.
- Behavior when no files match the recursive pattern.
- Dependency Management: A robust globbing library (e.g.,
doublestar) is added togo.modif the standard library is insufficient.
Metadata
Metadata
Assignees
Labels
No labels