Skip to content

Commit

Permalink
chore(*) split the Cargo workspace between lib/ and t/lib/
Browse files Browse the repository at this point in the history
To better manage automated dependencies and security updates, and help
distinguish high-priority vs low-priority alerts.
  • Loading branch information
thibaultcha committed Jan 3, 2024
1 parent e7769a0 commit 6689afa
Show file tree
Hide file tree
Showing 12 changed files with 386 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ jobs:
- name: 'Rust lint'
if: ${{ !env.ACT }}
run: |
cargo clippy --all-features
cd lib/ngx-wasm-rs && cargo clippy --all-features
cargo clippy --all-features --manifest-path lib/Cargo.toml
cargo clippy --all-features --manifest-path t/lib/Cargo.toml
- run: |
if [[ $(make reindex 2>&1 | tee reindex.out | grep -c done) -gt 0 ]]; then
cat reindex.out >&2
Expand Down
18 changes: 0 additions & 18 deletions Cargo.toml

This file was deleted.

16 changes: 10 additions & 6 deletions auto/cargo
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fi
ngx_wasm_cargo_feature_path="$ngx_wasm_runtime_path"

ngx_wasm_push_dir=$(pwd)

cd $ngx_wasm_cargo_lib_dir

if [ "$NGX_WASM_CARGO_PROFILE" = "debug" ]; then
Expand All @@ -27,7 +28,12 @@ else
ngx_wasm_cargo_profile_flag=--release
fi

cargo build $ngx_wasm_cargo_profile_flag $ngx_wasm_cargo_flags
cargo build \
--lib \
--target-dir $ngx_wasm_cargo_lib_dir/target \
$ngx_wasm_cargo_profile_flag \
$ngx_wasm_cargo_flags

ngx_wasm_rc=$?

ngx_wasm_cargo_target_dir=$ngx_wasm_cargo_lib_dir/target/$ngx_wasm_cargo_profile
Expand All @@ -44,13 +50,13 @@ if [ $ngx_wasm_rc = 0 ]; then
-L$ngx_wasm_cargo_target_dir \
-l$ngx_wasm_cargo_lib_name"

if [ "$NGX_RPATH" = YES ]; then
if [ "$NGX_RPATH" = YES ]; then
ngx_feature_libs="\
-R $ngx_wasm_cargo_target_dir \
-R $NGX_PREFIX/lib \
$ngx_feature_libs"

elif [ "$NGX_WASM_RUNTIME_NO_RPATH" != 1 ]; then
elif [ "$NGX_WASM_RUNTIME_NO_RPATH" != 1 ]; then
ngx_feature_libs="\
-Wl,-rpath=$ngx_wasm_cargo_target_dir \
-Wl,-rpath=$NGX_PREFIX/lib \
Expand Down Expand Up @@ -105,9 +111,7 @@ if [ $ngx_found = no ]; then
exit 1
fi

echo "$0: warning: the following functionality is not available for $ngx_addon_name:"
echo " $ngx_wasm_cargo_defines"
echo
echo "$0: warning: the following functionality is not available for $ngx_addon_name: $ngx_wasm_cargo_defines"

have=NGX_WASM_CARGO_FAILED value=1 . auto/define
fi
Expand Down
Loading

0 comments on commit 6689afa

Please sign in to comment.