Uh oh!
There was an error while loading. Please reload this page.
Make build.zig ready for generated files - #7959
Conversation
ikskuh
commented
Feb 23, 2021
I get the following error in the CI: How can i reproduce this locally? |
ikskuh
commented
Feb 23, 2021
Okay, so the command failing was: I fixed the bugs happening with this |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SpexGuy
commented
Feb 23, 2021
Overall these are good changes, but I think they are missing a major use case: One thing to note, that might help with this feature, is that for most processes you don't need to check if any of the current dependencies have changed, it is sufficient to only check if any of the previous dependencies have changed. So you could have the list of dependencies be an output of the make step, and save that list of files in the cache to be checked on the next run. This eliminates needing to write separate pieces of code for doing the build vs examining dependencies. |
andrewrk
commented
Feb 23, 2021
I agree with @SpexGuy but I think that the build system supporting a general purpose caching system is something we need regardless, and orthogonal to this PR. It is certainly a glaring missing feature, however it is something that can be plugged into these changes later, and also will need to be plugged into the other build steps that do not rely on the internal caching of the zig compiler. |
ikskuh
commented
Feb 24, 2021
Another thing that i left out (for now) was that |
ae0fbda to
fabe2daCompareikskuh
commented
Feb 27, 2021
I tried to change the LibExeObjStep to use the |
ikskuh
commented
May 21, 2021
I am confused. On my local machine, Note here: I haven't built |
ikskuh
commented
May 21, 2021
I found some hints, will investigate. Fixed a bug already 😁 |
ikskuh
commented
May 21, 2021
CI is green (latest commit just deletes a file that appeared during the rebase), so i'm ready to merge. @SpexGuy, can you review the latest state again? 🤔 |
SpexGuy
left a comment
There was a problem hiding this comment.
Overall this looks good. Does build.zig in the root of the repository also need to be updated?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ikskuh
commented
May 21, 2021
No, the CI already tested this including all build scripts in the tests folder 😃 It's less breaking than i expected, which is good |
f6359f9 to
d545f08Compare… provide FileSource.
… of Builder.addObjectSource.
ikskuh
commented
Jun 11, 2021
Rebased once again |
Vexu
left a comment
There was a problem hiding this comment.
LGTM, made all the remaining enums snake_case while we're breaking everything.
First of all: This is a breaking PR which will break all projects using
std.build.Pkg. This PR is a draft as well.Goal: This PR tries to improve the experience with generated files by various build steps.
Right now,
std.build.FileSourceis used in some places to allow either astd.build.WriteFileSteporstd.build.TranslateCto generate files and use them to create executables and libraries. This PR replaces the special cases with a genericstd.build.GeneratedFilewhich is a@fieldParentPtrstyle interface that allows to retrieve the path of a generated file after itsmake()invocation in a general purpose manner.Usage example:
Right now, this PR is unfinished as i first want some feedback on the changes i did and if we want to pursue this change.
Waiting for a response!
– xq