diff options
-rw-r--r-- | Cargo.lock | 91 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 15 | ||||
-rw-r--r-- | docker/Dockerfile | 18 | ||||
-rw-r--r-- | docker/Makefile | 2 |
5 files changed, 40 insertions, 88 deletions
@@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "llvm-sys" -version = "120.2.5" +version = "140.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1c9655eec036faf512507746ce70765bda72ed98e52b4328f0d7b93e970c6d8" +checksum = "8b9eda9cc6f86672152125b1e112d66ab8797b7917fb202e2faee912caa76413" dependencies = [ "cc", "lazy_static", @@ -57,34 +57,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "pest" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "proc-macro2" -version = "1.0.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd7356a8122b6c4a24a82b278680c73357984ca2fc79a0f9fa6dea7dced7c58" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] name = "regex" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -103,61 +75,6 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - -[[package]] -name = "syn" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - -[[package]] -name = "unicode-ident" -version = "1.0.4" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" @@ -5,4 +5,4 @@ edition = "2018" [dependencies] libc = "0.2" -llvm-sys = {version = "120.0", features = ["strict-versioning"]} +llvm-sys = {version = "140.0", features = ["strict-versioning"]} @@ -9,6 +9,7 @@ Implementing a Language with LLVM`][llvm-tutorial]. This tutorial is written in implement every chapter in rust. The topics of the chapters are as follows: + - Chapter 1: [Kaleidoscope Introduction and the Lexer][llvm-ch1] - Chapter 2: [Implementing a Parser and AST][llvm-ch2] - Chapter 3: [Code generation to LLVM IR][llvm-ch3] @@ -51,6 +52,20 @@ cargo run Rustdoc for this crate is available at [johannst.github.io/llvm-kaleidoscope-rs][gh-pages]. +## Build with provided container file + +The provided [Dockerfile](docker/Dockerfile) documents the required +dependencies for an ubuntu based system and serves as a build environment with +the correct llvm version as specified in the [Cargo.toml](Cargo.toml) file. + +```bash +# Build the image *ks-rs*. Depending on the downlink this may take some minutes. +make -C docker + +podman run --rm -it -v $PWD:/work -w /work ks-rs +# Drops into a shell in the container, just use cargo build / run ... +``` + ## License This project is licensed under the [MIT](LICENSE) license. diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..5a7b498 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu + +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive \ + apt install \ + --yes \ + --no-install-recommends \ + ca-certificates \ + build-essential \ + cargo \ + llvm-14 \ + llvm-14-dev \ + # https://gitlab.com/taricorp/llvm-sys.rs/-/issues/13 + libclang-common-14-dev \ + zlib1g-dev \ + && \ + rm -rf /var/lib/apt/lists/* && \ + apt-get clean diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 0000000..6b3ef8b --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,2 @@ +build: + podman build -t ks-rs . |