summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/look.zig b/src/look.zig
index ece2ee0f..fbcc80a9 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -17,10 +17,9 @@ const libc = std.c;
const pardes = @import("pardes.zig");
const config = @import("config.zig");
const pdf_enabled = @import("pardes_config").mupdf;
-const embedded_sources = if (pardes.platform == .web) @import("embedded_sources") else struct {
- pub const Source = struct { path: []const u8, contents: []const u8 };
- pub const all = [_]Source{};
-};
+/// The virtual filesystem, on every platform: the browser has only this, and
+/// `run-isolated` chooses it (see `isolated` below).
+const embedded_sources = @import("source_manifest.zig");
extern "c" fn realpath(path: [*:0]const u8, resolved: [*]u8) ?[*:0]u8;
extern "c" fn fork() c_int;
@@ -557,7 +556,12 @@ fn findEmbeddedSource(path: []const u8, allow_root_suffix: bool) ?embedded_sourc
return null;
}
-const platform_has_fs = switch (pardes.platform) {
+/// Whether there is a real filesystem to reach at all. An ISOLATED build has
+/// none by construction — the option is comptime, so every libc path below is
+/// dead code the compiler removes rather than a branch that could be taken by
+/// accident. The browser has never had one either, and both then read the same
+/// embedded source.
+const platform_has_fs = !pardes.isolated and switch (pardes.platform) {
.tty, .gui, .macos => true,
.web => false,
};