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

Commit

Permalink
Merge pull request #349 from Xanewok/rustflags-rebuild-fix
Browse files Browse the repository at this point in the history
Prevent aggressive project rebuilding by retaining RUSTFLAGS order
  • Loading branch information
nrc authored Jun 17, 2017
2 parents e53e2f8 + e7d3330 commit 9ca162f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use self::syntax::codemap::{FileLoader, RealFileLoader};

use config::Config;

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

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

while let Some(bit) = bits.next() {
Expand Down

0 comments on commit 9ca162f

Please sign in to comment.