Skip to content

Commit

Permalink
Merge branch 'build-tiny-fixes'
Browse files Browse the repository at this point in the history
* build-tiny-fixes:
  Fix make without arguments
  Update .PHONY targets
  Avoid copy-paste for PYO3_CONFIG_FILE
  Move steps from build into dependencies
  • Loading branch information
azat committed Dec 18, 2023
2 parents 36a8331 + 641aa0a commit bc388e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ jobs:
# nfpm
curl -sS -Lo /tmp/nfpm.deb "https://github.com/goreleaser/nfpm/releases/download/v2.25.0/nfpm_amd64.deb"
sudo dpkg -i /tmp/nfpm.deb
- name: Build
run: |
set -x
# for building cityhash for clickhouse-rs
sudo apt-get install -y musl-tools
# gcc cannot do cross compile, and there is no musl-g++ in musl-tools
sudo ln -srf /usr/bin/clang /usr/bin/musl-g++
# musl for static binaries
rustup target add x86_64-unknown-linux-musl
- name: Build
run: |
set -x
make packages target=x86_64-unknown-linux-musl
for postfix in .x86_64.rpm -x86_64.pkg.tar.zst _amd64.deb; do
cp chdig*$postfix chdig-latest$postfix
Expand Down
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ endif
export PYO3_CONFIG_FILE = $(PWD)/contrib/flameshow/build/pyo3-build-config-file-$(target).txt
$(info PYO3_CONFIG_FILE = $(PYO3_CONFIG_FILE))

.PHONY: build chdig install deb rpm archlinux packages
.PHONY: build build_completion deploy-binary chdig install run \
deb rpm archlinux packages

contrib/flameshow/build/pyo3-build-config-file-$(target).txt:
# This should be the first target (since ".DEFAULT_GOAL" is supported only since 3.80+)
default: build
.DEFAULT_GOAL: default

$(PYO3_CONFIG_FILE):
env -u PYO3_CONFIG_FILE cargo build $(cargo_build_opts) -p flameshow

chdig: contrib/flameshow/build/pyo3-build-config-file-$(target).txt
chdig: $(PYO3_CONFIG_FILE)
cargo build $(cargo_build_opts)

run: chdig
Expand All @@ -66,7 +71,5 @@ rpm: build
archlinux: build
CHDIG_VERSION=${CHDIG_VERSION_ARCH} nfpm package --config chdig-nfpm.yaml --packager archlinux

all: build

help:
@echo "Usage: make [debug=1] [target=<TRIPLE>]"

0 comments on commit bc388e8

Please sign in to comment.