Skip to content
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

Make #[path] always relative to the current directory #55560

Closed
wants to merge 4 commits into from

Conversation

cramertj
Copy link
Member

@cramertj cramertj commented Nov 1, 2018

Previously, #[path] would be relative to the current
directory plus an offset for any inline modules.
However, it did not respect the module offset based
on a non-"mod.rs" filename unless there was also
a nested module.

After this commit, #[path] ignores inline modules
and is only ever relative to the current directory.
This means that the old #[path = ...] mod x { ... }
(#[path] applied to inline modules) no longer has
any effect.

This is a [breaking change]. Opening to see what a crater run says.

r? @petrochenkov

Previously, #[path] would be relative to the current
directory plus an offset for any inline modules.
However, it did not respect the module offset based
on a non-"mod.rs" filename unless there was *also*
a nested module.

After this commit, #[path] ignores inline modules
and is only ever relative to the current directory.
This means that the old #[path = ...] mod x { ... }
(#[path] applied to inline modules) no longer has
any effect.
@cramertj
Copy link
Member Author

cramertj commented Nov 1, 2018

One option would be to continue to respect #[path = ...] mod x { ... } only in the case of nested mod ..;s (no path), but the implementation of that is slightly messier, so I've left it out in this initial step-- a crater will hopefully help inform whether it's possible / necessary.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0685b244:start=1541034754843401901,finish=1541034755959917994,duration=1116516093
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
travis_time:end:00a16db4:start=1541034765536428720,finish=1541034765545123924,duration=8695204
travis_fold:end:before_script.2
travis_time:start:0b3783a0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Nov  1 01:12:45 UTC 2018
Thu, 01 Nov 2018 01:12:45 GMT

The command "date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
" exited with 0.
travis_time:start:30846e01
---
[00:47:38] .................................................................................................... 100/4983
[00:47:41] .................................................................................................... 200/4983
[00:47:44] ...........................................................................................ii....... 300/4983
[00:47:47] ..........................................................................................iii....... 400/4983
[00:47:49] iiiiiiii.iii...........................iii...........................................i...........i.. 500/4983
[00:47:56] .................................................................................................... 700/4983
[00:48:02] ..................................................................i...........i..................... 800/4983
[00:48:05] ....................................................................................iiiii........... 900/4983
[00:48:08] .................................................................................................... 1000/4983
---
[00:48:43] .................................................................................................... 2200/4983
[00:48:47] .................................................................................................... 2300/4983
[00:48:50] .................................................................................................... 2400/4983
[00:48:54] .................................................................................................... 2500/4983
[00:48:57] ...................................................................iiiiiiiii........................ 2600/4983
[00:49:04] ..................ii................................................................................ 2800/4983
[00:49:06] .................................................................................................... 2900/4983
[00:49:10] .................................................................................................... 3000/4983
[00:49:13] .............i...................................................................................... 3100/4983
---
[00:52:36] .................................................................................................... 1500/2873
[00:52:47] ..........................................i......................................................... 1600/2873
[00:53:02] .................................................................................................... 1700/2873
[00:53:12] .................................................................................................... 1800/2873
[00:53:21] .............................................................F.FFF..i............................... 1900/2873
[00:53:53] .................................................................................................... 2100/2873
[00:53:59] .................................................................................................... 2200/2873
[00:54:15] ii.....................................................................i....i....................... 2300/2873
[00:54:28] ..............i..................................................................................... 2400/2873
[00:54:28] ..............i..................................................................................... 2400/2873
[00:54:41] .................................................................................................... 2500/2873
[00:55:04] .................................................................................................... 2600/2873
[00:55:13] .................................................................................................... 2700/2873
[00:55:22] .................................................................................................... 2800/2873
tion failed although it shouldn't!
[00:55:31] status: exit code: 1
[00:55:31] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/modules/mod_dir_path2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/modules/mod_dir_path2/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/modules/mod_dir_path2/auxiliary"
[00:55:31] ------------------------------------------
[00:55:31] 
[00:55:31] ------------------------------------------
[00:55:31] stderr:
[00:55:31] stderr:
[00:55:31] ------------------------------------------
[00:55:31] {"message":"couldn't read /checkout/src/test/run-pass/modules/test.rs: No such file or directory (os error 2)","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass/modules/mod_dir_path2.rs","byte_start":593,"byte_end":598,"line_start":17,"line_end":17,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    pub mod syrup;","highlight_start":13,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: couldn't read /checkout/src/test/run-pass/modules/test.rs: No such file or directory (os error 2)\n  --> /checkout/src/test/run-pass/modules/mod_dir_path2.rs:17:13\n   |\nLL |     pub mod syrup;\n   |             ^^^^^\n\n"}
[00:55:31] {"message":"aborting due to previous erro file corresponding to the module exists. If you\nwant to use a module named `file_that_doesnt_exist`, you need to have a file\nnamed `file_that_doesnt_exist.rs` or `file_that_doesnt_exist/mod.rs` in the\nsame directory.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass/modules/mod_dir_path_multi.rs","byte_start":569,"byte_end":573,"line_start":16,"line_end":16,"column_start":13,"column_end":17,"is_primary":true,"text":[{"text":"    pub mod test;","highlight_start":13,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"name the file either biscuits/test.rs or biscuits/test/mod.rs inside the directory \"/checkout/src/test/run-pass/modules\"","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0583]: file not found for module `test`\n  --> /checkout/src/test/run-pass/modules/mod_dir_path_multi.rs:16:13\n   |\nLL |     pub mod test;\n   |             ^^^^\n   |\n   = help: name the file either biscuits/test.rs or biscuits/test/mod.rs inside the directory \"/checkout/src/test/run-pass/modules\"\n\n"}
[00:55:31] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:55:31] {"message":"For more information about this error, try `rustc --explain E0583`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0583`.\n"}
[00:55:31] ------------------------------------------
[00:55:31] 
[00:55:31] thread '[run-pass] run-pass/modules/mod_dir_path_multi.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3284:9
[00:55:31] 
[00:55:31] 
[00:55:31] ---- [run-pass] run-pass/modules/mod_dir_path3.rs stdout ----
[00:55:31] 
[00:55:31] error: test compilation failed although it shouldn't!
[00:55:31] status: exit code: 1
[00:55:31] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/modules/mod_dir_path3.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/modules/mod_dir_path3/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/modules/mod_dir_path3/auxiliary"
[00:55:31] ------------------------------------------
[00:55:31] 
[00:55:31] ------------------------------------------
[00:55:31] stderr:
[00:55:31] stderr:
[00:55:31] ------------------------------------------
[00:55:31] {"message":"file not found for module `test`","code":{"code":"E0583","explanation":"\nA file wasn't found for an out-of-line module.\n\nErroneous code example:\n\n```ignore (compile_fail not working here; see Issue #43707)\nmod file_that_doesnt_exist; // error: file not found for module\n\nfn main() {}\n```\n\nPlease be sure that a file corresponding to the module exists. If you\nwant to use a module named `file_that_doesnt_exist`, you need to have a file\nnamed `file_that_doesnt_exist.rs` or `file_that_doesnt_exist/mod.rs` in the\nsame directory.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass/modules/mod_dir_path3.rs","byte_start":569,"byte_end":573,"line_start":16,"line_end":16,"column_start":13,"column_end":17,"is_primary":true,"text":[{"text":"    pub mod test;","highlight_start":13,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"name the file either pancakes/test.rs or pancakes/test/mod.rs inside the directory \"/checkout/src/test/run-pass/modules\"","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0583]: file not found for module `test`\n  --> /checkout/src/test/run-pass/modules/mod_dir_path3.rs:16:13\n   |\nLL |     pub mod test;\n   |             ^^^^\n   |\n   = help: name the file either pancakes/test.rs or pancakes/test/mod.rs inside the directory \"/checkout/src/test/run-pass/modules\"\n\n"}
[00:55:31] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:55:31] {"message":"For more information about this error, try `rustc --explain E0583`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0583`.\n"}
[00:55:31] ------------------------------------------
[00:55:31] 
[00:55:31] thread '[run-pass] run-pass/modules/mod_dir_path3.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3284:9
[00:55:31] 
---

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2ca4b150
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Nov  1 02:08:17 UTC 2018
Thu, 01 Nov 2018 02:08:17 GMT

The command "date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
" exited with 0.
travis_fold:start:after_failure.1

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrochenkov petrochenkov self-assigned this Nov 1, 2018
@petrochenkov
Copy link
Contributor

petrochenkov commented Nov 1, 2018

After this commit, #[path] ignores inline modules and is only ever relative to the current directory.

Wait, this seems inconsistent with the previous PR (#55192) and is opposite to what I thought you was going to do (so the test change in conditional-compilation/cfg_attr_path.rs looks like a regression to me).

In my mental model

mod x {
    mod y;
}

is a sugar for

mod x {
    #[path = "y.rs"] // or #[path = "y/mod.rs"]
    mod y;
}

and mod y is fetched from x/y.rs (or x/y/mod.rs).
This means #[path] should be relative to inline modules.

@petrochenkov
Copy link
Contributor

petrochenkov commented Nov 1, 2018

The reason nobody understands the rules is because there are too many cases that are all treated separately.
Specifying everything in terms of #[path] and treating path-less mod non_inline; as sugar halves the number of cases to consider/remember.

@petrochenkov
Copy link
Contributor

@cramertj
I think you have necessary rights to run bors try and crater yourself once Travis is green.

@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 1, 2018
@cramertj
Copy link
Member Author

cramertj commented Nov 1, 2018

@petrochenkov

the test change in conditional-compilation/cfg_attr_path.rs looks like a regression to me

Yes, this is intentional-- it's the sort of regression I was hoping to look for in a crater run.

This means #[path] should be relative to inline modules.

IMO if #[path] is relative to inline modules, it should also be relative to the current non-mod.rs filename. This would be consistent with the behavior of mod x; includes, which offset themselves by the current module/filename if in a non-mod.rs file. However, this would be a breaking change to every use of #[path] in non-mod.rs files, which I don't think we can get away with. Instead, I was hoping we could make #[path] always relative to the current directory, completely ignoring the module hierarchy and the current file/module name.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:11d060b8:start=1541098919376356869,finish=1541098973621546274,duration=54245189405
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:49:22] .................................................................................................... 100/4983
[00:49:25] .................................................................................................... 200/4983
[00:49:28] ...........................................................................................ii....... 300/4983
[00:49:31] .........................................................................................iii........ 400/4983
[00:49:33] iiiiiiii.iii...........................iii...........................................i...........i.. 500/4983
[00:49:40] .................................................................................................... 700/4983
[00:49:46] ..................................................................i...........i..................... 800/4983
[00:49:49] ....................................................................................iiiii........... 900/4983
[00:49:53] .................................................................................................... 1000/4983
---
[00:50:28] .................................................................................................... 2200/4983
[00:50:32] .................................................................................................... 2300/4983
[00:50:36] .................................................................................................... 2400/4983
[00:50:40] .................................................................................................... 2500/4983
[00:50:43] ...................................................................iiiiiiiii........................ 2600/4983
[00:50:50] ..................ii................................................................................ 2800/4983
[00:50:53] .................................................................................................... 2900/4983
[00:50:57] .................................................................................................... 3000/4983
[00:50:59] .............i...................................................................................... 3100/4983
---
[00:54:25] .................................................................................................... 1500/2873
[00:54:37] ..........................................i......................................................... 1600/2873
[00:54:52] .................................................................................................... 1700/2873
[00:55:03] .................................................................................................... 1800/2873
[00:55:12] ..............................................................F.....i............................... 1900/2873
[00:55:45] .................................................................................................... 2100/2873
[00:55:52] .................................................................................................... 2200/2873
[00:56:08] ii.....................................................................i....i....................... 2300/2873
[00:56:22] ..............i..................................................................................... 2400/2873
---
[00:57:27] failures:
[00:57:27] 
[00:57:27] ---- [run-pass] run-pass/modules/mod_dir_path.rs stdout ----
[00:57:27] 
[00:57:27] error: test compilation failed although it shouldn't!
[00:57:27] status: exit code: 1
[00:57:27] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/modules/mod_dir_path.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/modules/mod_dir_path/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/modules/mod_dir_path/auxiliary"
[00:57:27] ------------------------------------------
[00:57:27] 
[00:57:27] ------------------------------------------
[00:57:27] stderr:
[00:57:27] stderr:
[00:57:27] ------------------------------------------
[00:57:27] {"message":"couldn't read /checkout/src/test/run-pass/modules/bar/auxiliary/two_macros_2.rs: No such file or directory (os error 2)","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass/modules/mod_dir_path.rs","byte_start":895,"byte_end":907,"line_start":31,"line_end":31,"column_start":17,"column_end":29,"is_primary":true,"text":[{"text":"            mod two_macros_2;","highlight_start":17,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/run-pass/modules/mod_dir_path.rs","byte_start":929,"byte_end":934,"line_start":33,"line_end":33,"column_start":9,"column_end":14,"is_primary":false,"text":[{"text":"        m!();","highlight_start":9,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"m!","def_site_span":{"file_name":"/checkout/src/test/run-pass/modules/mod_dir_path.rs","byte_start":804,"byte_end":920,"line_start":29,"line_end":32,"column_start":9,"column_end":12,"is_primary":false,"text":[{"text":"        macro_rules! m { () => {","highlight_start":9,"highlight_end":33},{"text":"            #[path = \"auxiliary/two_macros_2.rs\"]","highlight_start":1,"highlight_end":50},{"text":"            mod two_macros_2;","highlight_start":1,"highlight_end":30},{"text":"        } }","highlight_start":1,"highlight_enunknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-pass" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:57:27] 
[00:57:27] 
[00:57:27] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:57:27] Build completed unsuccessfully in 0:11:45
[00:57:27] Build completed unsuccessfully in 0:11:45
[00:57:27] make: *** [check] Error 1
[00:57:27] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:04f59590
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:249c3fa8:start=1541102432305113462,finish=1541102432309480727,duration=4367265
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:04365852
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0e6e0e9a
travis_time:start:0e6e0e9a
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0fc7c56c
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrochenkov
Copy link
Contributor

petrochenkov commented Nov 2, 2018

IMO if #[path] is relative to inline modules, it should also be relative to the current non-mod.rs filename. This would be consistent with the behavior of mod x; includes, which offset themselves by the current module/filename if in a non-mod.rs file.

That's what I'd expect as well.

However, this would be a breaking change to every use of #[path] in non-mod.rs files, which I don't think we can get away with.

That's why I wanted to keep whatever rules exist now and wait for Rust 2021 :)
(Especially if crater shows breakage for this PR.)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:2e48a43c:start=1541208928548874891,finish=1541208981828382970,duration=53279508079
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@cramertj
Copy link
Member Author

cramertj commented Nov 6, 2018

@bors try
(for crater.)

@bors
Copy link
Contributor

bors commented Nov 6, 2018

⌛ Trying commit 561642c with merge 3af441b...

bors added a commit that referenced this pull request Nov 6, 2018
Make #[path] always relative to the current directory

Previously, #[path] would be relative to the current
directory plus an offset for any inline modules.
However, it did not respect the module offset based
on a non-"mod.rs" filename unless there was *also*
a nested module.

After this commit, #[path] ignores inline modules
and is only ever relative to the current directory.
This means that the old #[path = ...] mod x { ... }
(#[path] applied to inline modules) no longer has
any effect.

This is a [breaking change]. Opening to see what a crater run says.

r? @petrochenkov
@bors
Copy link
Contributor

bors commented Nov 6, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

The job dist-x86_64-linux of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_fold:end:services

travis_fold:start:git.checkout
travis_time:start:00ddc430
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[01:47:52]    Compiling quote v0.6.8
[01:47:53]    Compiling idna v0.1.5
[01:48:11]    Compiling thread_local v0.3.6
[01:48:16]    Compiling syn v0.14.9
[01:48:16] error: couldn't read /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/syn-0.14.9/src/../gen_helper.rs: No such file or directory (os error 2)
[01:48:16]     |
[01:48:16] 566 |     mod helper;
[01:48:16]     |         ^^^^^^
[01:48:16] 
---
travis_time:end:37532890:start=1541531926250872066,finish=1541531926268339518,duration=17467452
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:02c05ff4
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0299e6a1
travis_time:start:0299e6a1
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0864ae90
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@cramertj
Copy link
Member Author

cramertj commented Nov 6, 2018

The try build failed because syn uses #[path] includes inside of nested modules, so this change is probably dead in the water. The only reason syn wasn't broken by the previous change is that it happens to be in a lib.rs file (lib.rs/mod.rs/main.rs were unbroken by the previous change).

@cramertj
Copy link
Member Author

Closing this as non-viable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants