generated from codecrafters-io/course-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
152 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
|
||
set -e # Exit on failure | ||
|
||
exec /tmp/codecrafters-build-interpreter-c "$@" | ||
exec ./build/redis "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(redis-starter-c) | ||
|
||
file(GLOB_RECURSE SOURCE_FILES app/*.c) | ||
|
||
set(CMAKE_C_STANDARD 23) # Enable the C23 standard | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
|
||
add_executable(redis ${SOURCE_FILES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default-registry": { | ||
"kind": "git", | ||
"baseline": "c4af3593e1f1aa9e14a560a09e45ea2cb0dfd74d", | ||
"repository": "https://github.com/microsoft/vcpkg" | ||
}, | ||
"registries": [ | ||
{ | ||
"kind": "artifact", | ||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", | ||
"name": "microsoft" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"dependencies": [ | ||
"asio", | ||
"pthreads" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# syntax=docker/dockerfile:1.7-labs | ||
FROM gcc:14.2.0-bookworm | ||
|
||
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="vcpkg.json,vcpkg-configuration.json" | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y zip=3.* && \ | ||
apt-get install --no-install-recommends -y g++=4:* && \ | ||
apt-get install --no-install-recommends -y build-essential=12.* && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# cmake 3.29.2 is required by vcpkg | ||
RUN wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-Linux-x86_64.tar.gz && \ | ||
tar -xzvf cmake-3.29.2-Linux-x86_64.tar.gz && \ | ||
mv cmake-3.29.2-linux-x86_64/ /cmake | ||
|
||
ENV CMAKE_BIN="/cmake/bin" | ||
ENV PATH="${CMAKE_BIN}:$PATH" | ||
|
||
RUN git clone https://github.com/microsoft/vcpkg.git && \ | ||
./vcpkg/bootstrap-vcpkg.sh -disableMetrics | ||
|
||
ENV VCPKG_ROOT="/vcpkg" | ||
ENV PATH="${VCPKG_ROOT}:$PATH" | ||
|
||
# Ensures the container is re-built if dependency files change | ||
# ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="<placeholder-dependency-files>" | ||
|
||
WORKDIR /app | ||
|
||
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses | ||
COPY --exclude=.git --exclude=README.md . /app | ||
|
||
RUN vcpkg install --no-print-usage | ||
RUN sed -i '1s/^/set(VCPKG_INSTALL_OPTIONS --no-print-usage)\n/' ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake | ||
|
||
RUN mkdir -p /app-cached/build | ||
RUN if [ -d "/app/build" ]; then mv /app/build /app-cached; fi | ||
RUN if [ -d "/app/vcpkg_installed" ]; then mv /app/vcpkg_installed /app-cached/build; fi | ||
|
||
# Install language-specific dependencies | ||
RUN .codecrafters/compile.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
|
||
set -e # Exit on failure | ||
|
||
exec /tmp/codecrafters-build-interpreter-c "$@" | ||
exec ./build/redis "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(redis-starter-c) | ||
|
||
file(GLOB_RECURSE SOURCE_FILES app/*.c) | ||
|
||
set(CMAKE_C_STANDARD 23) # Enable the C23 standard | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
|
||
add_executable(redis ${SOURCE_FILES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default-registry": { | ||
"kind": "git", | ||
"baseline": "c4af3593e1f1aa9e14a560a09e45ea2cb0dfd74d", | ||
"repository": "https://github.com/microsoft/vcpkg" | ||
}, | ||
"registries": [ | ||
{ | ||
"kind": "artifact", | ||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", | ||
"name": "microsoft" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"dependencies": [ | ||
"asio", | ||
"pthreads" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
|
||
set -e # Exit on failure | ||
|
||
exec /tmp/codecrafters-build-interpreter-c "$@" | ||
exec ./build/redis "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(redis-starter-c) | ||
|
||
file(GLOB_RECURSE SOURCE_FILES app/*.c) | ||
|
||
set(CMAKE_C_STANDARD 23) # Enable the C23 standard | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
|
||
add_executable(redis ${SOURCE_FILES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default-registry": { | ||
"kind": "git", | ||
"baseline": "c4af3593e1f1aa9e14a560a09e45ea2cb0dfd74d", | ||
"repository": "https://github.com/microsoft/vcpkg" | ||
}, | ||
"registries": [ | ||
{ | ||
"kind": "artifact", | ||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", | ||
"name": "microsoft" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"dependencies": [ | ||
"asio", | ||
"pthreads" | ||
] | ||
} |