-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Include (potentially remapped) working dir in crate hash #87990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a895069
179fd38
fd15c18
1ac7881
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ use rustc_target::spec::{RelocModel, RelroLevel, SplitDebuginfo, TargetTriple, T | |
|
||
use rustc_feature::UnstableFeatures; | ||
use rustc_span::edition::Edition; | ||
use rustc_span::RealFileName; | ||
use rustc_span::SourceFileHashAlgorithm; | ||
|
||
use std::collections::BTreeMap; | ||
|
@@ -203,6 +204,9 @@ top_level_options!( | |
json_unused_externs: bool [UNTRACKED], | ||
|
||
pretty: Option<PpMode> [UNTRACKED], | ||
|
||
/// The (potentially remapped) working directory | ||
working_dir: RealFileName [TRACKED], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will result in a different hash for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so - this field is initialized using the remapped working directory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
#[derive(HashStable_Generic)]
enum RealFileName {
LocalPath(PathBuf),
Remapped {
local_path: Option<PathBuf>,
virtual_name: PathBuf,
},
} while the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's incorrect - I'm using It looks like the |
||
} | ||
); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
include ../../run-make-fulldeps/tools.mk | ||
|
||
INCR=$(TMPDIR)/incr | ||
FIRST_SRC=$(TMPDIR)/first_src | ||
SECOND_SRC=$(TMPDIR)/second_src | ||
|
||
# ignore-none no-std is not supported | ||
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std' | ||
|
||
# Tests that we don't get an ICE when the working directory | ||
# (but not the build directory!) changes between compilation | ||
# sessions | ||
|
||
all: | ||
mkdir $(INCR) | ||
# Build from 'FIRST_SRC' | ||
mkdir $(FIRST_SRC) | ||
cp my_lib.rs $(FIRST_SRC)/my_lib.rs | ||
cp main.rs $(FIRST_SRC)/main.rs | ||
cd $(FIRST_SRC) && \ | ||
$(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \ | ||
$(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET) | ||
# Build from 'SECOND_SRC', keeping the output directory and incremental directory | ||
# the same | ||
mv $(FIRST_SRC) $(SECOND_SRC) | ||
cd $(SECOND_SRC) && \ | ||
$(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \ | ||
$(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
extern crate my_lib; | ||
|
||
fn main() { | ||
my_lib::my_fn("hi"); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub fn my_fn<T: Copy>(_val: T) {} |
Uh oh!
There was an error while loading. Please reload this page.