Skip to content

Commit 78fd89d

Browse files
committed
feat: always rebuild local source
If `FFI_BUILD_FROM_SOURCE=1` is set, always rebuild from local source. Change the scripts so that it is built within the `rust` directory and not on a temporary directory that is different on every rebuild. This way you get incremental builds if you make changes to the local source (which is probably your intention if you build from source).
1 parent ffc5f14 commit 78fd89d

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

Makefile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
DEPS:=filecoin.h filecoin.pc libfilecoin.a
22

33
all: $(DEPS)
4-
.PHONY: all
5-
6-
7-
$(DEPS): .install-filecoin ;
8-
9-
.install-filecoin: rust
104
./install-filecoin
11-
@touch $@
12-
5+
.PHONY: all
136

147
clean:
15-
rm -rf $(DEPS) .install-filecoin
8+
rm -rf $(DEPS)
169
.PHONY: clean

install-filecoin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if [ "${FFI_BUILD_FROM_SOURCE}" != "1" ] && download_release_tarball tarball_pat
3838
else
3939
(>&2 echo "building libfilecoin from local sources (dir = ${rust_sources_dir})")
4040

41-
build_from_source "filecoin" "${rust_sources_dir}"
41+
build_from_source "${rust_sources_dir}"
4242

4343
mkdir -p include
4444
mkdir -p lib/pkgconfig

install-shared.bash

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ download_release_tarball() {
4242
}
4343

4444
build_from_source() {
45-
__library_name=$1
46-
__rust_sources_path=$2
45+
__rust_sources_path=$1
4746
__repo_sha1=$(git rev-parse HEAD)
4847
__repo_sha1_truncated="${__repo_sha1:0:16}"
4948

@@ -62,14 +61,7 @@ build_from_source() {
6261
fi
6362

6463
pushd "${__rust_sources_path}" || exit
65-
6664
cargo --version
67-
68-
if [[ -f "./scripts/build-release.sh" ]]; then
69-
./scripts/build-release.sh "${__library_name}" "$(cat rust-toolchain)"
70-
else
71-
cargo build --release --all
72-
fi
73-
65+
cargo build --release --all
7466
popd || exit
7567
}

0 commit comments

Comments
 (0)