Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix acton zig-pkg #1885

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions base/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ pub fn build(b: *std.Build) void {
libActon.installHeader(b.path("rts/common.h"), "rts/common.h");
libActon.installHeader(b.path("rts/q.h"), "rts/q.h");
libActon.installHeader(b.path("rts/rts.h"), "rts/rts.h");
libActon.installHeader(b.path("rts/log.h"), "rts/log.h");

libActon.addIncludePath(.{ .cwd_relative = buildroot_path });

Expand Down
8 changes: 5 additions & 3 deletions cli/src/acton.act
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ actor CmdZigPkgAdd(env, args):

dep_name = args.get_str("name")
dep_url = args.get_str("url")
dep_artifacts = args.get_strlist("artifact")

def get_build_config():
try:
Expand All @@ -853,7 +854,7 @@ actor CmdZigPkgAdd(env, args):
build_config.zig_dependencies[dep_name].hash = dep_hash
else:
# Add the hash
build_config.zig_dependencies[dep_name] = Dependency(dep_name, dep_url, dep_hash)
build_config.zig_dependencies[dep_name] = ZigDependency(dep_name, dep_url, dep_hash, {}, dep_artifacts)
print("Added new Zig package dependency", dep_name, "with hash", dep_hash)

baj_file = file.WriteFile(file.WriteFileCap(file.FileCap(env.cap)), "build.act.json")
Expand Down Expand Up @@ -1033,12 +1034,13 @@ actor main(env):

p_zigpkg = p.add_cmd("zig-pkg", "Manage Zig package dependencies", _cmd_zigpkg)

p_zigpkg_add = p_pkg.add_cmd("add", "Add Zig package dependency", _cmd_zigpkg_add)
p_zigpkg_add = p_zigpkg.add_cmd("add", "Add Zig package dependency", _cmd_zigpkg_add)
p_zigpkg_add.add_arg("url", "URL of dependency", True, "?")
p_zigpkg_add.add_arg("name", "Name of dependency", True, "?")
p_zigpkg_add.add_option("hash", "str", "?", "", "Hash of dependency")
p_zigpkg_add.add_option("artifact", "strlist", "+", [], "Library artifact to link with")

p_zigpkg_rm = p_pkg.add_cmd("remove", "Remove Zig package dependency", _cmd_zigpkg_rm)
p_zigpkg_rm = p_zigpkg.add_cmd("remove", "Remove Zig package dependency", _cmd_zigpkg_rm)
p_zigpkg_rm.add_arg("name", "Name of dependency", True, "?")

return p.parse(env.argv)
Expand Down
Loading