Skip to content

Commit

Permalink
Use imported mailbox instead of submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
g41797 committed Oct 8, 2024
1 parent a73f7fb commit e21ae9c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 40 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/zig-out/
/zig-cache/
**/.zig-cache/
**/.zig-out/
.idea/
Expand All @@ -8,4 +10,3 @@ src/deps/zig-datetime/.zig-out/
src/deps/zig-network/.zig-cache/
src/deps/zig-network/.zig-out/


8 changes: 8 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ pub fn build(b: *std.Build) void {
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});

const mailbox = b.dependency("mailbox", .{
.target = target,
.optimize = optimize,
});


const lib = b.addStaticLibrary(.{
.name = "syslog",
// In this case the main source file is merely a path, however, in more
Expand All @@ -37,6 +43,8 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

lib_unit_tests.root_module.addImport("mailbox", mailbox.module("mailbox"));

const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);

// Similar to creating the run step earlier, this exposes a `test` step to
Expand Down
41 changes: 4 additions & 37 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,11 @@
// Once all dependencies are fetched, `zig build` no longer requires
// internet connectivity.
.dependencies = .{
// See `zig fetch --save <url>` for a command-line interface for adding dependencies.
//.example = .{
// // When updating this field to a new URL, be sure to delete the corresponding
// // `hash`, otherwise you are communicating that you expect to find the old hash at
// // the new URL.
// .url = "https://example.com/foo.tar.gz",
//
// // This is computed from the file contents of the directory of files that is
// // obtained after fetching `url` and applying the inclusion rules given by
// // `paths`.
// //
// // This field is the source of truth; packages do not come from a `url`; they
// // come from a `hash`. `url` is just one of many possible mirrors for how to
// // obtain a package matching this `hash`.
// //
// // Uses the [multihash](https://multiformats.io/multihash/) format.
// .hash = "...",
//
// // When this is provided, the package is found in a directory relative to the
// // build root. In this case the package's hash is irrelevant and therefore not
// // computed. This field and `url` are mutually exclusive.
// .path = "foo",

// // When this is set to `true`, a package is declared to be lazily
// // fetched. This makes the dependency only get fetched if it is
// // actually used.
// .lazy = false,
//},
.mailbox = .{
.url = "https://github.com/g41797/mailbox/archive/master.tar.gz",
.hash = "12208d8777b69f62cccf70b4372d8c31a22bb022881279713d424689d6555532d389",
},
},

// Specifies the set of files and directories that are included in this package.
// Only files and directories listed here are included in the `hash` that
// is computed for this package. Only files listed here will remain on disk
// when using the zig package manager. As a rule of thumb, one should list
// files required for compilation plus any license(s).
// Paths are relative to the build root. Use the empty string (`""`) to refer to
// the build root itself.
// A directory listed here means that all files within, recursively, are included.
.paths = .{
"build.zig",
"build.zig.zon",
Expand Down
1 change: 0 additions & 1 deletion src/deps/mailbox
Submodule mailbox deleted from 008a64
2 changes: 1 addition & 1 deletion src/syslog_tests.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//---------------------------------
const std = @import("std");
const testing = std.testing;
const mailbox = @import("deps/mailbox/src/mailbox.zig");
const mailbox = @import("mailbox");
const syslog = @import("syslog.zig");
const transport = @import("transport.zig");
const rfc = @import("rfc5424.zig");
Expand Down

0 comments on commit e21ae9c

Please sign in to comment.