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

Use latest cargo-local-registry (from git) #36

Merged

Conversation

dhovart
Copy link
Contributor

@dhovart dhovart commented Nov 29, 2021

This fixes #34.

Make sure to pull rust:latest if it's not compiling locally (build needs cargo >= 1.56).

Sorry for the long resolution time, I had to resolve a few issues related to cargo-local-registry.
In this PR, we're building cargo-local-registry from its git source instead of pulling a binary release.
I'll update the Dockerfile once a binary is available to shorten build time.

I've made a test with the gigasecond exercise and it worked properly.

@dhovart dhovart requested a review from a team as a code owner November 29, 2021 14:31
@ErikSchierboom
Copy link
Member

@dhovart I can confirm that the build failure is fixed. When I try to run the test runner though, I get an error:

slug:          gigasecond
solution path: /solution
output path:   /output
   Unpacking libc v0.2.108 (registry `/opt/test-runner/local-registry`)
error: failed to download `libc v0.2.108`

Caused by:
  unable to get packages from source

Caused by:
  failed to download replaced source registry `crates-io`

Caused by:
  failed to unpack package `libc v0.2.108 (registry `/opt/test-runner/local-registry`)`

Caused by:
  failed to create directory `/usr/local/cargo/registry/src/-0177ef2a2962ff86/libc-0.2.108`

Caused by:
  Read-only file system (os error 30)

Is that something that happens on your side too?

@dhovart
Copy link
Contributor Author

dhovart commented Nov 30, 2021

@ErikSchierboom it doesn't work with a read-only filesystem. You need to run the docker image without the read-only option.

@ErikSchierboom
Copy link
Member

@dhovart Ah right. That's okay for now.

It does now work:

slug:          gigasecond
solution path: /solution
output path:   /output
   Unpacking libc v0.2.108 (registry `/opt/test-runner/local-registry`)
   Unpacking time v0.3.5 (registry `/opt/test-runner/local-registry`)
   Compiling libc v0.2.108
   Compiling time v0.3.5
   Compiling gigasecond v2.0.0 (/solution)
    Finished test [unoptimized + debuginfo] target(s) in 6.06s
     Running unittests (target/debug/deps/gigasecond-71d09f45297ab0ff)
     Running tests/gigasecond.rs (target/debug/deps/gigasecond-67509d699a3b6632)
   Doc-tests gigasecond

It looks like the test runner was compiling libc and time. Is there any way to pre-compile these?

@dhovart
Copy link
Contributor Author

dhovart commented Nov 30, 2021

Yes! I plan to work on this with #35.

@ErikSchierboom ErikSchierboom merged commit 59acc0d into exercism:main Nov 30, 2021
@ErikSchierboom
Copy link
Member

Thanks!

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.

Docker build is broken
2 participants