Skip to content
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

std.Build.Dependency: add optional~ functions #21841

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

Conversation

dasimmet
Copy link
Contributor

When a std.Build.Dependency relies on a transitive b.lazyDependency to expose an artifact, module, namedWriteFiles or namedLazyPath, calls to these functions panic when the dependency was not downloaded yet, but work fine when it is available in the local cache.

We can prevent this by using optionalArtifact, returning an optional instead of panic.
Same for optionalModule , optionalNamedWriteFiles and optionalNamedLazyPath.
I think the optional~ prefix is better than lazy~ here to avoid confusion with LazyPath.

The downside I guess is it could lead to dead code if the named Item will never be available...

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.

1 participant