Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows running spec within Docker container #3441

Merged
merged 1 commit into from Oct 20, 2016
Merged

Allows running spec within Docker container #3441

merged 1 commit into from Oct 20, 2016

Conversation

luislavena
Copy link
Contributor

crystal spec commands now supports JUnit XML output, which requires libxml2 to be installed.

With current defaults, the command fails due missing libxml2-dev dependencies in the image.

This change ensures libxml2-dev is installed along the other dependencies so can be used for both building executables and running specs.

Without this change, attempt to use official docker image fails with the following:

# crystal spec
/usr/bin/ld: cannot find -lxml2
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc -o "/root/.cache/crystal/crystal-run-spec.tmp" "${@}"  -rdynamic  -lyaml -lxml2 -lpcre -lm -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

But with this change:

# crystal spec
..............................................

Finished in 2.21 milliseconds
46 examples, 0 failures, 0 errors, 0 pending

I'm still not sure if including xml is desired for the release container, but considering might others need XML support during compilation too perhaps is not a bad idea?

Thank you ❤️ ❤️ ❤️ ❤️

@asterite
Copy link
Member

Thank you for this!! ❤️

I think we should include all dependencies that some part of the standard library depends on. So far I think it's libxml2 and libyaml.

And I'd do it to for the release container.

@luislavena
Copy link
Contributor Author

@asterite I had libyaml-dev in my original change but decided only to include libxml2-dev since spec was failing.

The change is only for Dockerfile.release which I believe the one used to push to Docker Hub?

I'm adding now the change for yaml 😄

`crystal spec` commands now supports JUnit XML output, which requires
libxml2 to be installed.

With current defaults, the command fails due missing `libxml2-dev`
dependencies in the image.

This change ensures `libxml2-dev` is installed along the other
dependencies so can be used for both building executables and running
specs.

Also includes `libyaml-dev` so any attempt to using `yaml` works
out of the box.
@asterite
Copy link
Member

Thank you!! ❤️

@asterite asterite merged commit ba346fc into crystal-lang:master Oct 20, 2016
@luislavena luislavena deleted the support-spec-docker branch October 20, 2016 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants