From 75458d54252ed642647f9aee73a5b2c4b0fef9f5 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Mon, 18 Dec 2017 22:01:17 -0500 Subject: [PATCH 1/2] add Compat.Sys.BINDIR --- README.md | 3 +++ src/Compat.jl | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index c9bca82ec..b3a74130f 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,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]) + ## New macros * `@__DIR__` has been added ([#18380]) @@ -392,3 +394,4 @@ includes this fix. Find the minimum version from there. [#24652]: https://github.com/JuliaLang/julia/issues/24652 [#24657]: https://github.com/JuliaLang/julia/issues/24657 [#24785]: https://github.com/JuliaLang/julia/issues/24785 +[#25102]: https://github.com/JuliaLang/julia/issues/25102 diff --git a/src/Compat.jl b/src/Compat.jl index 676e196f8..9d1f1a7ab 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -584,6 +584,10 @@ 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 + end end @static if VERSION < v"0.7.0-DEV.892" From aac7ba2248daf51293c1b026e32c1c03fb59b54a Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Wed, 20 Dec 2017 16:45:14 -0500 Subject: [PATCH 2/2] import Sys.BINDIR into Compat.Sys on v0.7 and add tests --- src/Compat.jl | 2 ++ test/runtests.jl | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/Compat.jl b/src/Compat.jl index 9d1f1a7ab..fb197d725 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -587,6 +587,8 @@ module Sys @static if VERSION < v"0.7.0-DEV.3073" const BINDIR = JULIA_HOME + else + const BINDIR = Base.Sys.BINDIR end end diff --git a/test/runtests.jl b/test/runtests.jl index 05afe97e0..28f81756e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -985,6 +985,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 + if VERSION < v"0.6.0" include("deprecated.jl") end