|
960 | 960 | # require always works in Main scope and loads files from node 1 |
961 | 961 | const toplevel_load = Ref(true) |
962 | 962 |
|
963 | | -const full_warning_showed = Ref(false) |
964 | | -const modules_warned_for = Set{PkgId}() |
965 | | - |
966 | 963 | """ |
967 | 964 | require(into::Module, module::Symbol) |
968 | 965 |
|
@@ -1008,28 +1005,14 @@ function require(into::Module, mod::Symbol) |
1008 | 1005 | Package $mod not found in current path$hint_message. |
1009 | 1006 | - $start_sentence `import Pkg; Pkg.add($(repr(String(mod))))` to install the $mod package.""")) |
1010 | 1007 | else |
1011 | | - s = """ |
| 1008 | + throw(ArgumentError(""" |
1012 | 1009 | Package $(where.name) does not have $mod in its dependencies: |
1013 | 1010 | - You may have a partially installed environment. Try `Pkg.instantiate()` |
1014 | 1011 | to ensure all packages in the environment are installed. |
1015 | 1012 | - Or, if you have $(where.name) checked out for development and have |
1016 | 1013 | added $mod as a dependency but haven't updated your primary |
1017 | 1014 | environment's manifest file, try `Pkg.resolve()`. |
1018 | | - - Otherwise you may need to report an issue with $(where.name)""" |
1019 | | - |
1020 | | - uuidkey = identify_package(PkgId(string(into)), String(mod)) |
1021 | | - uuidkey === nothing && throw(ArgumentError(s)) |
1022 | | - |
1023 | | - # fall back to toplevel loading with a warning |
1024 | | - if !(where in modules_warned_for) |
1025 | | - @warn string( |
1026 | | - full_warning_showed[] ? "" : s, "\n", |
1027 | | - string("Loading $(mod) into $(where.name) from project dependency, ", |
1028 | | - "future warnings for $(where.name) are suppressed.") |
1029 | | - ) _module = nothing _file = nothing _group = nothing |
1030 | | - push!(modules_warned_for, where) |
1031 | | - end |
1032 | | - full_warning_showed[] = true |
| 1015 | + - Otherwise you may need to report an issue with $(where.name)""")) |
1033 | 1016 | end |
1034 | 1017 | end |
1035 | 1018 | if _track_dependencies[] |
|
0 commit comments