diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-05-06 19:22:40 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-05-06 22:41:00 -0700 |
| commit | ec95e00e28cb23f37dc097f71afd7090e947a1cd (patch) | |
| tree | a7393f13c3d2c7895eb3687d0ebd7f3205699289 /src/Package.zig | |
| parent | 3b60ab4872355f0b9a9c7d0794ca8b548ab99412 (diff) | |
| download | zig-ec95e00e28cb23f37dc097f71afd7090e947a1cd.tar.gz zig-ec95e00e28cb23f37dc097f71afd7090e947a1cd.zip | |
flatten lib/std/special and improve "pkg inside another" logic
stage2: change logic for detecting whether the main package is inside
the std package. Previously it relied on realpath() which is not portable.
This uses resolve() which is how imports already work.
* stage2: fix cleanup bug when creating Module
* flatten lib/std/special/* to lib/*
- this was motivated by making main_pkg_is_inside_std false for
compiler_rt & friends.
* rename "mini libc" to "universal libc"
Diffstat (limited to 'src/Package.zig')
| -rw-r--r-- | src/Package.zig | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/Package.zig b/src/Package.zig index 9ac1e2e5b1..df894280a9 100644 --- a/src/Package.zig +++ b/src/Package.zig @@ -124,11 +124,3 @@ pub fn addAndAdopt(parent: *Package, gpa: Allocator, name: []const u8, child: *P child.parent = parent; return parent.add(gpa, name, child); } - -pub fn isInsideOf(pkg: Package, another: Package) !bool { - var pkg_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined; - var another_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined; - const pkg_path = try pkg.root_src_directory.handle.realpath(pkg.root_src_path, &pkg_buffer); - const another_path = try another.root_src_directory.handle.realpath(".", &another_buffer); - return mem.startsWith(u8, pkg_path, another_path); -} |
