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/Module.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/Module.zig')
| -rw-r--r-- | src/Module.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Module.zig b/src/Module.zig index 0966c8ffcf..de29753b13 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -112,7 +112,7 @@ global_error_set: std.StringHashMapUnmanaged(ErrorInt) = .{}, /// ErrorInt -> []const u8 for fast lookups for @intToError at comptime /// Corresponds with `global_error_set`. -error_name_list: ArrayListUnmanaged([]const u8) = .{}, +error_name_list: ArrayListUnmanaged([]const u8), /// Incrementing integer used to compare against the corresponding Decl /// field to determine whether a Decl's status applies to an ongoing update, or a @@ -133,7 +133,7 @@ job_queued_update_builtin_zig: bool = true, /// This makes it so that we can run `zig test` on the standard library. /// Otherwise, the logic for scanning test decls skips all of them because /// `main_pkg != std_pkg`. -main_pkg_is_std: bool, +main_pkg_in_std: bool, compile_log_text: ArrayListUnmanaged(u8) = .{}, @@ -4533,7 +4533,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi // the test name filter. if (!mod.comp.bin_file.options.is_test) break :blk false; if (decl_pkg != mod.main_pkg) { - if (!mod.main_pkg_is_std) break :blk false; + if (!mod.main_pkg_in_std) break :blk false; const std_pkg = mod.main_pkg.table.get("std").?; if (std_pkg != decl_pkg) break :blk false; } @@ -4544,7 +4544,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi if (!is_named_test) break :blk false; if (!mod.comp.bin_file.options.is_test) break :blk false; if (decl_pkg != mod.main_pkg) { - if (!mod.main_pkg_is_std) break :blk false; + if (!mod.main_pkg_in_std) break :blk false; const std_pkg = mod.main_pkg.table.get("std").?; if (std_pkg != decl_pkg) break :blk false; } |
