File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -308,12 +308,24 @@ ngx_rust_make_module () {
308308 ngx_rustc_module_opt=" --example $ngx_rust_target_name "
309309 fi
310310
311- cat << END >> $NGX_MAKEFILE
311+ if [ -z " $ngx_rust_phony_emitted " ]; then
312+ ngx_rust_phony_emitted=1
313+
314+ # Make cannot track the Rust module source and dependency changes,
315+ # so we defer the task to cargo and invoke it unconditionally.
316+ #
317+ # We have to use the pseudotarget instead of .PHONY for better
318+ # compatibility with various Make implementations.
319+ cat << END >> $NGX_MAKEFILE
312320
313- # always run cargo instead of trying to track the source modifications
314- .PHONY: $ngx_rust_obj
321+ .NGX_RUST_PHONY: ;
322+
323+ END
324+ fi
325+
326+ cat << END >> $NGX_MAKEFILE
315327
316- $ngx_rust_obj :
328+ $ngx_rust_obj : .NGX_RUST_PHONY
317329 $NGX_CARGO rustc \\
318330 --config $ngx_cargo_config \\
319331 --crate-type staticlib \\
You can’t perform that action at this time.
0 commit comments