diff --git a/.github/workflows/build-so.yaml b/.github/workflows/build-so.yaml index afaad6b..ee2c123 100644 --- a/.github/workflows/build-so.yaml +++ b/.github/workflows/build-so.yaml @@ -33,21 +33,16 @@ jobs: uses: actions/checkout@v4 with: ref: stable - - name: Install MUSL toolchain - run: | - sudo apt-get install -y musl-dev musl-tools - sudo ln -s "/usr/bin/g++" "/usr/bin/musl-g++" - rustup target add x86_64-unknown-linux-musl - name: Build extensions run: | cd jyafn-ext - make install + make build - name: Artifact update uses: actions/upload-artifact@v4 with: name: extensions-linux-x64 if-no-files-found: error - path: ~/.jyafn/extensions/*.so + path: ./target/extensions/*.so retention-days: 1 build-dylib: @@ -78,13 +73,13 @@ jobs: - name: Build extensions run: | cd jyafn-ext - make install + make build - name: Artifact update uses: actions/upload-artifact@v4 with: name: extensions-macos-arm64 if-no-files-found: error - path: ~/.jyafn/extensions/*.dylib + path: ./target/extensions/*.dylib retention-days: 1 release: diff --git a/jyafn-ext/Makefile b/jyafn-ext/Makefile index bcaa733..d17216e 100644 --- a/jyafn-ext/Makefile +++ b/jyafn-ext/Makefile @@ -1,2 +1,2 @@ -install: - ./install-all.sh +build: + ./build-all.sh diff --git a/jyafn-ext/install-all.sh b/jyafn-ext/build-all.sh similarity index 95% rename from jyafn-ext/install-all.sh rename to jyafn-ext/build-all.sh index 78464f2..bc3b536 100755 --- a/jyafn-ext/install-all.sh +++ b/jyafn-ext/build-all.sh @@ -17,6 +17,6 @@ done for extension in $extensions; do echo Building $extension... cd $extension - make install + make build cd $BASEDIR done diff --git a/jyafn-ext/extensions/dummy/Makefile b/jyafn-ext/extensions/dummy/Makefile index c87306d..3aff779 100644 --- a/jyafn-ext/extensions/dummy/Makefile +++ b/jyafn-ext/extensions/dummy/Makefile @@ -13,20 +13,18 @@ ROOT := $(shell cargo metadata --format-version=1 | jq -r '.workspace_root') UNAME := $(shell uname) ifeq ($(UNAME), Linux) - BUILD := RUSTFLAGS="-C target-feature=-crt-static" \ - cargo build --release --target x86_64-unknown-linux-musl EXT := so - LIBPATH := $(ROOT)/target/x86_64-unknown-linux-musl/release/lib$(LIBNAME).$(EXT) + LIBPATH := $(ROOT)/target/release/lib$(LIBNAME).$(EXT) else ifeq ($(UNAME), Darwin) - BUILD := cargo build --release EXT := dylib LIBPATH := $(ROOT)/target/release/lib$(LIBNAME).$(EXT) endif build: - $(BUILD) + cargo build --release + mkdir -p $(ROOT)/target/extensions/ + cp $(LIBPATH) $(ROOT)/target/extensions/$(NAME).$(EXT) install: build mkdir -p ~/.jyafn/extensions/ - cp $(LIBPATH) ~/.jyafn/extensions/$(NAME)-$(VERSION).$(EXT) - cp $(LIBPATH) ~/.jyafn/extensions/$(NAME)-latest.$(EXT) + cp $(ROOT)/target/extensions/$(NAME).$(EXT) ~/.jyafn/extensions/$(NAME)-$(VERSION).$(EXT) diff --git a/jyafn-ext/extensions/lightgbm/Makefile b/jyafn-ext/extensions/lightgbm/Makefile index c87306d..3aff779 100644 --- a/jyafn-ext/extensions/lightgbm/Makefile +++ b/jyafn-ext/extensions/lightgbm/Makefile @@ -13,20 +13,18 @@ ROOT := $(shell cargo metadata --format-version=1 | jq -r '.workspace_root') UNAME := $(shell uname) ifeq ($(UNAME), Linux) - BUILD := RUSTFLAGS="-C target-feature=-crt-static" \ - cargo build --release --target x86_64-unknown-linux-musl EXT := so - LIBPATH := $(ROOT)/target/x86_64-unknown-linux-musl/release/lib$(LIBNAME).$(EXT) + LIBPATH := $(ROOT)/target/release/lib$(LIBNAME).$(EXT) else ifeq ($(UNAME), Darwin) - BUILD := cargo build --release EXT := dylib LIBPATH := $(ROOT)/target/release/lib$(LIBNAME).$(EXT) endif build: - $(BUILD) + cargo build --release + mkdir -p $(ROOT)/target/extensions/ + cp $(LIBPATH) $(ROOT)/target/extensions/$(NAME).$(EXT) install: build mkdir -p ~/.jyafn/extensions/ - cp $(LIBPATH) ~/.jyafn/extensions/$(NAME)-$(VERSION).$(EXT) - cp $(LIBPATH) ~/.jyafn/extensions/$(NAME)-latest.$(EXT) + cp $(ROOT)/target/extensions/$(NAME).$(EXT) ~/.jyafn/extensions/$(NAME)-$(VERSION).$(EXT)