Skip to content

Commit

Permalink
no docker, no musl, back to normal build
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Arruda committed Jul 25, 2024
1 parent c03da02 commit cbd89d4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 26 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build-so.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions jyafn-ext/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
install:
./install-all.sh
build:
./build-all.sh
2 changes: 1 addition & 1 deletion jyafn-ext/install-all.sh → jyafn-ext/build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ done
for extension in $extensions; do
echo Building $extension...
cd $extension
make install
make build
cd $BASEDIR
done
12 changes: 5 additions & 7 deletions jyafn-ext/extensions/dummy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 5 additions & 7 deletions jyafn-ext/extensions/lightgbm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit cbd89d4

Please sign in to comment.