Cc: The build tool has reset ENV; --env=std required

What is the meaning of this message and if it is a problem how can I solve it? I think it can be linked to the issue below.

I had to remove brew and reinstall it. I am still using Mac OS 10.11 and am aware that brew is unsupported in this version. Now I can not install any package with brew because git will not build with this error:

git-credential-osxkeychain.c:4:10: fatal error: 'Security/Security.h' file not found
#include <Security/Security.h>

Seems that the brew build environment does not include the Frameworks in the headers path.

The build tool has reset ENV; --env=std required.

This indicates that whatever build tool you’re using (in this case cc) has altered environment variables (ENV) such that Homebrew’s build environment (superenv) is not using the same environment as Homebrew itself. You can “work around” this by b uilding with --env=std as the error message suggests, but it would probably be better to investigate your system’s build toolchain and figure out why it is doing things to your environment behind your back.

I understood the “work around” and tried to use it with no success. The interesting thing is that cc is the one that brew creates in the shims dir:

$ which cc

I tried very hard to understand what is the issue with my installation. I had brew installed with dozens of packages and to simplify my development environment I decided to remove the old installation and start afresh. Unfortunately somehow my environment is now in a state that the toolchain will not even find the system headers in the macos frameworks. I can not even compile brew’s git for a start.

Yes, that’s Homebrew’s shim and the one that’s detecting the change in your build environment. You’ll have to dig deeper yourself into the shim code to figure out what’s causing your problems as it is likely specific to your system.

What is the default environment in brew? If it isn’t std is it superenv? How can I know what is the current environment that brew is using?