JuliaCrypto / Nettle.jl

Julia wrapper around nettle cryptographic hashing/encryption library providing MD5, SHA1, SHA2 hashing and HMAC functionality, as well as AES encryption/decryption

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nettle show ERRORS when using openSUSE

leocastel opened this issue · comments

I cannot build Nettle.jl!
Does any one know how to fix that?
Thanks in advance.

julia> Pkg.add("Atom")
INFO: Nothing to be done

julia> using Atom
INFO: Precompiling module Atom...
ERROR: LoadError: libnettle not properly installed. Please run Pkg.build("Nettle")
[inlined code] from none:2
in anonymous at no file:0
while loading /home/leo/.julia/v0.4/Nettle/src/Nettle.jl, in expression starting on line 10
ERROR: LoadError: Failed to precompile Nettle to /home/leo/.julia/lib/v0.4/Nettle.ji
in compilecache at loading.jl:400
[inlined code] from none:2
in anonymous at no file:0
while loading /home/leo/.julia/v0.4/WebSockets/src/WebSockets.jl, in expression starting on line 23
ERROR: LoadError: LoadError: Failed to precompile WebSockets to /home/leo/.julia/lib/v0.4/WebSockets.ji
in compilecache at loading.jl:400
[inlined code] from none:2
in anonymous at no file:0
while loading /home/leo/.julia/v0.4/Mux/src/websockets_integration.jl, in expression starting on line 1
while loading /home/leo/.julia/v0.4/Mux/src/Mux.jl, in expression starting on line 26
ERROR: LoadError: LoadError: Failed to precompile Mux to /home/leo/.julia/lib/v0.4/Mux.ji
in compilecache at loading.jl:400
[inlined code] from none:2
in anonymous at no file:0
while loading /home/leo/.julia/v0.4/Blink/src/content/content.jl, in expression starting on line 1
while loading /home/leo/.julia/v0.4/Blink/src/Blink.jl, in expression starting on line 8
ERROR: LoadError: Failed to precompile Blink to /home/leo/.julia/lib/v0.4/Blink.ji
in compilecache at loading.jl:400
[inlined code] from none:2
in anonymous at no file:0
while loading /home/leo/.julia/v0.4/Atom/src/Atom.jl, in expression starting on line 5
ERROR: Failed to precompile Atom to /home/leo/.julia/lib/v0.4/Atom.ji
in compilecache at loading.jl:400

julia> Pkg.build("Nettle")
INFO: Building Nettle
===============================[ ERROR: Nettle ]================================

LoadError: could not spawn apt-cache showpkg libnettle4: no such file or directory (ENOENT)
while loading /home/leo/.julia/v0.4/Nettle/deps/build.jl, in expression starting on line 39

=================================================================================================[ BUILD ERRORS ]=================================================================================================

WARNING: Nettle had build errors.

packages with build errors remain installed in /home/leo/.julia/v0.4
build the package(s) and all dependencies with Pkg.build("Nettle")
build a single package by running its deps/build.jl script

What build system does SUSe use? Is it apt-get based?

SUSE is RPM-based and the command apt-get is not the default in SUSE.
Usually the command zypper is used. I can install apt-get but not the command apt-cache showpkg, which should be replaced by zypper info.

What is the name of the libnettle package that you can install through zypper?

Ah, looks like it's just libnettle. I've added the necessary provider in d4503ed, to try it out please run Pkg.update(), Pkg.checkout("Nettle", "zypper"), followed by Pkg.build("Nettle") to see if it builds properly.

I did what you reccomended, but is not working yet.
Please, see what happend below:

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> Pkg.checkout("Nettle","zypper")
INFO: Checking out Nettle zypper...
fatal: Cannot update paths and switch to branch 'zypper' at the same time.
Did you intend to checkout 'origin/zypper' which can not be resolved as commit?
ERROR: failed process: Process(git --work-tree=/home/leo/.julia/v0.4/Nettle --git-dir=/home/leo/.julia/v0.4/Nettle/.git checkout -q -B zypper -t origin/zypper, ProcessExited(128)) [128]
in pipeline_error at process.jl:555
in run at process.jl:531
in anonymous at pkg/entry.jl:192
in transact at pkg/git.jl:97
in _checkout at pkg/entry.jl:190
in checkout at pkg/entry.jl:205
in anonymous at pkg/dir.jl:31
in cd at file.jl:22
in cd at pkg/dir.jl:31

julia> Pkg.checkout("Nettle")
INFO: Checking out Nettle master...
INFO: Pulling Nettle latest master...
INFO: No packages to install, update or remove

julia> Pkg.checkout("Nettle","zypper")
INFO: Checking out Nettle zypper...
INFO: Pulling Nettle latest zypper...
INFO: No packages to install, update or remove

julia> Pkg.build("Nettle")
INFO: Building Nettle
===============================[ ERROR: Nettle ]================================

LoadError: could not spawn apt-cache showpkg libnettle4: no such file or directory (ENOENT)
while loading /home/leo/.julia/v0.4/Nettle/deps/build.jl, in expression starting on line 40

=================================================================================================[ BUILD ERRORS ]=================================================================================================

WARNING: Nettle had build errors.

  • packages with build errors remain installed in /home/leo/.julia/v0.4
  • build the package(s) and all dependencies with Pkg.build("Nettle")
  • build a single package by running its deps/build.jl script

I can install libnettle4 and libnettle-devel through zypper. Actually, they're already installed.

Ah, I think I have found the issue. Do you have apt-get installed? E.g. can you run apt-get from the commandline?

You are right, I cannot run apt-get from command line

Wait, you can't? So running apt-get -v on the commandline doesn't do anything? Then I don't know what's going on here after all. Hmmm. Can you run the following and post the output:

julia> using BinDeps

julia> BinDeps.debug("Nettle")
INFO: Reading build script...
The package declares 1 dependencies.
 - Library "nettle"
    - Satisfied by:
      - Homebrew Bottles nettle at /Users/sabae/.julia/v0.4/Homebrew/deps/usr/lib/libnettle.dylib
      - System Paths at /usr/local/Cellar/nettle/3.2/lib/libnettle.6.2.dylib
    - Providers:
      - Homebrew Bottles nettle
      - BinDeps.AptGet package libnettle4 (can't provide)
      - BinDeps.Yum package nettle (can't provide)
      - BinDeps.Zypper package libnettle (can't provide)
      - Autotools Build

There it goes.
julia> using BinDeps
julia> BinDeps.debug("Nettle")
INFO: Reading build script...
The package declares 1 dependencies.
ERROR: could not spawn apt-cache showpkg libnettle4: no such file or directory (ENOENT)
in _jl_spawn at process.jl:262
in anonymous at process.jl:415
in setup_stdio at process.jl:403
in spawn at process.jl:414
in eachline at process.jl:465
in available_versions at /home/leo/.julia/v0.4/BinDeps/src/dependencies.jl:111
in package_available at /home/leo/.julia/v0.4/BinDeps/src/dependencies.jl:107
in can_provide at /home/leo/.julia/v0.4/BinDeps/src/dependencies.jl:646
in _find_library at /home/leo/.julia/v0.4/BinDeps/src/dependencies.jl:495
in show_indented at /home/leo/.julia/v0.4/BinDeps/src/debug.jl:27
in show at /home/leo/.julia/v0.4/BinDeps/src/debug.jl:28
in debug at /home/leo/.julia/v0.4/BinDeps/src/debug.jl:62
in debug at /home/leo/.julia/v0.4/BinDeps/src/debug.jl:65

Please post the output of this:

using BinDeps
BinDeps.has_apt
BinDeps.can_use(BinDeps.AptGet)
success(`apt-get -v`)
julia> BinDeps.has_apt
true                                                                                                  

julia> BinDeps.can_use(BinDeps.AptGet)
true    

julia> success(`apt-get -v`)
true     

When I used the command julia>success(apt-get -v) it oppened the YaST Control Center, which is responsible for software management. After I close the YaST, I receive the message true in julia, after success(apt-get -v).

Alright, so it sounds like you can run apt-get from the terminal, which is what's confusing everything. I have just merged a pull request in to BinDeps that should do the trick.

Try running Pkg.checkout("BinDeps") and trying again.

Dear Elliot, you are the guy!
Everything worked perfectly.
Thank you very much for your kind help.
Cheers,