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:
3030
3131 - run: zig version
3232 - run: zig env
33 - run: zig build -Dbootstrap
34 - run: ./zig-out/bin/zigmod ci
35 - run: cat deps.zig
3633 - run: zig build
3734 - run: ./zig-out/bin/zigmod version
3835 - run: ./zig-out/bin/zigmod sum
.github/workflows/push.yml-3
......@@ -23,9 +23,6 @@ jobs:
2323
2424 - run: zig version
2525 - run: zig env
26 - run: zig build -Dbootstrap
27 - run: ./zig-out/bin/zigmod ci
28 - run: cat deps.zig
2926 - run: zig build
3027
3128 # Build All
README.md+1-8
......@@ -23,16 +23,9 @@ A package manager for the Zig programming language.
2323### Build from Source
2424Initially,
2525```
26$ git clone https://github.com/nektro/zigmod --recursive
26$ git clone https://github.com/nektro/zigmod
2727$ cd zigmod
28$ zig build -Dbootstrap
29$ ./zig-out/bin/zigmod fetch
30```
31
32To build,
33```
3428$ zig build
35$ ./zig-out/bin/zigmod
3629```
3730
3831## Usage
build.zig+9-14
......@@ -15,19 +15,6 @@ pub fn build(b: *std.build.Builder) void {
1515 const use_full_name = b.option(bool, "use-full-name", "") orelse false;
1616 const with_arch_os = b.fmt("-{s}-{s}", .{ @tagName(target.cpu_arch orelse builtin.cpu.arch), @tagName(target.os_tag orelse builtin.os.tag) });
1717 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 {
3118 const exe = b.addExecutable(exe_name, "src/main.zig");
3219 exe.setTarget(target);
3320 exe.setBuildMode(mode);
......@@ -38,5 +25,13 @@ fn makeExe(b: *std.build.Builder, exe_name: string, target: std.zig.CrossTarget,
3825
3926 deps.addAllTo(exe);
4027 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);
4237}
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
1616You may download a precompiled binary from https://github.com/nektro/zigmod/releases or build the project from source.
1717
1818### 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
2119```
22$ git clone https://github.com/nektro/zigmod --recursive
20$ git clone https://github.com/nektro/zigmod
2321$ 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```
3122$ zig build
32$ ./zig-out/bin/zigmod
3323```
3424
3525## Getting Started
src/lib.zig+1-5
......@@ -1,13 +1,9 @@
11const zfetch = @import("zfetch");
22
3pub const commands_to_bootstrap = struct {
3pub const commands = struct {
44 pub const version = @import("./cmd/version.zig");
55 pub const fetch = @import("./cmd/fetch.zig");
66 pub const ci = @import("./cmd/ci.zig");
7};
8
9pub const commands = struct {
10 pub usingnamespace commands_to_bootstrap;
117 pub const init = @import("./cmd/init.zig");
128 pub const sum = @import("./cmd/sum.zig");
139 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:
2626 - src/scanner.c
2727 - 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
3329 - src: git https://github.com/nektro/zig-ansi
3430 - src: git https://github.com/ziglibs/known-folders
3531 - src: git https://github.com/nektro/zig-licenses