authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-18 00:52:38 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-18 00:52:38 -07:00
log014d13f8a3ca27359ee2b48b1e83e60c6df78f33
treec06cc61038dfc7bf5a0025b753db1a269c4434b1
parent7cd61e4cc5676da20b74302e9b39276f15cdc9d0

remove any other references to the old bootstrap process


8 files changed, 12 insertions(+), 57 deletions(-)

.github/workflows/nightly.yml-3
...@@ -30,9 +30,6 @@ jobs:...@@ -30,9 +30,6 @@ jobs:
3030
31 - run: zig version31 - run: zig version
32 - run: zig env32 - run: zig env
33 - run: zig build -Dbootstrap
34 - run: ./zig-out/bin/zigmod ci
35 - run: cat deps.zig
36 - run: zig build33 - run: zig build
37 - run: ./zig-out/bin/zigmod version34 - run: ./zig-out/bin/zigmod version
38 - run: ./zig-out/bin/zigmod sum35 - run: ./zig-out/bin/zigmod sum
.github/workflows/push.yml-3
...@@ -23,9 +23,6 @@ jobs:...@@ -23,9 +23,6 @@ jobs:
2323
24 - run: zig version24 - run: zig version
25 - run: zig env25 - run: zig env
26 - run: zig build -Dbootstrap
27 - run: ./zig-out/bin/zigmod ci
28 - run: cat deps.zig
29 - run: zig build26 - run: zig build
3027
31 # Build All28 # Build All
README.md+1-8
...@@ -23,16 +23,9 @@ A package manager for the Zig programming language....@@ -23,16 +23,9 @@ A package manager for the Zig programming language.
23### Build from Source23### Build from Source
24Initially,24Initially,
25```25```
26$ git clone https://github.com/nektro/zigmod --recursive26$ git clone https://github.com/nektro/zigmod
27$ cd zigmod27$ cd zigmod
28$ zig build -Dbootstrap
29$ ./zig-out/bin/zigmod fetch
30```
31
32To build,
33```
34$ zig build28$ zig build
35$ ./zig-out/bin/zigmod
36```29```
3730
38## Usage31## Usage
build.zig+9-14
...@@ -15,19 +15,6 @@ pub fn build(b: *std.build.Builder) void {...@@ -15,19 +15,6 @@ pub fn build(b: *std.build.Builder) void {
15 const use_full_name = b.option(bool, "use-full-name", "") orelse false;15 const use_full_name = b.option(bool, "use-full-name", "") orelse false;
16 const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) });16 const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) });
17 const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" });17 const exe_name = b.fmt("{s}{s}", .{ "zigmod", if (use_full_name) with_arch_os else "" });
18 const exe = makeExe(b, exe_name, target, mode);
19
20 const run_cmd = exe.run();
21 run_cmd.step.dependOn(b.getInstallStep());
22 if (b.args) |args| {
23 run_cmd.addArgs(args);
24 }
25
26 const run_step = b.step("run", "Run the app");
27 run_step.dependOn(&run_cmd.step);
28}
29
30fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget, mode: std.builtin.Mode) *std.build.LibExeObjStep {
31 const exe = b.addExecutable(exe_name, "src/main.zig");18 const exe = b.addExecutable(exe_name, "src/main.zig");
32 exe.setTarget(target);19 exe.setTarget(target);
33 exe.setBuildMode(mode);20 exe.setBuildMode(mode);
...@@ -38,5 +25,13 @@ fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget,...@@ -38,5 +25,13 @@ fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget,
3825
39 deps.addAllTo(exe);26 deps.addAllTo(exe);
40 exe.install();27 exe.install();
41 return exe;28
29 const run_cmd = exe.run();
30 run_cmd.step.dependOn(b.getInstallStep());
31 if (b.args) |args| {
32 run_cmd.addArgs(args);
33 }
34
35 const run_step = b.step("run", "Run the app");
36 run_step.dependOn(&run_cmd.step);
42}37}
docs/README.md+1-11
...@@ -16,20 +16,10 @@ The earliest Zig release this Zigmod was verified to work with is `0.10.0-dev.39...@@ -16,20 +16,10 @@ The earliest Zig release this Zigmod was verified to work with is `0.10.0-dev.39
16You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.16You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.
1717
18### Build Zigmod from source18### Build Zigmod from source
19Zigmod 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.
20
21```19```
22$ git clone https://github.com/nektro/zigmod --recursive20$ git clone https://github.com/nektro/zigmod
23$ cd zigmod21$ cd zigmod
24$ zig build -Dbootstrap
25$ ./zig-out/bin/zigmod fetch
26```
27
28Now that we made our bootstrap build and have the rest of our dependencies, we can build as normal.
29
30```
31$ zig build22$ zig build
32$ ./zig-out/bin/zigmod
33```23```
3424
35## Getting Started25## Getting Started
src/lib.zig+1-5
...@@ -1,13 +1,9 @@...@@ -1,13 +1,9 @@
1const zfetch = @import("zfetch");1const zfetch = @import("zfetch");
22
3pub const commands_to_bootstrap = struct {3pub const commands = struct {
4 pub const version = @import("./cmd/version.zig");4 pub const version = @import("./cmd/version.zig");
5 pub const fetch = @import("./cmd/fetch.zig");5 pub const fetch = @import("./cmd/fetch.zig");
6 pub const ci = @import("./cmd/ci.zig");6 pub const ci = @import("./cmd/ci.zig");
7};
8
9pub const commands = struct {
10 pub usingnamespace commands_to_bootstrap;
11 pub const init = @import("./cmd/init.zig");7 pub const init = @import("./cmd/init.zig");
12 pub const sum = @import("./cmd/sum.zig");8 pub const sum = @import("./cmd/sum.zig");
13 pub const zpm = @import("./cmd/zpm.zig");9 pub const zpm = @import("./cmd/zpm.zig");
src/zfetch_stub.zig deleted-9
...@@ -1,9 +0,0 @@
1//! placeholder for bootstrap build
2
3pub fn init() !void {
4 //
5}
6
7pub fn deinit() void {
8 //
9}
zig.mod-4
...@@ -26,10 +26,6 @@ dependencies:...@@ -26,10 +26,6 @@ dependencies:
26 - src/scanner.c26 - src/scanner.c
27 - src/writer.c27 - src/writer.c
2828
29 # Entries above this line are needed to bootstrap and kept as git submodules
30 # --------
31 # Entries below this line are only fetched with zigmod itself
32
33 - src: git https://github.com/nektro/zig-ansi29 - src: git https://github.com/nektro/zig-ansi
34 - src: git https://github.com/ziglibs/known-folders30 - src: git https://github.com/ziglibs/known-folders
35 - src: git https://github.com/nektro/zig-licenses31 - src: git https://github.com/nektro/zig-licenses