From 9a307e67667ecec60b4939e27d2de4d471cbe56e Mon Sep 17 00:00:00 2001 From: Victor Frazao Date: Mon, 15 Mar 2021 19:45:20 -0400 Subject: [PATCH] pkg(rust-1.50.0): Add rust 1.50.0 --- api/Dockerfile | 2 +- packages/rust/1.50.0/build.sh | 5 +++++ packages/rust/1.50.0/compile | 6 ++++++ packages/rust/1.50.0/environment | 5 +++++ packages/rust/1.50.0/metadata.json | 6 ++++++ packages/rust/1.50.0/run | 3 +++ packages/rust/1.50.0/test.rs | 3 +++ 7 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 packages/rust/1.50.0/build.sh create mode 100644 packages/rust/1.50.0/compile create mode 100644 packages/rust/1.50.0/environment create mode 100644 packages/rust/1.50.0/metadata.json create mode 100644 packages/rust/1.50.0/run create mode 100644 packages/rust/1.50.0/test.rs diff --git a/api/Dockerfile b/api/Dockerfile index fd261bd..6f2ef37 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,7 +5,7 @@ RUN for i in $(seq 1001 1500); do \ useradd -M runner$i -g $i -u $i ; \ done RUN apt-get update && \ - apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils && \ + apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential && \ rm -rf /var/lib/apt/lists/* ENV NODE_ENV=production diff --git a/packages/rust/1.50.0/build.sh b/packages/rust/1.50.0/build.sh new file mode 100755 index 0000000..c3e41b1 --- /dev/null +++ b/packages/rust/1.50.0/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +curl -OL "https://static.rust-lang.org/dist/rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz" +tar xzvf rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz +rm rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz diff --git a/packages/rust/1.50.0/compile b/packages/rust/1.50.0/compile new file mode 100644 index 0000000..201318a --- /dev/null +++ b/packages/rust/1.50.0/compile @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# https://stackoverflow.com/questions/38041331/rust-compiler-cant-find-crate-for-std +# Rust compiler needs to find the stdlib to link against +rustc -o binary -L ${RUST_INSTALL_LOC}/rustc/lib -L ${RUST_INSTALL_LOC}/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib "$@" +chmod +x binary diff --git a/packages/rust/1.50.0/environment b/packages/rust/1.50.0/environment new file mode 100644 index 0000000..2a704ee --- /dev/null +++ b/packages/rust/1.50.0/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/rust-1.50.0-x86_64-unknown-linux-gnu/rustc/bin/:$PATH +export RUST_INSTALL_LOC=$PWD/rust-1.50.0-x86_64-unknown-linux-gnu diff --git a/packages/rust/1.50.0/metadata.json b/packages/rust/1.50.0/metadata.json new file mode 100644 index 0000000..48dc091 --- /dev/null +++ b/packages/rust/1.50.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "rust", + "version": "1.50.0", + "aliases": ["rs"], + "author": "Victor Frazao " +} diff --git a/packages/rust/1.50.0/run b/packages/rust/1.50.0/run new file mode 100644 index 0000000..f66526f --- /dev/null +++ b/packages/rust/1.50.0/run @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +./binary "$@" diff --git a/packages/rust/1.50.0/test.rs b/packages/rust/1.50.0/test.rs new file mode 100644 index 0000000..9561664 --- /dev/null +++ b/packages/rust/1.50.0/test.rs @@ -0,0 +1,3 @@ +fn main() { + println!("OK"); +}