polygott icon indicating copy to clipboard operation
polygott copied to clipboard

update rust version to 1.48

Open nilslice opened this issue 4 years ago • 2 comments

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!

nilslice avatar Dec 14 '20 17:12 nilslice

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]

alexapostolu avatar May 08 '21 01:05 alexapostolu