Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 9ca162f

Browse files
authored
Merge pull request #349 from Xanewok/rustflags-rebuild-fix
Prevent aggressive project rebuilding by retaining RUSTFLAGS order
2 parents e53e2f8 + e7d3330 commit 9ca162f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use self::syntax::codemap::{FileLoader, RealFileLoader};
3434

3535
use config::Config;
3636

37-
use std::collections::HashMap;
37+
use std::collections::{HashMap, BTreeMap};
3838
use std::env;
3939
use std::ffi::OsString;
4040
use std::fs::{read_dir, remove_file};
@@ -759,7 +759,8 @@ fn dedup_flags(flag_str: &str) -> String {
759759
// values and dedup any duplicate keys, using the last value in flag_str.
760760
// This is a bit complicated because of the variety of ways args can be specified.
761761

762-
let mut flags = HashMap::new();
762+
// Retain flags order to prevent complete project rebuild due to RUSTFLAGS fingerprint change
763+
let mut flags = BTreeMap::new();
763764
let mut bits = flag_str.split_whitespace().peekable();
764765

765766
while let Some(bit) = bits.next() {

0 commit comments

Comments
 (0)