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

Unify the method name to get library versions #23323

Merged
merged 4 commits into from
Aug 24, 2017

Conversation

musm
Copy link
Contributor

@musm musm commented Aug 18, 2017

addresses #23314

@musm musm force-pushed the ver branch 2 times, most recently from 6046cae to 1387ea9 Compare August 18, 2017 18:20
NEWS.md Outdated
@@ -312,6 +312,10 @@ Deprecated or removed
* `Base.cpad` has been removed; use an appropriate combination of `rpad` and `lpad`
instead ([#23187]).

* `GMP.gmp_version()` and `GMP.GMP_VERSION` have been renamed to `GMP.version()` and
`GMP.VERSION`, respectively. Similarly, `MPFR.get_version()`,
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps nix the comma following MPFR.get_version()?

@@ -26,7 +26,7 @@ function version()
minor = Ref{Cint}(0)
patch = Ref{Cint}(0)
ccall((:git_libgit2_version, :libgit2), Void,
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), major, minor, patch)
(Ref{Cint}, Ref{Cint}, Ref{Cint}), major, minor, patch)
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated? Perhaps better in a separate pull request as such?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps, but since this is related to version might as well just do it here. THis is in any case a very trivial change.

Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

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

lgtm modulo the minor comments! :)

@musm
Copy link
Contributor Author

musm commented Aug 18, 2017

@Sacha0 thanks for the review!

base/gmp.jl Outdated
gmp_bits_per_limb() = Int(unsafe_load(cglobal((:__gmp_bits_per_limb, :libgmp), Cint)))

const GMP_VERSION = gmp_version()
const VERSION = version()
const GMP_BITS_PER_LIMB = gmp_bits_per_limb()
Copy link
Contributor

@tkelman tkelman Aug 19, 2017

Choose a reason for hiding this comment

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

seems like the GMP_ and gmp_ prefixes are also a bit redundant with the module name here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should those be done in the same PR? Will they also need a deprecation?

Copy link
Member

Choose a reason for hiding this comment

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

Should those be done in the same PR?

Sure, why not? :)

Will they also need a deprecation?

Sure, why not? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@musm musm force-pushed the ver branch 3 times, most recently from fba7f29 to 0853a07 Compare August 21, 2017 21:53
@@ -1701,6 +1701,12 @@ export hex2num
# issue #17886
# deprecations for filter[!] with 2-arg functions are in associative.jl

@eval GMP @deprecate gmp_version() version()
Copy link
Member

Choose a reason for hiding this comment

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

I think all of these should have a false at the end, since none of them are currently exported?

Copy link
Contributor Author

@musm musm Aug 22, 2017

Choose a reason for hiding this comment

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

True (although they don't seem to be exported, but better be safe )

@musm
Copy link
Contributor Author

musm commented Aug 22, 2017

unrelated libgit2 error on macos

@musm
Copy link
Contributor Author

musm commented Aug 22, 2017

Nice more conflicts to rebase ... :P

@@ -1696,14 +1696,6 @@ export hex2num
@deprecate ctranspose adjoint
@deprecate ctranspose! adjoint!

@deprecate convert(::Type{Vector{UInt8}}, s::AbstractString) Vector{UInt8}(s)
Copy link
Member

Choose a reason for hiding this comment

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

Rebase mistake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uggh, very strange. The online tool is kinda terrible

Copy link
Member

@StefanKarpinski StefanKarpinski left a comment

Choose a reason for hiding this comment

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

LGTM. It's probably a good idea to test the deprecations if you haven't already – they're easy to get wrong.

@musm
Copy link
Contributor Author

musm commented Aug 23, 2017

Updated with LAPACK as well.

I tested the deprecations and they work, but you only get the error once, which is weird. See below (this seems unrelated)
e.g.

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.1458 (2017-08-23 14:26 UTC)
 _/ |\__'_|_|_|\__'_|  |  ver/9e3931c (fork: 15 commits, 0 days)
|__/                   |  x86_64-linux-gnu

julia> Base.MPFR.get_version()
WARNING: get_version() is deprecated, use version() instead.
Stacktrace:
 [1] depwarn at ./deprecated.jl:68 [inlined]
 [2] get_version() at ./deprecated.jl:56
 [3] eval(::Module, ::Expr) at ./repl/REPL.jl:3
 [4] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./repl/REPL.jl:69
 [5] macro expansion at ./repl/REPL.jl:100 [inlined]
 [6] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:96
while loading no file, in expression starting on line 0
v"3.1.5+r11590"

julia> Base.GMP.gmp_version()
v"6.1.2"

julia> ^C

julia>
mus@mus-laptop:~/julia$ ./julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.1458 (2017-08-23 14:26 UTC)
 _/ |\__'_|_|_|\__'_|  |  ver/9e3931c (fork: 15 commits, 0 days)
|__/                   |  x86_64-linux-gnu

julia> Base.GMP.gmp_version()
WARNING: gmp_version() is deprecated, use version() instead.
Stacktrace:
 [1] depwarn at ./deprecated.jl:68 [inlined]
 [2] gmp_version() at ./deprecated.jl:56
 [3] eval(::Module, ::Expr) at ./repl/REPL.jl:3
 [4] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./repl/REPL.jl:69
 [5] macro expansion at ./repl/REPL.jl:100 [inlined]
 [6] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:96
while loading no file, in expression starting on line 0
v"6.1.2"

julia> Base.MPFR.get_version()
v"3.1.5+r11590"

@musm
Copy link
Contributor Author

musm commented Aug 24, 2017

Can we merge this now? Osx had a spawn failure before the rebasing. Thanks.

@StefanKarpinski StefanKarpinski merged commit 2406b6e into JuliaLang:master Aug 24, 2017
@musm musm deleted the ver branch August 24, 2017 23:09
@musm
Copy link
Contributor Author

musm commented Aug 24, 2017

Thanks!

@StefanKarpinski
Copy link
Member

No problem. Thanks for doing it!

@eval GMP @deprecate gmp_bits_per_limb() bits_per_limb() false
@eval GMP @Base.deprecate_binding GMP_BITS_PER_LIMB BITS_PER_LIMB false
@eval MPFR @deprecate get_version() version() false
@eval LinAlg.LAPACK @deprecate laver() version() false
Copy link
Contributor

Choose a reason for hiding this comment

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

to give the same behavior as the previous function this deprecation should return a tuple

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true (anyone mind fixing this? I don't have time to do it)

Copy link
Member

Choose a reason for hiding this comment

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

I think the best way to fix this is to leave laver as it was before this change and just add version since, generally, our LAPACK wrappers are pretty thin and don't add much Julia abstraction on top of LAPACK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants