Skip to content

Commit cad5304

Browse files
authored
fix: DSL_SCHEMA_HASH should not changed by line endings (#25123)
1 parent 53eaf6c commit cad5304

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/polars-plan/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ fn main() {
2020
fn generate_schema_hash() {
2121
let hash_hexstr = {
2222
let mut digest = sha2::Sha256::new();
23+
// Read as UTF-8 text and normalize CRLF to LF to make hashing
24+
// invariant to Git EOL conversion on Windows.
25+
let content = include_str!("dsl-schema-hashes.json");
26+
let normalized = content.replace("\r\n", "\n");
2327
digest
24-
.write_all(include_bytes!("dsl-schema-hashes.json"))
28+
.write_all(normalized.as_bytes())
2529
.expect("failed to hash the schema hashes file");
2630
let hash = digest.finalize();
2731

0 commit comments

Comments
 (0)