Why doesn't `nix shell nixpkgs#stdenv` include gcc?

See title – why is this?

$ type -p gcc 
$ nix-shell -p stdenv --command 'type -p gcc'
/nix/store/2r2xi5pbg29bsmqywsm5zgl8l7adky4i-gcc-wrapper-13.3.0/bin/gcc
$ nix shell nixpkgs#stdenv -c bash -c 'type -p gcc'
$

Why would it? It just makes the build result of stdenv available in a shell AIUI. (And there’s nothing on $out/bin so nothing gets added.)

nix-shell uses a mkShell environment, which uses the stdenv, which means any nix-shell invocation would, by default, have a C compiler. Even nix-shell -p hello would have a compiler.

Wow, I had no idea the two commands worked so differently, I thought those two would have highly similar results. That’s what I get for never having used the old-style commands. Thanks!

Yeah, they were undoubtedly designed very differently. As I gather, nix3 provided an opportunity to redesign the commands to be (hopefully) more intuitive.