Skip to content

Commit cb27f87

Browse files
fix(make): properly resolves package manager for ZMQ installation (#204)
The recipe for identifying package manager (e.g. `$(command -v dnf)`) has always been evaluated to empty thus skipping automated installation. This PR fixes the issue and uses make target in the github action for consistency. Signed-off-by: Bartosz Majsak <[email protected]>
1 parent 4b961c7 commit cb27f87

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/ci-pr-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install libzmq dependencies (kvcache/kvevents)
2525
run: |
2626
sudo apt-get update
27-
sudo apt-get install -y libzmq3-dev pkg-config
27+
make download-zmq
2828
2929
- name: Set PKG_CONFIG_PATH
3030
run: echo "PKG_CONFIG_PATH=/usr/lib/pkgconfig" >> $GITHUB_ENV

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,29 +241,29 @@ install-hooks: ## Install git hooks
241241

242242
.PHONY: download-zmq
243243
download-zmq: ## Install ZMQ dependencies based on OS/ARCH
244-
@echo "Checking if ZMQ is already installed..."
244+
@echo "Checking if ZMQ is already installed..."
245245
@if pkg-config --exists libzmq; then \
246246
echo "✅ ZMQ is already installed."; \
247247
else \
248-
echo "Installing ZMQ dependencies..."; \
248+
echo "Installing ZMQ dependencies..."; \
249249
if [ "$(TARGETOS)" = "linux" ]; then \
250-
if [ -x "$(command -v apt)" ]; then \
251-
apt update && apt install -y libzmq3-dev; \
252-
elif [ -x "$(command -v dnf)" ]; then \
253-
dnf install -y zeromq-devel; \
250+
if command -v apt >/dev/null 2>&1; then \
251+
sudo apt update && sudo apt install -y libzmq3-dev; \
252+
elif command -v dnf >/dev/null 2>&1; then \
253+
sudo dnf install -y zeromq-devel; \
254254
else \
255-
echo "Unsupported Linux package manager. Install libzmq manually."; \
255+
echo -e "⚠️ Unsupported Linux package manager. Follow installation guides: https://github.com/zeromq/libzmq#installation-of-binary-packages-\n"; \
256256
exit 1; \
257257
fi; \
258258
elif [ "$(TARGETOS)" = "darwin" ]; then \
259-
if [ -x "$(command -v brew)" ]; then \
259+
if command -v brew >/dev/null 2>&1; then \
260260
brew install zeromq; \
261261
else \
262-
echo "Homebrew is not installed and is required to install zeromq. Install it from https://brew.sh/"; \
262+
echo "⚠️ Homebrew is not installed and is required to install zeromq. Install it from https://brew.sh/"; \
263263
exit 1; \
264264
fi; \
265265
else \
266-
echo "Unsupported OS: $(TARGETOS). Install libzmq manually - check https://zeromq.org/download/ for guidance."; \
266+
echo "⚠️ Unsupported OS: $(TARGETOS). Install libzmq manually - see https://zeromq.org/download/"; \
267267
exit 1; \
268268
fi; \
269269
echo "✅ ZMQ dependencies installed."; \

0 commit comments

Comments
 (0)