fix: compile a Cargo-less main.rs in ojt with edition 2024 and --cfg atcoder - #16
Merged
Merged
Conversation
…atcoder rustc without --edition used edition 2015, and --cfg atcoder only lives in cargo's config, so a single main.rs was built differently from AtCoder. Closes #15 Co-Authored-By: Claude Code <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ojtbuilt amain.rswithoutCargo.tomlwithrustc -O main.rs, which differs from AtCoder in two ways:--edition, so edition 2015 instead of AtCoder's 2024--cfg atcoder, because it only lives in cargo's$CARGO_HOME/config.tomlIt now runs
rustc --edition 2024 -O --cfg atcoder main.rs. The README line describing this fallback is updated too. TheCargo.tomlpath (cargo build --release) is unchanged.Closes #15
Test
In
ghcr.io/carbon-nil/atcoder-docker:latest-light(4.1.0), with the fixedbin/ojtmounted over/usr/local/bin/ojt, ranojton themain.rsfrom the issue (let chains plus#[cfg(atcoder)]), expectingatcoder 1:error[E0658]: let expressions in this position are unstablecfg(atcoder)are in effectCI build of both targets on amd64 and arm64: https://github.com/carbon-nil/atcoder-docker/actions/runs/35985309500
🤖 Generated with Claude Code
https://claude.ai/code/session_01VQaZJRoT1k7VZ8ThsuLdFa