emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
3.04k stars 694 forks source link

make: docker: Permission denied #1059

Open roukmoute opened 2 years ago

roukmoute commented 2 years ago

I have added this in my .zshrc:

source $HOME/workspace/github/emsdk/emsdk_env.sh

With this, I don't know why but docker in Makefile aren't executable anymore:

➤  cat Makefile 
dock:
    docker ps
php:
    php -v
➤  make dock  
docker ps
make: docker: Permission denied
make: *** [Makefile:2: dock] Error 127
➤  make php                                                               2 ↵
php -v
PHP 7.4.28 (cli) (built: Feb 17 2022 16:17:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
➤  docker ps
CONTAINER ID   IMAGE                  COMMAND                  CREATED      STATUS         PORTS                                       NAMES
9c1ff6f5e0dc   postgres:14.2-alpine   "docker-entrypoint.s…"   9 days ago   Up 4 minutes   0.0.0.0:5434->5432/tcp, :::5434->5432/tcp   digital-docker-c-postgres-1

If I remove this line from my .zshrc, it works.

Am I doing anything wrong?

sbc100 commented 2 years ago

I'm not sure how that could be related to emsdk,

Can you try which docker and docker ps directly from the command line both before and after running source $HOME/workspace/github/emsdk/emsdk_env.sh.

roukmoute commented 2 years ago

Without emsdk:

➤  which docker
/usr/bin/docker
➤  docker ps   
CONTAINER ID   IMAGE                  COMMAND                  CREATED      STATUS       PORTS                                       NAMES
9c1ff6f5e0dc   postgres:14.2-alpine   "docker-entrypoint.s…"   9 days ago   Up 3 hours   0.0.0.0:5434->5432/tcp, :::5434->5432/tcp   digital-docker-c-postgres-1
➤  make dock
docker ps
CONTAINER ID   IMAGE                  COMMAND                  CREATED      STATUS       PORTS                                       NAMES
9c1ff6f5e0dc   postgres:14.2-alpine   "docker-entrypoint.s…"   9 days ago   Up 3 hours   0.0.0.0:5434->5432/tcp, :::5434->5432/tcp   digital-docker-c-postgres-1

And with emsdk:

Adding directories to PATH:
PATH += /home/roukmoute/workspace/github/emsdk
PATH += /home/roukmoute/workspace/github/emsdk/upstream/emscripten
PATH += /home/roukmoute/workspace/github/emsdk/node/14.18.2_64bit/bin

Setting environment variables:
PATH = /home/roukmoute/workspace/github/emsdk:/home/roukmoute/workspace/github/emsdk/upstream/emscripten:/home/roukmoute/workspace/github/emsdk/node/14.18.2_64bit/bin:/home/roukmoute/.cargo/bin:/home/roukmoute/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:/home/roukmoute/.dotnet/tools
EMSDK = /home/roukmoute/workspace/github/emsdk
EM_CONFIG = /home/roukmoute/workspace/github/emsdk/.emscripten
EMSDK_NODE = /home/roukmoute/workspace/github/emsdk/node/14.18.2_64bit/bin/node
➤  which docker
/usr/bin/docker
➤  docker ps
CONTAINER ID   IMAGE                  COMMAND                  CREATED      STATUS       PORTS                                       NAMES
9c1ff6f5e0dc   postgres:14.2-alpine   "docker-entrypoint.s…"   9 days ago   Up 3 hours   0.0.0.0:5434->5432/tcp, :::5434->5432/tcp   digital-docker-c-postgres-1
➤  make dock
docker ps
make: docker: Permission denied
make: *** [Makefile:2: dock] Error 127
sbc100 commented 2 years ago

Ah, I think the make program is finding the directory called docker inside emsdk (which is on the PATH). Very odd that make works differently to the shell in that respect.