From 014d13f8a3ca27359ee2b48b1e83e60c6df78f33 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 18 Sep 2022 00:52:38 -0700 Subject: [PATCH] remove any other references to the old bootstrap process --- .github/workflows/nightly.yml | 3 --- .github/workflows/push.yml | 3 --- README.md | 9 +-------- build.zig | 23 +++++++++-------------- docs/README.md | 12 +----------- src/lib.zig | 6 +----- src/zfetch_stub.zig | 9 --------- zig.mod | 4 ---- 8 files changed, 12 insertions(+), 57 deletions(-) delete mode 100644 src/zfetch_stub.zig diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2dc91fe536c00deb85c422521a5870042f7030c5..0fb65ba2654f520cbbe3cf778aadc92332e9c83e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,9 +30,6 @@ jobs: - run: zig version - run: zig env - - run: zig build -Dbootstrap - - run: ./zig-out/bin/zigmod ci - - run: cat deps.zig - run: zig build - run: ./zig-out/bin/zigmod version - run: ./zig-out/bin/zigmod sum diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 348aa7c0a4386e6af1dde390d607c6604548ca23..f8f6f0932be8664e937c18760208151a094c6aa6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -23,9 +23,6 @@ jobs: - run: zig version - run: zig env - - run: zig build -Dbootstrap - - run: ./zig-out/bin/zigmod ci - - run: cat deps.zig - run: zig build # Build All diff --git a/README.md b/README.md index a6802fced9b6a64dc8e8c09bf18e4e979148daf0..1ed31bcfea8efebb568a3fec10eaf6f3ef4f5ea5 100644 --- a/README.md +++ b/README.md @@ -23,16 +23,9 @@ A package manager for the Zig programming language. ### Build from Source Initially, ``` -$ git clone https://github.com/nektro/zigmod --recursive +$ git clone https://github.com/nektro/zigmod $ cd zigmod -$ zig build -Dbootstrap -$ ./zig-out/bin/zigmod fetch -``` - -To build, -``` $ zig build -$ ./zig-out/bin/zigmod ``` ## Usage diff --git a/build.zig b/build.zig index 46bd0b8ebbbce7c0082371f63151469c9d4832da..def07d7f14f25fbbae64a1c850378196db195157 100644 --- a/build.zig +++ b/build.zig @@ -15,19 +15,6 @@ pub fn build(b: *std.build.Builder) void { const use_full_name = b.option(bool, "use-full-name", "") orelse false; const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) }); const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" }); - const exe = makeExe(b, exe_name, target, mode); - - const run_cmd = exe.run(); - run_cmd.step.dependOn(b.getInstallStep()); - if (b.args) |args| { - run_cmd.addArgs(args); - } - - const run_step = b.step("run", "Run the app"); - run_step.dependOn(&run_cmd.step); -} - -fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget, mode: std.builtin.Mode) *std.build.LibExeObjStep { const exe = b.addExecutable(exe_name, "src/main.zig"); exe.setTarget(target); exe.setBuildMode(mode); @@ -38,5 +25,13 @@ fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget, deps.addAllTo(exe); exe.install(); - return exe; + + const run_cmd = exe.run(); + run_cmd.step.dependOn(b.getInstallStep()); + if (b.args) |args| { + run_cmd.addArgs(args); + } + + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); } diff --git a/docs/README.md b/docs/README.md index 4b6a47d6d25d1a6a1a3317c1e431d469399cdbfb..28a381ccffbc2094cf06460a17591ba144a0eabc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,20 +16,10 @@ The earliest Zig release this Zigmod was verified to work with is `0.10.0-dev.39 You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source. ### Build Zigmod from source -Zigmod partially uses itself to manage dependencies but can be bootstrapped with the 2 (two) included Git submodules. The first step will generate a build of Zigmod that only has the `fetch` command. This binary can then be used to grab the rest of the dependencies and generate a full build. - ``` -$ git clone https://github.com/nektro/zigmod --recursive +$ git clone https://github.com/nektro/zigmod $ cd zigmod -$ zig build -Dbootstrap -$ ./zig-out/bin/zigmod fetch -``` - -Now that we made our bootstrap build and have the rest of our dependencies, we can build as normal. - -``` $ zig build -$ ./zig-out/bin/zigmod ``` ## Getting Started diff --git a/src/lib.zig b/src/lib.zig index ce4337acbd5c58aaee1a2d4cf130dae6b73c8261..4bf717e31444ad3884c45bc74b71a73113754233 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -1,13 +1,9 @@ const zfetch = @import("zfetch"); -pub const commands_to_bootstrap = struct { +pub const commands = struct { pub const version = @import("./cmd/version.zig"); pub const fetch = @import("./cmd/fetch.zig"); pub const ci = @import("./cmd/ci.zig"); -}; - -pub const commands = struct { - pub usingnamespace commands_to_bootstrap; pub const init = @import("./cmd/init.zig"); pub const sum = @import("./cmd/sum.zig"); pub const zpm = @import("./cmd/zpm.zig"); diff --git a/src/zfetch_stub.zig b/src/zfetch_stub.zig deleted file mode 100644 index 2b6cdbc904341a50ee3e2e9ba1dd18b3c21b952e..0000000000000000000000000000000000000000 --- a/src/zfetch_stub.zig +++ /dev/null @@ -1,9 +0,0 @@ -//! placeholder for bootstrap build - -pub fn init() !void { - // -} - -pub fn deinit() void { - // -} diff --git a/zig.mod b/zig.mod index f8fd0919c7973b182c8da9ec01b262d52767f680..47e4e87b8fe14a7b5e640ae75dfcd7ed4687dd9a 100644 --- a/zig.mod +++ b/zig.mod @@ -26,10 +26,6 @@ dependencies: - src/scanner.c - src/writer.c - # Entries above this line are needed to bootstrap and kept as git submodules - # -------- - # Entries below this line are only fetched with zigmod itself - - src: git https://github.com/nektro/zig-ansi - src: git https://github.com/ziglibs/known-folders - src: git https://github.com/nektro/zig-licenses -- 2.54.0