ponylang / ponyc

Pony is an open-source, actor-model, capabilities-secure, high performance programming language
http://www.ponylang.io
BSD 2-Clause "Simplified" License
5.73k stars 415 forks source link

Using Docker ponylang/ponyc:latest workdir not set #3411

Closed riginding closed 5 years ago

riginding commented 5 years ago

I followed the installation guide to use ponyc from docker. I tried it on Arch Linux and on Windows both times resulting in the following error:

$ docker run -v $(pwd):/src/main ponylang/ponyc
Building builtin -> /root/.pony/ponyup/ponyc-nightly-20191119-gnu/packages/builtin
Building . -> /
Error:
no source files in package '.'

After some investigation I figured out that the workdir that should be src/main is not properly applied:

$ docker run -ti -v $(pwd):/src/main ponylang/ponyc sh
$ ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  src  srv  sys  tmp  usr  var
$ pwd
/

If I specify the workdir as an argument to docker it works as expected:

$ docker run --workdir /src/main -v $(pwd):/src/main ponylang/ponyc
Building builtin -> /root/.pony/ponyup/ponyc-nightly-20191119-gnu/packages/builtin
Building . -> /src/main
Generating
 Reachability
 Selector painting
 Data prototypes
 Data types
 Function prototypes
 Functions
 Descriptors
Optimising
Writing ./main.o
Linking ./main

According to the README.md it should also work without specifying workdir

SeanTAllen commented 5 years ago

Thanks. I'll look into this. The README needs to be updated as we recently switched over.

SeanTAllen commented 5 years ago

For whoever picks up this issue, we also need to make sure after the change that this works in the pony playground.

SeanTAllen commented 5 years ago

@EpicEric do you have time to look into this?

EpicEric commented 5 years ago

For whoever picks up this issue, we also need to make sure after the change that this works in the pony playground.

This shouldn't break the playground. The scripts that the playground uses (compile.sh, evaluate.sh) create a temporary directory with mktemp -d, create and cd to a subdir, and call ponyc.