Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkm/ce-rs
compiler compiler-explorer rust
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dkm/ce-rs
- Owner: dkm
- Created: 2023-11-22T20:53:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-10T19:55:12.000Z (about 1 year ago)
- Last Synced: 2024-10-28T00:01:57.210Z (2 months ago)
- Topics: compiler, compiler-explorer, rust
- Language: Rust
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING3
Awesome Lists containing this project
README
Command line client for Compiler-Explorer
=========================================`ce-rs` is a simple command line client for [`Compiler-Explorer`]. It can't do
everything the web UI can, but it can help with simple tasks.## Building
`ce-rs` is written in Rust.
``` sh
$ cargo build
```## How to use it
### Listing the compilers
``` sh
Usage: ce-rs list-compilers [OPTIONS]Options:
--all
--name
--instruction-set
--language
--version-min
--version-max
-h, --help Print help
```You can query the installed compilers for some language and/or other critera:
``` sh
$ ce-rs list-compilers --language rust --version-min 1.60 --version-max 1.64
- "rustc 1.60.0", id: r1600, language: rust, type: rust, version: 1.60.0, ISA: amd64
- "rustc 1.61.0", id: r1610, language: rust, type: rust, version: 1.61.0, ISA: amd64
- "rustc 1.62.0", id: r1620, language: rust, type: rust, version: 1.62.0, ISA: amd64
- "rustc 1.63.0", id: r1630, language: rust, type: rust, version: 1.63.0, ISA: amd64
- "rustc 1.64.0", id: r1640, language: rust, type: rust, version: 1.64.0, ISA: amd64
```### Compiling code
``` sh
Usage: ce-rs compile [OPTIONS] <--source |--source-file >Options:
--source
--binary
--binary-object
--execute
--summary
--source-file
--id
--name
--language
--instruction-set
--version-min
--version-max
--flags
--stdout Write stdout to given file (stdout if -)
--stderr Write stderr to given file (stdout if -)
-f, --filters
-h, --help Print help
```Same filtering as for the `list-compilers` applies and can be used to compile a
single source with several compilers. The `--summary` gives a synthetic output:``` sh
$ ce-rs compile --source-file toto.rs --language rust --version-min 1.60 --version-max 1.64 --summary --stderr - --stdout -
✔ Compilation "rustc 1.60.0" (0)
✔ Compilation "rustc 1.61.0" (0)
✔ Compilation "rustc 1.62.0" (0)
✔ Compilation "rustc 1.63.0" (0)
✔ Compilation "rustc 1.64.0" (0)
```With `--execute`:
``` sh
$ ce-rs compile --source-file toto.rs --language rust \
--version-min 1.60 --version-max 1.64 \
--summary --stderr - --stdout - \
--execute
✔ Compilation "rustc 1.60.0" (0)
✔ Execution "rustc 1.60.0" (0)
✔ Compilation "rustc 1.61.0" (0)
✔ Execution "rustc 1.61.0" (0)
✔ Compilation "rustc 1.62.0" (0)
✔ Execution "rustc 1.62.0" (0)
✔ Compilation "rustc 1.63.0" (0)
✔ Execution "rustc 1.63.0" (0)
✔ Compilation "rustc 1.64.0" (0)
✔ Execution "rustc 1.64.0" (0)
```For example, when investigating a regression, you can use a similar command to check on older versions:
``` sh
$ ce-rs compile --source-file pr56843.C \
--flags "-O2 -fno-unit-at-a-time -fwhole-program" \
--summary --language 'c\+\+' \
--name 'gcc' --instruction-set amd64 \
--version-min 9.0 --version-max 13.2
✔ Compilation "MinGW gcc 11.3.0" (0)
✔ Compilation "MinGW gcc 12.1.0" (0)
✔ Compilation "MinGW gcc 12.2.0" (0)
✔ Compilation "MinGW gcc 13.1.0" (0)
✔ Compilation "x86-64 gcc 10.1" (0)
✔ Compilation "x86-64 gcc 10.2" (0)
✔ Compilation "x86-64 gcc 10.3" (0)
✔ Compilation "x86-64 gcc 10.4" (0)
✔ Compilation "x86-64 gcc 10.5" (0)
✔ Compilation "x86-64 gcc 11.1" (0)
✔ Compilation "x86-64 gcc 11.2" (0)
✔ Compilation "x86-64 gcc 11.3" (0)
✔ Compilation "x86-64 gcc 11.4" (0)
✔ Compilation "x86-64 gcc 12.1" (0)
✔ Compilation "x86-64 gcc 12.2" (0)
✔ Compilation "x86-64 gcc 12.3" (0)
✔ Compilation "x86-64 gcc 13.1" (0)
✔ Compilation "x86-64 gcc 13.2" (0)
✔ Compilation "x86-64 gcc 9.1" (0)
✔ Compilation "x86-64 gcc 9.2" (0)
✔ Compilation "x86-64 gcc 9.3" (0)
✔ Compilation "x86-64 gcc 9.4" (0)
✔ Compilation "x86-64 gcc 9.5" (0)
```[`Compiler-Explorer`]: https://compiler-explorer.org