racket / docker

Docker images for various Racket versions
MIT License
62 stars 17 forks source link

Fontconfig problem #27

Open pmatos opened 6 years ago

pmatos commented 6 years ago

I am getting a fontconfig problem in plot:

# racket
Welcome to Racket v7.1.
> (require plot/no-gui)
> (plot-file (function (lambda (x) (sin (* 4 x))) -1 1) #:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5 "foo.png")
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
pmatos commented 6 years ago

This is with jackfirth/racket:7.1

jackfirth commented 6 years ago

I'm seeing a few similar bug reports scattered across various projects, including one as recently as eight days ago. I suspect there's some upstream issue with the fontconfig library in the buildpack-deps images we're using as base images. In the meantime, would you be willing to add a line to the test.sh script that runs the plot-file code you've shared? A failing test would be a useful starting point.

pmatos commented 5 years ago

Jack, sorry, only just noticed that I didn't add the line you requested to test.sh . However it's not as easy as adding a line. We need to run:

raco pkg install --auto plot
racket -e '(require plot/no-gui) (plot-file (function (lambda (x) x)) #:x-min 0 #:x-max 1 #:y-min 0 #:y-max 1 "foo.png")'

I am not really very knowledgeable of docker. Do you know how to run both of these command inside a docker container? I imagined you could have a script with them, somehow copy them into the container, and then run it using the normal docker run command.

jackfirth commented 5 years ago

I haven't tried it, but according to this stackoverflow answer the way to do this is to docker run the shell and hand the shell a single command that uses the semicolon operator to join together the two commands you want to run. Example: docker run image /bin/bash -c "cd /path/to/somewhere; python a.py"

jackfirth commented 5 years ago

Update: I still see this error in the minimal images, but in the full distribution images work fine. I've tested with jackfirth/racket:7.1-full and jackfirth/racket:7.4-full and both successfully write the plot to a file.