Skip to content

Commit 2b679a0

Browse files
authored
Merge pull request #96 from codecrafters-io/upgrade-rust
Upgrade Rust
2 parents 6a53818 + a869ecb commit 2b679a0

File tree

20 files changed

+40
-72
lines changed

20 files changed

+40
-72
lines changed

compiled_starters/rust/.codecrafters/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
cargo build --release --target-dir=/tmp/codecrafters-grep-target --manifest-path Cargo.toml
11+
cargo build --release --target-dir=/tmp/codecrafters-build-grep-rust --manifest-path Cargo.toml

compiled_starters/rust/.codecrafters/run.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
#
77
# Learn more: https://codecrafters.io/program-interface
88

9-
set -e # Exit on failure
10-
11-
exec /tmp/codecrafters-grep-target/release/grep-starter-rust "$@"
9+
exec /tmp/codecrafters-build-grep-rust/release/codecrafters-grep "$@"

compiled_starters/rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiled_starters/rust/Cargo.toml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
1-
# DON'T EDIT THIS!
2-
#
3-
# Codecrafters relies on this file being intact to run tests successfully. Any changes
4-
# here will not reflect when CodeCrafters tests your code, and might even cause build
5-
# failures.
6-
#
7-
# DON'T EDIT THIS!
81
[package]
9-
name = "grep-starter-rust"
2+
name = "codecrafters-grep"
103
version = "0.1.0"
114
authors = ["Codecrafters <[email protected]>"]
125
edition = "2021"
6+
rust-version = "1.80"
137

14-
# DON'T EDIT THIS!
15-
#
16-
# Codecrafters relies on this file being intact to run tests successfully. Any changes
17-
# here will not reflect when CodeCrafters tests your code, and might even cause build
18-
# failures.
19-
#
20-
# DON'T EDIT THIS!
218
[dependencies]
229
anyhow = "1.0.68" # error handling
2310
bytes = "1.3.0" # helps manage buffers

compiled_starters/rust/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Time to move on to the next stage!
3232

3333
Note: This section is for stages 2 and beyond.
3434

35-
1. Ensure you have `cargo (1.62)` installed locally
35+
1. Ensure you have `cargo (1.80)` installed locally
3636
1. Run `./your_program.sh` to run your program, which is implemented in
3737
`src/main.rs`. This command compiles your Rust project, so it might be slow
3838
the first time you run it. Subsequent runs will be fast.

compiled_starters/rust/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Rust version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: rust-1.77
11-
language_pack: rust-1.77
10+
# Available versions: rust-1.80
11+
language_pack: rust-1.80

compiled_starters/rust/your_program.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ set -e # Exit early if any commands fail
1414
# - Edit .codecrafters/compile.sh to change how your program compiles remotely
1515
(
1616
cd "$(dirname "$0")" # Ensure compile steps are run within the repository directory
17-
cargo build --release --target-dir=/tmp/codecrafters-grep-target --manifest-path Cargo.toml
17+
cargo build --release --target-dir=/tmp/codecrafters-build-grep-rust --manifest-path Cargo.toml
1818
)
1919

2020
# Copied from .codecrafters/run.sh
2121
#
2222
# - Edit this to change how your program runs locally
2323
# - Edit .codecrafters/run.sh to change how your program runs remotely
24-
exec /tmp/codecrafters-grep-target/release/grep-starter-rust "$@"
24+
exec /tmp/codecrafters-build-grep-rust/release/codecrafters-grep "$@"

dockerfiles/rust-1.80.Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
FROM rust:1.80-bookworm
3+
4+
# Rebuild the container if these files change
5+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock"
6+
7+
WORKDIR /app
8+
9+
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
10+
COPY --exclude=.git --exclude=README.md . /app
11+
12+
# This runs cargo build
13+
RUN .codecrafters/compile.sh

solutions/rust/01-cq2/code/.codecrafters/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
cargo build --release --target-dir=/tmp/codecrafters-grep-target --manifest-path Cargo.toml
11+
cargo build --release --target-dir=/tmp/codecrafters-build-grep-rust --manifest-path Cargo.toml

solutions/rust/01-cq2/code/.codecrafters/run.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
#
77
# Learn more: https://codecrafters.io/program-interface
88

9-
set -e # Exit on failure
10-
11-
exec /tmp/codecrafters-grep-target/release/grep-starter-rust "$@"
9+
exec /tmp/codecrafters-build-grep-rust/release/codecrafters-grep "$@"

0 commit comments

Comments
 (0)