-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add ability to construct a LazyPath out of any file from a dependency package #16667
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
Conversation
|
IMO this should be a method on |
ccc7114 to
c5026b4
Compare
I tried implementing it like this instead and I agree, at least the example I provided becomes much cleaner when not having a seperate dependencyPath function. |
andrewrk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this - this is going to make a lot of people happy. I love your SDL proof of concept too. A couple requests-
|
Oh also, wrt lazy dep fetching: this is planned to be implemented in future. I've discussed it a little with Andrew, and the basic idea is this:
Obviously this recompiles the build script a bunch, so we really want to wait for the self-hosted backends to be ready for this to make those rebuilds fast. Anyways, the point here is that optional deps won't be specific to |
c5026b4 to
8d65bbf
Compare
|
My first implementation was a bit hacky so I've rewritten it a bit. Dependencies which don't contain a |
8d65bbf to
acee5db
Compare
acee5db to
a1f8995
Compare
|
Dis gonna be gud! |
a1f8995 to
3f3b00a
Compare
a8f2506 to
96155cf
Compare
mlugg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - a couple minor points.
Dependencies no longer require a build.zig file. Adds path function to Dependency struct which returns a LazyPath into a dependency.
96155cf to
3452042
Compare
Partly closes #16643
This PR implements dependencyPath, and allows for fetching dependencies without a build.zig.This PR adds support for non zig dependencies (dependencies without a build.zig). It adds a function
pathto theDependencystruct which returns aLazyPathto a path inside the dependency.It does not currently fetch these dependencies lazily, it instead just uses the current way of fetching dependencies before running the build. Doing actual lazy fetching should probably be implemented separately together with lazy dependency fetching a zig dependencies. Right now it would require duplicating a lot of work from the existing dependency fetching.
I also created a proof of concept project based on Andrews SDL which downloads a tagged release of SDL from the SDL website and builds a static library: https://github.com/antlilja/zig-sdl.