Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Use llvm 18 (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
gavrilikhin-d authored Apr 28, 2024
1 parent 027783a commit 168c553
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "17.0"
version: "18.0"
- name: Build compiler
run: cargo build --verbose
- name: Run tests
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ logos = "0.14.0"
rug = "1.24.1"
ast_derive = { path = "src/ast_derive" }
miette = { version = "7.2.0", features = ["fancy"] }
thiserror = "1.0.58"
thiserror = "1.0.59"
derive_more = "0.99.17"
runtime = { path = "src/runtime" }
enum_dispatch = "0.3.13"
clap = { version = "4.5.4", features = ["derive"] }
inkwell = { version = "0.4.0", features = [
"llvm17-0",
"llvm18-0",
], git = "https://github.com/TheDan64/inkwell" }
pretty_env_logger = "0.5.0"
log = "0.4.21"
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ RUN apt-get update && apt-get install -y \
RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg

# Add the LLVM repository using the modern signed-by method
RUN echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy llvm-toolchain-jammy-17 main" > /etc/apt/sources.list.d/llvm.list
RUN echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy llvm-toolchain-jammy-18 main" > /etc/apt/sources.list.d/llvm.list

# Install LLVM 17
RUN apt-get update && apt-get install -y llvm-17 llvm-17-dev clang-17 libpolly-17-dev
ENV CC=clang-17
ENV CXX=clang++-17
# Install LLVM 18
RUN apt-get update && apt-get install -y llvm-18 llvm-18-dev clang-18 libpolly-18-dev
ENV CC=clang-18
ENV CXX=clang++-18

# Install Rust nightly
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Configure cargo to use clang-17 as the linker
# Configure cargo to use clang-18 as the linker
RUN mkdir -p ~/.cargo \
&& echo '[target.x86_64-unknown-linux-gnu]\nlinker = "clang-17"' > ~/.cargo/config.toml
&& echo '[target.x86_64-unknown-linux-gnu]\nlinker = "clang-18"' > ~/.cargo/config.toml

# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
Expand Down
6 changes: 3 additions & 3 deletions src/driver/execute/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ impl Emit for Package {
.chain(std::iter::once(bitcode.to_string_lossy().to_string()))
.collect();

let mut clang = std::process::Command::new("clang-17");
let mut clang = std::process::Command::new("clang-18");

let clang_version = run_fun!("clang-17" "--version")
.map_err(|e| miette!("Valid clang-17 installation not found in path: {e}"))?;
let clang_version = run_fun!("clang-18" "--version")
.map_err(|e| miette!("Valid clang-18 installation not found in path: {e}"))?;
debug!(target: "clang", "clang version: {}", clang_version);

let lib_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("target/debug/deps");
Expand Down

0 comments on commit 168c553

Please sign in to comment.