From 747b75ddec3eae052a7b4df1e5d19c75c0f277f8 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Sat, 23 Dec 2017 12:41:27 -0500 Subject: [PATCH] add Compat.Sys.BINDIR (#433) * add Compat.Sys.BINDIR * import Sys.BINDIR into Compat.Sys on v0.7 and add tests --- README.md | 3 +++ src/Compat.jl | 6 ++++++ test/runtests.jl | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 1a6108424..c491841e1 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,8 @@ Currently, the `@compat` macro supports the following syntaxes: * `Complex32`, `Complex64`, and `Complex128` are now `ComplexF16`, `ComplexF32`, and `ComplexF64`, respectively ([#24647]). +* `JULIA_HOME` is now `Sys.BINDIR`, available in the `Compat.Sys` submodule. ([#25102]) + * `Associative` is now `AbstractDict` ([#25012]). * `indices` is now `axes` ([#25057]). @@ -416,4 +418,5 @@ includes this fix. Find the minimum version from there. [#25021]: https://github.com/JuliaLang/julia/issues/25021 [#25056]: https://github.com/JuliaLang/julia/issues/25056 [#25057]: https://github.com/JuliaLang/julia/issues/25057 +[#25102]: https://github.com/JuliaLang/julia/issues/25102 [#25162]: https://github.com/JuliaLang/julia/issues/25162 diff --git a/src/Compat.jl b/src/Compat.jl index e60ad9c36..e0fcd68f5 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -584,6 +584,12 @@ module Sys else import Base.Sys: isapple, isbsd, islinux, isunix, iswindows end + + @static if VERSION < v"0.7.0-DEV.3073" + const BINDIR = JULIA_HOME + else + const BINDIR = Base.Sys.BINDIR + end end @static if VERSION < v"0.7.0-DEV.892" diff --git a/test/runtests.jl b/test/runtests.jl index b67f2785f..70a2ebcf8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1020,6 +1020,13 @@ end @test ComplexF32 === Complex{Float32} @test ComplexF64 === Complex{Float64} +# 0.7.0-DEV.3073 +if VERSION < v"0.7.0-DEV.3073" + @test Compat.Sys.BINDIR == JULIA_HOME +else + @test Compat.Sys.BINDIR == Sys.BINDIR +end + # 0.7.0-DEV.2915 module Test25021 using Compat