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

Add Base internal function LIBEXECDIR #676

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Currently, the `@compat` macro supports the following syntaxes:

## Module Aliases

## New functions, macros, and methods
## New functions, macros, methods, and constants

* `only(x)` returns the one-and-only element of a collection `x` ([#33129]). (since Compat 2.2.0)

Expand All @@ -62,6 +62,8 @@ Currently, the `@compat` macro supports the following syntaxes:

* `merge` methods with one and `n` `NamedTuple`s ([#29259]). (since Compat 2.0.0)

* `Base.LIBEXECDIR` constant which emulates the relative directory of `libexec` path ([#33777]). (since Compat 2.3.0)

## Renaming

## New macros
Expand Down Expand Up @@ -111,3 +113,4 @@ Note that you should specify the correct minimum version for `Compat` in the
[#32628]: https://github.com/JuliaLang/julia/issues/32628
[#33129]: https://github.com/JuliaLang/julia/issues/33129
[#33568]: https://github.com/JuliaLang/julia/pull/33568
[#33777]: https://github.com/JuliaLang/julia/pull/33777
13 changes: 13 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ if VERSION < v"1.4.0-DEV.329"
Base.:∘(f, g, h...) = ∘(f ∘ g, h...)
end

# https://github.com/JuliaLang/julia/pull/33777
if v"1.4.0-DEV.172" <= VERSION < v"1.4.0-DEV.445"
libexecdir = Sys.iswindows() ? "..\\libexec" : "../libexec"
Copy link
Member

@martinholters martinholters Nov 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libexecdir = Sys.iswindows() ? "..\\libexec" : "../libexec"
libexecdir = joinpath("..", "libexec")

(same below)

@eval(Base, const LIBEXECDIR = $libexecdir)
elseif v"1.4" <= VERSION < v"1.4.0-DEV.172"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need also find the commit where this was moved, so this is not 100% correct in all cases.

@eval(Base, const LIBEXECDIR = "")
elseif v"1.3.0-rc3" <= VERSION <= v"1.3.0-rc5"
libexecdir = Sys.iswindows() ? "..\\libexec" : "../libexec"
@eval(Base, const LIBEXECDIR = $libexecdir)
elseif VERSION < v"1.3.0-rc3"
@eval(Base, const LIBEXECDIR = "")
end

include("deprecated.jl")

end # module Compat