sambitdash / PDFIO.jl

PDF Reader Library for Native Julia.
Other
127 stars 13 forks source link

OpenSSL warning upon `using PDFIO` #91

Closed jakewilliami closed 3 years ago

jakewilliami commented 4 years ago

I notice #73 adds the library OpenSSL. However, after updating from v0.1.7 to v0.1.9, I get this message every time I import PDFIO:

julia> using PDFIO
[ Info: Precompiling PDFIO [4d0d745f-9d9a-592e-8d18-1ad8a0f42b92]
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
   Updating `~/.julia/environments/v1.4/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.4/Manifest.toml`
 [no changes]
┌ Warning: Package PDFIO does not have OpenSSL_jll in its dependencies:
│ - If you have PDFIO checked out for development and have
│   added OpenSSL_jll as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with PDFIO
└ Loading OpenSSL_jll into PDFIO from project dependency, future warnings for PDFIO are suppressed.
  Resolving package versions...
   Updating `~/.julia/environments/v1.4/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.4/Manifest.toml`
 [no changes]

I've never seen this message printed (except for the precompiling bit) when using using.

sambitdash commented 4 years ago

This is behavior is expected as the package dependency of zlib precompiled files are created for Julia 1.3+ and pre 1.3 builds the deps/build.jl files are used.

https://github.com/sambitdash/PDFIO.jl/blob/f8c990eb6caf6019570e6179235dcffc76ffee35/src/Inflate.jl#L48

Modifying this behavior will make the package unsupported for Julia 1.0 version which is an LTS version for Julia and thus make the package unusable for those users. Removing support for Julia 1.0 and making minimum required version to Julia 1.3 will fix the problem.

sambitdash commented 4 years ago

The same applies for OpenSSL as well. The warning is typically reported once.

https://github.com/sambitdash/PDFIO.jl/blob/f8c990eb6caf6019570e6179235dcffc76ffee35/src/LibCrypto.jl#L1

jakewilliami commented 4 years ago

This warning is reported every time I use PDFIO. I will add the above into the LibCrypto.jl file. Do you know where this is found? It does not seem to be in ~/.julia/packages/PDFIO/ or ~/.julia/compiled/PDFIO/.

sambitdash commented 4 years ago

The above is added to PDFIO already. And only reported when the PDFIO has to be compiled. The packages are stored in the ~/.julia/packages/PDFIO/ folder. But for editing the package you will need to checkout the PDFIO in the dev mode. Please look into package management of Julia to understand those.

The simplest will be ]add OpenSSL_jll before you call using PDFIO.

jakewilliami commented 4 years ago

Do I need to Pkg.add("OpenSSL_jll") before using PDFIO every time to suppress this warning? Because I have added OpenSSL_jll but the warning keeps showing up.

sambitdash commented 4 years ago

There is no functionality loss due to this issue and there is just a mere annoyance. So there is no urgency on fixing this.

aviks commented 3 years ago

@sambitdash why don't you just add Zlib_jll and OpenSSL_jll to this project's Project.toml. JLL packages are safe to install even with Julia 1.0 .. they are a no-op when installing on older versions of Julia. In general, installing packages at runtime is not a great idea.

Ideally, I'd just support Julia 1.3 and above in this package, but of course you may have your reasons to support 1.0 and up.

sambitdash commented 3 years ago

Thanks @aviks. https://github.com/sambitdash/PDFIO.jl/commit/57e2c068e009c163c119f39b28a22787cd78b85f should fix this now.