On Wed, Oct 9, 2024 at 5:06 AM Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> wrote: > > On Tue, Oct 8, 2024 at 8:45 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote: > > > > Really? > > > > $(shell ...) inherits env variables in my understanding. > > I mean the Make-exported variables (not the external environment), > i.e. `RUSTC_BOOTSTRAP=1` that we export in the main `Makefile`. Those > are not exported into the `shell` function. > > However, it turns out this changes in GNU Make 4.4 in commit > 98da874c4303 ("[SV 10593] Export variables to $(shell ...) commands"): > > * WARNING: Backward-incompatibility! > Previously makefile variables marked as export were not exported > to commands > started by the $(shell ...) function. Now, all exported variables are > exported to $(shell ...). If this leads to recursion during > expansion, then > for backward-compatibility the value from the original > environment is used. > To detect this change search for 'shell-export' in the .FEATURES variable. > > And indeed: > > export A := .PHONY: a > $(shell echo $$A) > a: ; @echo exported > > Gives: > > $ make-4.3 > make: 'a' is up to date. > > $ make-4.4.1 > exported OK, I reached the same understanding now. -- Best Regards Masahiro Yamada