diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-10-07 22:34:45 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-10-08 16:54:31 -0700 |
| commit | e5c2a7dbca103b0c61bebaff95c5d5a5b777bd59 (patch) | |
| tree | 2f41df7e7c01286ef102dc7a814aae6c7cdf5f84 /lib/std/Build/Cache.zig | |
| parent | 35d81c99c0f737f071e1ad0083342328dbb32acb (diff) | |
| download | zig-e5c2a7dbca103b0c61bebaff95c5d5a5b777bd59.tar.gz zig-e5c2a7dbca103b0c61bebaff95c5d5a5b777bd59.zip | |
finish hooking up new dependency tree logic
* add Module instances for each package's build.zig and attach it to the
dependencies.zig module with the hash digest hex string as the name.
* fix incorrectly skipping the wrong packages for creating
dependencies.zig
* a couple more renaming of "package" to "module"
Diffstat (limited to 'lib/std/Build/Cache.zig')
| -rw-r--r-- | lib/std/Build/Cache.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig index bb36bb978f..1ad111f2e3 100644 --- a/lib/std/Build/Cache.zig +++ b/lib/std/Build/Cache.zig @@ -9,6 +9,13 @@ pub const Directory = struct { path: ?[]const u8, handle: fs.Dir, + pub fn clone(d: Directory, arena: Allocator) Allocator.Error!Directory { + return .{ + .path = if (d.path) |p| try arena.dupe(u8, p) else null, + .handle = d.handle, + }; + } + pub fn cwd() Directory { return .{ .path = null, |
