diff --git a/Cargo.toml b/Cargo.toml index 39ec9f8a4..81cb9a254 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["task-maker-*"] [package] name = "task-maker-rust" -version = "0.3.4" +version = "0.3.5" description = "Tool for building tasks for informatics competitions, with support for cache, distributed computations and more" readme = "README.md" authors = ["Edoardo Morassutto "] diff --git a/README.md b/README.md index c3fcc4dd2..1a46246af 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,33 @@ The new cmsMake! [![asciicast](https://asciinema.org/a/301849.svg)](https://asciinema.org/a/301849) ## Installation -The official way for installing `task-maker-rust` is not defined yet. +For **Ubuntu** and **Debian** users you can find the `.deb` file in the [Releases](https://github.com/edomora97/task-maker-rust/releases) page. +Install the package using `sudo dpkg -i the_file.deb` and it's dependencies (if you need to) with `sudo apt install -f`. +There is a good chance that you have already all the dependencies already installed. + +For **ArchLinux** users you can find the packages in the AUR: [`task-maker-rust`](https://aur.archlinux.org/packages/task-maker-rust) (the stable release) +and [`task-maker-rust-git`](https://aur.archlinux.org/packages/task-maker-rust-git) (the version based on `master`). + +For the other operating systems the recommended way to use task-maker-rust is the following: + +- Install the latest stable rust version (and cargo). For example using [rustup](https://rustup.rs/) +- Install the system dependencies: `libseccomp` or `libseccomp-dev` on Ubuntu +- Clone this repo: `git clone https://github.com/edomora97/task-maker-rust` +- Build task-maker: `cargo build --release` -For now you should clone the repo and run `cargo build --release`. The executable should be located at `target/release/task-maker`. +Due to limitations of cargo (the build system), `cargo install` should not be used since it +doesn't copy some required files. For the same reason you should not delete or move the cloned +repository after the build. If you need a package for your operating system/distro open an issue +please! -You may need to install `libseccomp` (or maybe `libseccomp-dev` on Ubuntu) for compiling task-maker. +The supported operating systems are Linux (with libseccomp support), OSX and Windows under WSL2. +It should be possible to build task-maker using musl but it may be hard to link libseccomp! ## Usage ### Simple local usage -Run `task-maker` in the task folder to compile and run everything. +Run `task-maker-rust` in the task folder to compile and run everything. Specifying no option all the caches are active, the next executions will be very fast, actually doing only what's needed. @@ -25,7 +41,7 @@ Specifying no option all the caches are active, the next executions will be very If you really want to repeat the execution of something provide the `--no-cache` option: ```bash -task-maker --no-cache +task-maker-rust --no-cache ``` Without any options `--no-cache` won't use any caches. @@ -36,7 +52,7 @@ The available options for `--no-cache` can be found with `--help`. ### Test only a subset of solutions Sometimes you only want to test only some solutions, speeding up the compilation and cleaning a bit the output: ```bash -task-maker sol1.cpp sol2.py +task-maker-rust sol1.cpp sol2.py ``` Note that you may or may not specify the folder of the solution (sol/ or solution/). You can also specify only the prefix of the name of the solutions you want to check. @@ -44,25 +60,25 @@ You can also specify only the prefix of the name of the solutions you want to ch ### Using different task directory By default the task in the current directory is executed, if you want to change the task without `cd`-ing away: ```bash -task-maker --task-dir ~/tasks/poldo +task-maker-rust --task-dir ~/tasks/poldo ``` ### Extracting executable files All the compiled files are kept in an internal folder but if you want to use them, for example to debug a solution, passing `--copy-exe` all the useful files are copied to the `bin/` folder inside the task directory. ```bash -task-maker --copy-exe +task-maker-rust --copy-exe ``` ### Do not build the statement If you don't want to build the statement files (and the booklet) just pass `--no-statement`. ```bash -task-maker --no-statement +task-maker-rust --no-statement ``` ### Clean the task directory If you want to clean everything, for example after the contest, simply run: ```bash -task-maker --clean +task-maker-rust --clean ``` This will remove the files that can be regenerated from the task directory. Note that the internal cache is not pruned by this command. @@ -70,21 +86,21 @@ Note that the internal cache is not pruned by this command. ### Remote evaluation On a server (a machine accessible from clients and workers) run ```bash -task-maker --server +task-maker-rust --server ``` This will start `task-maker` in server mode, listening for connections from clients and workers respectively on port 27182 and 27183. Then on the worker machines start a worker each with ```bash -task-maker --worker ip_of_the_server:27183 +task-maker-rust --worker ip_of_the_server:27183 ``` This will start a worker on that machine (using all the cores unless specified), connecting to the server and executing the jobs the server assigns. For running a remote computation on your machine just add the `--evaluate-on` option, like: ```bash -task-maker --evaluate-on ip_of_the_server:27182 +task-maker-rust --evaluate-on ip_of_the_server:27182 ``` License: MPL-2.0 diff --git a/src/main.rs b/src/main.rs index f3064c8e1..0e1b8de59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,35 @@ //! The new cmsMake! //! +//! [![asciicast](https://asciinema.org/a/301849.svg)](https://asciinema.org/a/301849) +//! //! # Installation -//! The official way for installing `task-maker-rust` is not defined yet. +//! For **Ubuntu** and **Debian** users you can find the `.deb` file in the [Releases](https://github.com/edomora97/task-maker-rust/releases) page. +//! Install the package using `sudo dpkg -i the_file.deb` and it's dependencies (if you need to) with `sudo apt install -f`. +//! There is a good chance that you have already all the dependencies already installed. +//! +//! For **ArchLinux** users you can find the packages in the AUR: [`task-maker-rust`](https://aur.archlinux.org/packages/task-maker-rust) (the stable release) +//! and [`task-maker-rust-git`](https://aur.archlinux.org/packages/task-maker-rust-git) (the version based on `master`). +//! +//! For the other operating systems the recommended way to use task-maker-rust is the following: +//! +//! - Install the latest stable rust version (and cargo). For example using [rustup](https://rustup.rs/) +//! - Install the system dependencies: `libseccomp` or `libseccomp-dev` on Ubuntu +//! - Clone this repo: `git clone https://github.com/edomora97/task-maker-rust` +//! - Build task-maker: `cargo build --release` //! -//! For now you should clone the repo (with `--recurse-submodules`!) and run `cargo build --release`. //! The executable should be located at `target/release/task-maker`. +//! Due to limitations of cargo (the build system), `cargo install` should not be used since it +//! doesn't copy some required files. For the same reason you should not delete or move the cloned +//! repository after the build. If you need a package for your operating system/distro open an issue +//! please! +//! +//! The supported operating systems are Linux (with libseccomp support), OSX and Windows under WSL2. +//! It should be possible to build task-maker using musl but it may be hard to link libseccomp! //! //! # Usage //! //! ## Simple local usage -//! Run `task-maker` in the task folder to compile and run everything. +//! Run `task-maker-rust` in the task folder to compile and run everything. //! //! Specifying no option all the caches are active, the next executions will be very fast, actually doing only what's needed. //! @@ -17,7 +37,7 @@ //! If you really want to repeat the execution of something provide the `--no-cache` //! option: //! ```bash -//! task-maker --no-cache +//! task-maker-rust --no-cache //! ``` //! //! Without any options `--no-cache` won't use any caches. @@ -28,7 +48,7 @@ //! ## Test only a subset of solutions //! Sometimes you only want to test only some solutions, speeding up the compilation and cleaning a bit the output: //! ```bash -//! task-maker sol1.cpp sol2.py +//! task-maker-rust sol1.cpp sol2.py //! ``` //! Note that you may or may not specify the folder of the solution (sol/ or solution/). //! You can also specify only the prefix of the name of the solutions you want to check. @@ -36,25 +56,25 @@ //! ## Using different task directory //! By default the task in the current directory is executed, if you want to change the task without `cd`-ing away: //! ```bash -//! task-maker --task-dir ~/tasks/poldo +//! task-maker-rust --task-dir ~/tasks/poldo //! ``` //! //! ## Extracting executable files //! All the compiled files are kept in an internal folder but if you want to use them, for example to debug a solution, passing `--copy-exe` all the useful files are copied to the `bin/` folder inside the task directory. //! ```bash -//! task-maker --copy-exe +//! task-maker-rust --copy-exe //! ``` //! //! ## Do not build the statement //! If you don't want to build the statement files (and the booklet) just pass `--no-statement`. //! ```bash -//! task-maker --no-statement +//! task-maker-rust --no-statement //! ``` //! //! ## Clean the task directory //! If you want to clean everything, for example after the contest, simply run: //! ```bash -//! task-maker --clean +//! task-maker-rust --clean //! ``` //! This will remove the files that can be regenerated from the task directory. //! Note that the internal cache is not pruned by this command. @@ -62,21 +82,21 @@ //! ## Remote evaluation //! On a server (a machine accessible from clients and workers) run //! ```bash -//! task-maker --server +//! task-maker-rust --server //! ``` //! This will start `task-maker` in server mode, listening for connections from clients and workers //! respectively on port 27182 and 27183. //! //! Then on the worker machines start a worker each with //! ```bash -//! task-maker --worker ip_of_the_server:27183 +//! task-maker-rust --worker ip_of_the_server:27183 //! ``` //! This will start a worker on that machine (using all the cores unless specified), connecting to //! the server and executing the jobs the server assigns. //! //! For running a remote computation on your machine just add the `--evaluate-on` option, like: //! ```bash -//! task-maker --evaluate-on ip_of_the_server:27182 +//! task-maker-rust --evaluate-on ip_of_the_server:27182 //! ``` #![allow(clippy::borrowed_box)] diff --git a/task-maker-cache/Cargo.toml b/task-maker-cache/Cargo.toml index b7ab2f330..dab376a6f 100644 --- a/task-maker-cache/Cargo.toml +++ b/task-maker-cache/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-cache" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018" diff --git a/task-maker-dag/Cargo.toml b/task-maker-dag/Cargo.toml index aa13c910b..31588b386 100644 --- a/task-maker-dag/Cargo.toml +++ b/task-maker-dag/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-dag" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018" diff --git a/task-maker-exec/Cargo.toml b/task-maker-exec/Cargo.toml index 2071c0136..62c2c8373 100644 --- a/task-maker-exec/Cargo.toml +++ b/task-maker-exec/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-exec" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018" diff --git a/task-maker-format/Cargo.toml b/task-maker-format/Cargo.toml index 42fc6fd4e..89f640ac0 100644 --- a/task-maker-format/Cargo.toml +++ b/task-maker-format/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-format" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018" diff --git a/task-maker-lang/Cargo.toml b/task-maker-lang/Cargo.toml index e7286813c..72e5394ae 100644 --- a/task-maker-lang/Cargo.toml +++ b/task-maker-lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-lang" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018" diff --git a/task-maker-store/Cargo.toml b/task-maker-store/Cargo.toml index 514b97264..0624f3cd4 100644 --- a/task-maker-store/Cargo.toml +++ b/task-maker-store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-store" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018" diff --git a/task-maker-test/Cargo.toml b/task-maker-test/Cargo.toml index c0514a0cc..003d3ce83 100644 --- a/task-maker-test/Cargo.toml +++ b/task-maker-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-test" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018" build = "build.rs" diff --git a/task-maker-test/task-maker-test-sandbox/Cargo.toml b/task-maker-test/task-maker-test-sandbox/Cargo.toml index af2b96c62..20b82aa2e 100644 --- a/task-maker-test/task-maker-test-sandbox/Cargo.toml +++ b/task-maker-test/task-maker-test-sandbox/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "task-maker-test-sandbox" -version = "0.3.4" +version = "0.3.5" authors = ["Edoardo Morassutto "] edition = "2018"