Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a specialized C++-only Dockerfile (Dockerfile.cpp) for competitive programming on AtCoder, removing support for other languages (Python, Ruby, Node.js, Java, Erlang, Elixir, Rust) and optimizing the build using multi-stage compilation.
Key Changes:
- Multi-stage Docker build separating compilation (builder) from runtime environment
- Installation of 13 C++ libraries including GCC 15.2.0, Boost 1.88.0, and various competitive programming tools
- Custom
atcoder-compilescript with comprehensive compiler flags and library linking
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 10 out of 27 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.github/workflows/build-staged.yml
Outdated
| echo '#include <iostream> | ||
| int main() { std::cout << "Hello AtCoder" << std::endl; return 0; }' > /tmp/test.cpp |
There was a problem hiding this comment.
[nitpick] The C++ test code embedded in the shell script is missing proper indentation and formatting. Consider using a here-document with proper escaping for better readability and maintainability.
| echo '#include <iostream> | |
| int main() { std::cout << "Hello AtCoder" << std::endl; return 0; }' > /tmp/test.cpp | |
| cat << 'EOF' > /tmp/test.cpp | |
| #include <iostream> | |
| int main() { | |
| std::cout << "Hello AtCoder" << std::endl; | |
| return 0; | |
| } | |
| EOF |
- Create Dockerfile.cpp with comprehensive C++ libraries - Include GCC 15.2.0, Boost 1.88.0, LibTorch, OR-Tools, and more - Add build-cpp job to CI workflow - Support both amd64 and arm64 architectures - Trigger build with [build-cpp] tag in commit message Closes #18
27cdcce to
21e561e
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Dockerfile.cpp
Outdated
| /usr/share/eigen3/cmake/Eigen3Targets.cmake \ | ||
| /usr/share/eigen3/cmake/Eigen3Config.cmake \ | ||
| "$AC_INSTALL_DIR/cmake" && \ | ||
| CMAKE_PATH="${AC_INSTALL_DIR/'/opt/'/}/include" && \ |
There was a problem hiding this comment.
The string replacement pattern '/opt/' uses hardcoded path prefix that may not match AC_INSTALL_DIR. Consider using a more robust path manipulation or verify AC_INSTALL_DIR always starts with /opt/.
| CMAKE_PATH="${AC_INSTALL_DIR/'/opt/'/}/include" && \ | |
| CMAKE_PATH="${AC_INSTALL_DIR#/opt/}/include" && \ |
Replace bash string substitution with plain sed command to fix build error on CI.
6a3c581 to
280329e
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Download and install LibTorch 2.8.0 | ||
| ARG LIBTORCH_VERSION=2.8.0 | ||
| WORKDIR $AC_TEMP_DIR | ||
| RUN wget "https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip" -O libtorch.zip && \ |
There was a problem hiding this comment.
The wget command is missing the -q flag for quiet output, which is inconsistent with other download commands in this Dockerfile (lines 52, 85, 112, 121, 186, 214, 249, 281). Add -q flag for consistency and cleaner build logs.
| RUN wget "https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip" -O libtorch.zip && \ | |
| RUN wget -q "https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip" -O libtorch.zip && \ |
| # Build unordered_dense 4.5.0 | ||
| ARG UNORDERED_DENSE_VERSION=4.5.0 | ||
| WORKDIR $AC_TEMP_DIR | ||
| RUN wget "https://github.com/martinus/unordered_dense/archive/refs/tags/v$UNORDERED_DENSE_VERSION.tar.gz" -O unordered_dense.tar.gz && \ |
There was a problem hiding this comment.
The wget command is missing the -q flag for quiet output, which is inconsistent with other download commands in this Dockerfile. Add -q flag for consistency with lines 52, 85, 112, 121, 186, 214, 249, and 281.
| RUN wget "https://github.com/martinus/unordered_dense/archive/refs/tags/v$UNORDERED_DENSE_VERSION.tar.gz" -O unordered_dense.tar.gz && \ | |
| RUN wget -q "https://github.com/martinus/unordered_dense/archive/refs/tags/v$UNORDERED_DENSE_VERSION.tar.gz" -O unordered_dense.tar.gz && \ |
| # Stage 4: Summary and notification | ||
| build-summary: | ||
| needs: [determine-strategy, build-lite, build-full] | ||
| needs: [determine-strategy, build-lite, build-full, build-cpp] |
There was a problem hiding this comment.
The build-summary job unconditionally depends on build-cpp, but build-cpp only runs conditionally (when build_cpp == 'true'). This will cause the summary job to be skipped when C++ builds are not triggered. Use if: always() on individual jobs or make the dependency conditional.
| needs: [determine-strategy, build-lite, build-full, build-cpp] | |
| needs: [determine-strategy, build-lite, build-full] |
Summary
C++競技プログラミング専用の
Dockerfile.cppを作成しました。Changes
Dockerfile.cppを新規作成Included C++ Libraries
toml/config.tomlの設定に基づき、以下のライブラリを含めています:Usage
Resolves #18