<walden>
hi, beginner here trying to use the docker image for ponylang/ponyc, all i can get is illegal instruction when i try to run it on helloworld example
<walden>
(new to docker also)
<walden>
looks like this:
<walden>
$ docker run ponylang/ponyc Building builtin -> /usr/local/lib/pony/0.2.1/packages/builtin Illegal instruction
<walden>
any help appreciated
<walden>
correction, this is my docker command line: $ docker run -v /c/pony/helloworld:/src/main ponylang/ponyc
<michael_campbell>
that image is based on ubuntu, looks like. What does "docker run -it --rm ponylang/ponyc uname" give you?
<michael_campbell>
(just making sure docker works)
<michael_campbell>
You on windows?
jemc has quit [Ping timeout: 250 seconds]
<walden>
hi, michael, yes i'm on windows
<walden>
command returns "Linux"
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
<michael_campbell>
Ok, so it looks like docker is working. My network is slow, and ubuntu is big, so I'm pulling down the image to test as well.
<michael_campbell>
How about this? `docker run -it --rm ponylang/ponyc ponyc --help` ?
<michael_campbell>
Ok, so it's running ponyc ok. How about "ls" as the command, when you run it with your "-v" volume mount?
<michael_campbell>
This is to test the volume mount worked and ponyc can see your source.
c355e3b has quit [Quit: Connection closed for inactivity]
<walden>
ls command shows nothing
<michael_campbell>
You might also just shell into the container with "docker run -it --rm -v /c/pony/helloworld:/src/main ponylang/ponyc bash"
<walden>
ah, okay, will try that
<michael_campbell>
If THAT works, you should get a bash prompt within your container. Are you familiar with unix?
<walden>
yes
<michael_campbell>
Ok, once in bash you can `pwd`, `ls`, etc. to see what's what inside the container
<walden>
what is '-it' on that docker command?
<michael_campbell>
combo of -i and -t. -i => interactive (for shells and such) and -t => give you a tty in which to communicate with the container
<walden>
got it
<michael_campbell>
so -i isn't really necessary for one-offs like ls, but it's a bit of muscle memory for me when I type "docker run" any more =D
<michael_campbell>
(I actually have an alias: alias drun="docker run -it --rm" on my system I use it so much)
<michael_campbell>
the --rm removes the container when it's done running. If you run "docker ps -a", you'll see all the old containers that ran and ended, and are just hanging around.
<michael_campbell>
That ponylang container, based on ubuntu is *huge*. I think a better choice might be debian:jessie, but <shrug>
<walden>
qq: on the ponyc command line, we have the -v [volume spec], what is the "'/src/main" part doing there?
<walden>
(i just copied the example, but I hardly know what i'm doing)
<michael_campbell>
That maps your local machine's /c/pony/helloworld directory to "/src/main" *in the container*.
<michael_campbell>
So if you cd to /src/main while in bash in the container, it should BE whatever you ahve at /c/pony/helloworld
<walden>
thanks, let me check that out
<SeanTAllen>
if the docker container is 0.2.1 (im not sure jemc put it together) then there is code in the most recent master that will crash the older compiler
<michael_campbell>
Note that because you're in windows, it's actually running a VM with docker in it. So it's the *VM's* notion of /c/pony/helloworld, which SHOULD be c:\pony\helloworld
<walden>
that would seem to be the problem then
<SeanTAllen>
i wouldnt imagine helloworld would be one, but i haven't tried it.
<michael_campbell>
I don't know how your VM is setup (I'm assuming VirtualBox?)
<SeanTAllen>
there has certainly been a ton of changes and fixes since 0.2.1
<SeanTAllen>
we'd lik to do another release but there's a mess of release chain stuff that needs to get fixed.
<michael_campbell>
If it's VirtualBox, you should be able to mount "c:\" in windows to "/c" in VirtualBox VM.
<SeanTAllen>
you need to be using a certain version of virtual box or higher
<walden>
got virtualbox 5
<SeanTAllen>
"Pony binaries can trigger illegal instruction errors under VirtualBox 4.x, for at least the x86_64 platform and possibly others.
<SeanTAllen>
Use VirtualBox 5.x to avoid possible problems."
<SeanTAllen>
ok
<SeanTAllen>
thats good
<SeanTAllen>
4.0 has lots of illegal instruction errors
<walden>
yes, i saw that warning in the docs
<SeanTAllen>
despite writing lots of docs, i tend to be bad at reading them
<walden>
so, i thought docker would be the quick way to try out the language, maybe not right at the moment?
<michael_campbell>
hahaha
<michael_campbell>
aren't we all
<SeanTAllen>
apparently not walden.
<SeanTAllen>
ubuntu in virtual box 5 should probably be the easiest path
<michael_campbell>
Walden, honestly, from Windows I think you'd be as well off by running a VM with your favorite linux, and going from there
<SeanTAllen>
everyone seems to be able to get working with vbox 5 easily and with ubuntu easily
<michael_campbell>
I like debian based Linuxen, but use what you like.
<walden>
i will still need to build from source, right?
<SeanTAllen>
yes
<michael_campbell>
That's pretty trivial for pony, I've found.
<SeanTAllen>
on many platforms.
<walden>
what about the deps?
<michael_campbell>
I was almost skeptical it worked it was kind of too easy
<SeanTAllen>
some old linux'es appear to be painful
<SeanTAllen>
which usually seems to come down to llvm problems
<SeanTAllen>
or weird ld linker default setups
<SeanTAllen>
i havent heard of anyone having issue with pony or the deps on any recent debian-ish linux. ubuntu or later debians.
<SeanTAllen>
it appears to be pretty straightforward.
<walden>
does this message look familiar: APT mirror was temporary switched off due to excess load. We are working on bringing it back. Stay tuned!
<SeanTAllen>
yes
<SeanTAllen>
llvm turned it off
<SeanTAllen>
apparently they only have 1 machine
<SeanTAllen>
and everyone was using it to install deps from
<walden>
i am currently building a debian in virtualbox, takes a long time
<SeanTAllen>
which was most of their traffic so they turned it off
<SeanTAllen>
the jessie instructions are waiting for someone to update them
<michael_campbell>
SeanTAllen, is there a way to make a statically linked binary?
<SeanTAllen>
try doing a modification of the new ubuntu ones... if you get the debian working, we'd love a PR that removes the instructions that involve the now dead apt repo that llvm ran
<michael_campbell>
I googled around a bit but was unsuccessful
<SeanTAllen>
michael_campbell: i believe so but i havent done it so i dont know how, it hasnt been an issue for us yet.
<SeanTAllen>
all the linking is done using standard c tools, so its quite doable.
<michael_campbell>
Ok. here's my use case: A lot of guys @ work are all over golang, for static binaries, for running inside docker. I don't much like go so far, so am playing with Nim and Pony, both of which I like much more.
<SeanTAllen>
I know a couple people have done it. Maybe drop a note to the mailing list and hope whoever it was reads it.
<michael_campbell>
Do you know how to tell ponyc to pass an arg to the linker? `--help` didn't yield anything obvious, but my c days are long, long ago, so I might have missed something
<michael_campbell>
ok
<SeanTAllen>
I have looked at it so I don't know.
<michael_campbell>
it's not a big deal yet; I can't sell the language until I know it better and/or can demonstrate awesomeness to others. Which, is totally on me right now; I know it's in there, I just need to know more to get it out =D
<walden>
thank you for the help, gentlemen, i'm going to pick this up tomorrow
<michael_campbell>
Godspeed walden
<walden>
=D
walden has quit [Quit: Page closed]
<doublec>
michael_campbell: pony executables use glibc so it's unlikely statically linked binaries are a go
<doublec>
michael_campbell: if you want a statically linked libc anyway
SilverKey has quit [Quit: Halted.]
<doublec>
michael_campbell: (because of issues with networking and statically linked glibc)
<doublec>
michael_campbell: I haven't tried using musl though
Applejack_ has joined #ponylang
<SeanTAllen>
i believe a couple people reported success doublec, but i could be misremembering
Applejack_ has quit [Ping timeout: 272 seconds]
<doublec>
SeanTAllen: looks like shodan45 tried musl but got illegal instructions
<doublec>
SeanTAllen: but they were doing it in a VM so it may be some other unrelated issue
SilverKey has joined #ponylang
<michael_campbell>
How is it that go can do it? Or even gcc? (I admit huge ignorance here.)
trapped has quit [Read error: Connection reset by peer]
<michael_campbell>
(am reading up on it as well...)
<SeanTAllen>
doublec: there are statically linkable versions of glibc available or at least used to be
<michael_campbell>
If it's not doable, it's not. I'm not overly stressing - our docker containers in which I want to run stuff I think will be able to support a ponyc, so I can create and run pony bins in the same base layer of docker
<michael_campbell>
But with a 100% static bin it would awesomesauce to be able to have a docker container of "FROM scratch; COPY ./bin/thing /bin; ENTRPOINT /bin/thing" and have the container be a few hundred bytes bigger than the binary, you know?
<michael_campbell>
The advantages of pony may well outweigh that, however =D
<michael_campbell>
But SeanTAllen; write your book; put it on Manning, and I will be the first in line to buy the MEAP
<michael_campbell>
doublec, musl gives me the itchies. Irrationally, I'll admit
emancu has quit []
<doublec>
SeanTAllen: I've not been able to get a statically linked glibc that includes networking and my searches for it have been fruitless. I'd love to know if there is an option.
<doublec>
SeanTAllen: the issue being glibc dynamically picks a networking library even if statically linked
<doublec>
michael_campbell: yeah, I'm not a fan of using a completely different libc just for static linking
<doublec>
michael_campbell: it's what I do for another project though
* michael_campbell
nods.
<doublec>
It is nice having a binary you can copy to almost any linux machine and it runs
<michael_campbell>
Ayup
<michael_campbell>
This is weird; the last time I did much c/c++ was in the sun days, with the sun compiler, and that was easy to statically link stuff. I'd just assumed (uhoh!) things were still like that.
trapped has quit [Read error: Connection reset by peer]
<Candle>
doublec: yeah, ideally. It's the Map[String, Map[String, String]] that IniParse returns. The settings aren't going to change without restarting the process (for now). While I'm pretty sure I understand the capabilities concepts, coercing something into the right form is what's driving me up the wall!
Perelandric has joined #ponylang
_andre_ has joined #ponylang
trapped has joined #ponylang
_andre has quit [Ping timeout: 240 seconds]
<doublec>
Candle: yeah, for things like that it can be difficult to track down which cap needs to be what
<doublec>
Candle: if you start with a Map[String, String] iso, and add elements to it. then insert it into a Map[String, Map[String, String] val], consuming it at that point, it should work
<jemc>
for example, a `Map[String, Map[String, String] ref] val` is actually deeply immutable because of viewpoint adaptation
<jemc>
(a `ref` field on a `val` origin is seen as a `val`, as shown in the table I linked to)
<jemc>
because of this, when you fetch an element from the collection (analogous to fetching a field from an object), your `Map` that you pull out will be a `val`
<jemc>
you can use this to your advantage, by creating an `iso` or `trn` collection of `ref`s, then consuming it to a `val` to make the entire collection deeply immutable
SilverKey has joined #ponylang
<Candle>
jemc: Thanks, that's given me some ideas with which to experiment.
SilverKey has quit [Read error: Connection reset by peer]
SilverKey has joined #ponylang
amclain has joined #ponylang
SilverKey has quit [Read error: Connection reset by peer]
SilverKey has joined #ponylang
rurban has quit [Quit: Leaving.]
amclain has quit [Quit: Leaving]
amclain has joined #ponylang
Applejack_ has quit [Ping timeout: 246 seconds]
Perelandric has quit [Ping timeout: 250 seconds]
Perelandric has joined #ponylang
nyarum has joined #ponylang
gsteed has joined #ponylang
nyarumes has quit [Ping timeout: 272 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
SilverKey has joined #ponylang
rurban has joined #ponylang
SilverKey has quit [Quit: Halted.]
aturley has quit [Ping timeout: 264 seconds]
SilverKey has joined #ponylang
rurban has quit [Quit: Leaving.]
aturley has joined #ponylang
aturley has quit [Ping timeout: 258 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
Matthias247 has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
Matthias247 has joined #ponylang
pulpfiction has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
aturley has joined #ponylang
Applejack_ has quit [Ping timeout: 258 seconds]
Applejack_ has joined #ponylang
SilverKey has quit [Quit: Halted.]
Applejack_ has quit [Ping timeout: 276 seconds]
_andre has quit [Quit: leaving]
michael_campbell has joined #ponylang
SilverKey has joined #ponylang
rurban has joined #ponylang
Applejack_ has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
rurban has quit [Quit: Leaving.]
rurban has joined #ponylang
rurban has quit [Client Quit]
Matthias247 has quit [Read error: Connection reset by peer]