-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define exports to throw informative error in Julia DEV versions
- Loading branch information
1 parent
9ed5b27
commit df7a15c
Showing
3 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Empty stubs for the exported functions/macros of JET.jl, to provide a more informative | ||
# error message when JET.jl is used with a pre-release version of Julia. | ||
|
||
const err_msg = strip(""" | ||
JET.jl does not guarantee compatibility with pre-release versions of Julia and | ||
is not be loaded on this versions by default. | ||
Julia VERSION = $VERSION | ||
We recommend using a stable version of Julia in order to use JET.jl. | ||
Or to try JET with this pre-release Julia version use Preferences.jl to enable | ||
`JET_DEV_MODE`, and then reload JET. For example create a file named | ||
`LocalPreferences.toml` which contains the line: | ||
JET_DEV_MODE = true | ||
Note that JET.jl may not function properly with a pre-release versions of Julia | ||
even with `JET_DEV_MODE` enabled. | ||
""") | ||
|
||
for exported_func in ( | ||
:report_call, :test_call, | ||
:report_file, :test_file, :report_package, :test_package, :report_text, :reportkey, :test_text, | ||
:watch_file, | ||
# optanalyzer | ||
:report_opt, :test_opt, | ||
# configurations | ||
:LastFrameModule, :AnyFrameModule | ||
) | ||
@eval $exported_func(args...; kws...) = error($err_msg) | ||
end | ||
for exported_macro in ( | ||
:report_call, :test_call, | ||
:report_opt, :test_opt | ||
) | ||
@eval begin | ||
macro $exported_macro(args...) | ||
error($err_msg) | ||
end | ||
end | ||
end |