-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Add: Zig fetch support #4348
Comments
I will look at it in 2.8.6 |
Can you provide a full project example with zig packages? and provide the whole fetch commands or makefile. |
e.g: Use makefile: # default: $HOME/.cache
# Set the output directory for Zig packages (overwrited)
export ZIG_GLOBAL_CACHE_DIR := $(PWD)/.zig-pkg
# Fetch the package and get its hash
PKG_HASH := $(shell zig fetch git+https://github.com/hsutter/cppfront#789cd382ed4c2fb1a9e306e73b6876228d22207d)
# Build the executable
cppfront: $(PWD)/.zig-pkg/p/$(PKG_HASH)/source/cppfront.cpp
clang++ -std=c++20 -O3 -o cppfront -I$(PWD)/.zig-pkg/p/$(PKG_HASH)/include -I$(PWD)/.zig-pkg/p/$(PKG_HASH)/source $(PWD)/.zig-pkg/p/$(PKG_HASH)/source/cppfront.cpp
# Target to fetch the package
fetch:
zig fetch git+https://github.com/hsutter/cppfront#789cd382ed4c2fb1a9e306e73b6876228d22207d
# Clean the build
clean:
rm -f cppfront
# PHONY targets to prevent conflicts with filenames
.PHONY: fetch clean |
I don't know what I need to support. |
Can you guarantee the same result on all platforms (Win|Unix-like) without |
Maybe I should wait for zig-pkg to support it again.
? |
Ok. Currently, 0.11.0 Version 0.12.0 allows you to get packages without And CMake's idea would be to support it without the need for
Sorry! I asked about alternatives. |
Is your feature request related to a problem? Please describe.
Hi @waruqi,
This is also the case with pkg-managers for other languages such as dub, conan, vcpkg, cargo...
zig 0.12.0-dev
already has a fetch command to download packages and print the hash (multihash - sha256-2)progress to release: https://github.com/ziglang/zig/milestone/23
Help:
Wrong command:
Command fixed:
Describe the solution you'd like
I would suggest adding support for
zig fetch
without the need forbuild.zig
andbuild.zig.zon
.New
zig env
get:Overwrite
ZIG_GLOBAL_CACHE_DIR
toxmake
Describe alternatives you've considered
No response
Additional context
References
zig fetch
subcommand and symlink support in zig packages ziglang/zig#17363The text was updated successfully, but these errors were encountered: