Change to Rust 2024 edition and remove unsafe environment var mutation#1712
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1712 +/- ##
==========================================
+ Coverage 65.21% 66.28% +1.06%
==========================================
Files 44 44
Lines 8219 8476 +257
==========================================
+ Hits 5360 5618 +258
+ Misses 2859 2858 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
adamchalmers
approved these changes
Jul 7, 2026
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.
See each commit separately.
Environment variable mutation became unsafe in Rust 2024. Instead of using
serial_testto run everything single-threaded or hacking around it and praying that we use it safely, I decided to remove it.Some tests became unit tests (
colors.rs). Some tests didn't actually need the environment variables set (cmd_user.rs). Some tests could have their variables injected (context.rs). But presumably we may need this in the future since kcl_lib may try to read environment variables, so I madekcl_process.rsthat creates a child process where we can control its environment variables without mutating the current process's env.Hopefully, in the future, we can remove
serial_test. It's still used in a lot of places, but I didn't want to expand scope more.