Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.

Conversation

nilslice
Copy link

Not currently in this PR, but I would also like to change the compile and run entries to support using cargo, the default Rust toolchain instead of interacting with rustc directly. cargo is already available in the distribution downloaded in the setup stage.

I believe the only changes needed would be:

name = "rust"
- entrypoint = "main.rs"
+ entrypoint = "src/main.rs"
extensions = [
  "rs"
]
packages = [
  "rust-gdb"
]
setup = [
  "curl --proto '=https' --tlsv1.2 -Sf https://static.rust-lang.org/dist/rust-1.48.0-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /tmp",
  "/tmp/rust-1.48.0-x86_64-unknown-linux-gnu/install.sh",
  "rm -rf /tmp/rust-1.48.0-x86_64-unknown-linux-gnu"
]

[compile]
command = [
-  "rustc",
-  "-o",
-  "main"
+  "cargo",
+  "build"
]

[run]
command = [
-  "./main"
+  "cargo",
+  "run"
]

[tests]

  [tests.hello]
  code = "fn main() {\n  println!(\"hello\");\n}"
  output = "hello\n"

I'm not sure where the repl initialization happens, but cargo new ${REPL_NAME} would be necessary, along with one additional environment variable, $USER set to the existing $REPL_OWNER value would suffice.

Thanks!

@alexapostolu
Copy link

alexapostolu commented May 8, 2021

I think the reason the CI is failing is because on the Ubuntu Bionic packages list, they only have Rust for 1.47.0+

rust-doc (1.47.0+dfsg1+llvm-1ubuntu1~18.04.1)
rust-gdb (1.47.0+dfsg1+llvm-1ubuntu1~18.04.1)
rust-lldb (1.47.0+dfsg1+llvm-1ubuntu1~18.04.1)
rust-src (1.47.0+dfsg1+llvm-1ubuntu1~18.04.1)
rustc (1.47.0+dfsg1+llvm-1ubuntu1~18.04.1 [amd64, i386], 1.24.1+dfsg1+llvm-0ubuntu2 [arm64, armhf, ppc64el, s390x]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants