No environment variables set in container when linking to another container from docker compose yml

When I link containers from a docker compose file I’m not seeing any environment variables set into the container, is this a known issue? I do see them when using docker run with --link option any ideas?

Are you using docker-compose file v1 or v2?