Git Product home page Git Product logo

nettle.jl's People

Contributors

abhijithch avatar binarybana avatar hatsunemiku avatar ihnorton avatar jayvn avatar jiahao avatar keno avatar kmsquire avatar mortenpi avatar nandoconde avatar rdeits avatar samoconnor avatar samschlegel avatar staticfloat avatar stefankarpinski avatar stevengj avatar swt30 avatar tkelman avatar wookay avatar yuyichao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nettle.jl's Issues

missing file

Hi,

While trying to install IJulia I got an error that led me to the file scr\Nettle.jl. In line 3 it tries to include the file ../deps/deps.jl which I think is missing.

Thanks!

Randall

Segfault on Win32

using IJulia (or running ipython --profile julia) leads to:

Program received signal SIGSEGV, Segmentation fault.
nettle_sha256_update (ctx=0x0, length=140,
    data=0x112bfebc "{\"msg_id\":\"2d16347d-f67d-4c63-bbe8-b93d78eae60b\",\"msg_
type\":\"status\",\"username\":\"jlkernel\",\"session\":\"6151ce33-2c85-4fba-97f
a-947f6802186c\"}") at sha256.c:92
92        MD_UPDATE (ctx, length, data, COMPRESS, MD_INCR(ctx));
(gdb) bt
#0  nettle_sha256_update (ctx=0x0, length=140,
    data=0x112bfebc "{\"msg_id\":\"2d16347d-f67d-4c63-bbe8-b93d78eae60b\",\"msg_
type\":\"status\",\"username\":\"jlkernel\",\"session\":\"6151ce33-2c85-4fba-97f
a-947f6802186c\"}") at sha256.c:92
#1  0x03989792 in ?? ()
#2  0x039893f2 in ?? ()
#3  0x639d205c in jl_apply (f=0x11792f60, args=0xe9e2a8, nargs=4)
    at julia.h:1026
#4  0x639d4f38 in jl_trampoline (F=0x11792f60, args=0xe9e2a8, nargs=4)
    at builtins.c:820
#5  0x639cac9c in jl_apply (f=0x11792f60, args=0xe9e2a8, nargs=4)
    at julia.h:1026
#6  0x639ce4d2 in jl_apply_generic (F=0x144ed1a0, args=0xe9e2a8, nargs=4)
    at gf.c:1355
#7  0x03988668 in ?? ()
#8  0x03988239 in ?? ()
#9  0x03987fb3 in ?? ()
#10 0x639d205c in jl_apply (f=0x13cb4b70, args=0xe9e4bc, nargs=1)
    at julia.h:1026
#11 0x639d4f38 in jl_trampoline (F=0x13cb4b70, args=0xe9e4bc, nargs=1)
    at builtins.c:820
#12 0x639cac9c in jl_apply (f=0x13cb4b70, args=0xe9e4bc, nargs=1)
    at julia.h:1026
#13 0x639ce4d2 in jl_apply_generic (F=0x143746c0, args=0xe9e4bc, nargs=1)
    at gf.c:1355
#14 0x639fa882 in jl_apply (f=0x143746c0, args=0xe9e4bc, nargs=1)
    at julia.h:1026
#15 0x639fabf7 in do_call (f=0x143746c0, args=0x246ee560, nargs=1,
    locals=0x0, nl=0) at interpreter.c:57
#16 0x639fb3e0 in eval (e=0x13cb4b60, locals=0x0, nl=0) at interpreter.c:175
#17 0x639fa942 in jl_interpret_toplevel_expr (e=0x13cb4b60)
    at interpreter.c:20
#18 0x63a0bdc5 in jl_toplevel_eval_flex (e=0x11df2600, fast=1)
    at toplevel.c:402
#19 0x63a0af57 in jl_eval_module_expr (ex=0x11df1e30) at toplevel.c:92
#20 0x63a0b8b0 in jl_toplevel_eval_flex (e=0x11df1e30, fast=1)
    at toplevel.c:305
#21 0x63a0bffc in jl_parse_eval_all (
    fname=0x113a103c "C:\\Users\\ihn\\AppData\\Roaming\\Julia\\packages\\IJulia\
\src\\IJulia.jl") at toplevel.c:450
#22 0x63a0c1e2 in jl_load (
    fname=0x113a103c "C:\\Users\\ihn\\AppData\\Roaming\\Julia\\packages\\IJulia\
\src\\IJulia.jl") at toplevel.c:483
#23 0x63a0c271 in jl_load_ (str=0x11e55850) at toplevel.c:494
#24 0x0038c88d in ?? ()
#25 0x639d205c in jl_apply (f=0x45ed2b0, args=0xe9eb74, nargs=1)
    at julia.h:1026
#26 0x639d4f38 in jl_trampoline (F=0x45ed2b0, args=0xe9eb74, nargs=1)
    at builtins.c:820
#27 0x639cac9c in jl_apply (f=0x45ed2b0, args=0xe9eb74, nargs=1)
    at julia.h:1026
#28 0x639ce4d2 in jl_apply_generic (F=0x45ed230, args=0xe9eb74, nargs=1)
    at gf.c:1355
#29 0x0038c441 in ?? ()
#30 0x639d205c in jl_apply (f=0x4069560, args=0xe9edec, nargs=1)
    at julia.h:1026
#31 0x639d4f38 in jl_trampoline (F=0x4069560, args=0xe9edec, nargs=1)
    at builtins.c:820
#32 0x639cac9c in jl_apply (f=0x4069560, args=0xe9edec, nargs=1)
    at julia.h:1026
#33 0x639ce4d2 in jl_apply_generic (F=0x4069540, args=0xe9edec, nargs=1)
    at gf.c:1355
#34 0x639fa882 in jl_apply (f=0x4069540, args=0xe9edec, nargs=1)
    at julia.h:1026
#35 0x639fabf7 in do_call (f=0x4069540, args=0x11e46860, nargs=1, locals=0x0,
    nl=0) at interpreter.c:57
#36 0x639fb3e0 in eval (e=0x11e52cd0, locals=0x0, nl=0) at interpreter.c:175
#37 0x639fa942 in jl_interpret_toplevel_expr (e=0x11e52cd0)
    at interpreter.c:20
#38 0x63a0bdc5 in jl_toplevel_eval_flex (e=0x11e52cc0, fast=1)
    at toplevel.c:402
#39 0x63a0bea7 in jl_toplevel_eval (v=0x11e52cc0) at toplevel.c:425
#40 0x639d34d8 in jl_f_top_eval (F=0x45ed000, args=0xe9f170, nargs=2)
    at builtins.c:355
#41 0x0038abd1 in ?? ()
#42 0x0038a923 in ?? ()
#43 0x639d205c in jl_apply (f=0x11d260e0, args=0xe9f40c, nargs=1)
    at julia.h:1026
#44 0x639d4f38 in jl_trampoline (F=0x11d260e0, args=0xe9f40c, nargs=1)
    at builtins.c:820
#45 0x639cac9c in jl_apply (f=0x11d260e0, args=0xe9f40c, nargs=1)
    at julia.h:1026
#46 0x639ce4d2 in jl_apply_generic (F=0x452fdb0, args=0xe9f40c, nargs=1)
    at gf.c:1355
#47 0x0038534e in ?? ()
#48 0x00385103 in ?? ()
#49 0x639d205c in jl_apply (f=0x1191eb60, args=0xe9f5b8, nargs=1)
    at julia.h:1026
#50 0x639d4f38 in jl_trampoline (F=0x1191eb60, args=0xe9f5b8, nargs=1)
    at builtins.c:820
#51 0x639cac9c in jl_apply (f=0x1191eb60, args=0xe9f5b8, nargs=1)
    at julia.h:1026
#52 0x639ce4d2 in jl_apply_generic (F=0x3f80ff0, args=0xe9f5b8, nargs=1)
    at gf.c:1355
#53 0x63a0ac2b in jl_apply (f=0x3f80ff0, args=0xe9f5b8, nargs=1)
    at julia.h:1026
#54 0x63a0b678 in eval_import_path_ (args=0x1191ceb0, retrying=0)
    at toplevel.c:254
#55 0x63a0b776 in eval_import_path (args=0x1191ceb0) at toplevel.c:275
#56 0x63a0b9a2 in jl_toplevel_eval_flex (e=0x1191eb50, fast=1)
    at toplevel.c:321
#57 0x63a0bea7 in jl_toplevel_eval (v=0x1191eb50) at toplevel.c:425
#58 0x639d34d8 in jl_f_top_eval (F=0x45ed000, args=0xe9f7ec, nargs=2)
    at builtins.c:355
#59 0x0038471e in ?? ()
#60 0x0038446e in ?? ()
#61 0x639d205c in jl_apply (f=0x450ca00, args=0xe9fadc, nargs=2)
    at julia.h:1026
#62 0x639d4f38 in jl_trampoline (F=0x450ca00, args=0xe9fadc, nargs=2)
    at builtins.c:820
#63 0x639cac9c in jl_apply (f=0x450ca00, args=0xe9fadc, nargs=2)
    at julia.h:1026
#64 0x639ce4d2 in jl_apply_generic (F=0x450c9b0, args=0xe9fadc, nargs=2)
    at gf.c:1355
#65 0x00340d90 in ?? ()
#66 0x00340b6c in ?? ()
#67 0x0034049b in ?? ()
#68 0x639d205c in jl_apply (f=0x445a570, args=0x0, nargs=0) at julia.h:1026
#69 0x639d4f38 in jl_trampoline (F=0x445a570, args=0x0, nargs=0)
    at builtins.c:820
#70 0x639cac9c in jl_apply (f=0x445a570, args=0x0, nargs=0) at julia.h:1026
#71 0x639ce4d2 in jl_apply_generic (F=0x445a530, args=0x0, nargs=0)
    at gf.c:1355
#72 0x00401611 in _fu2____stack_chk_guard ()
    at /home/jameson/julia-win32/src/julia.h:1026
#73 0x00401eec in _fu159__jl_base_module () at repl.c:252
#74 0x63a025e2 in julia_trampoline (argc=0, argv=0x3d5ebc,
    pmain=0x401d8a <true_main>) at init.c:823
#75 0x004020a9 in _fu18____stack_chk_guard () at repl.c:292

cc: @vtjnash

Error in Build Nettle

After updating to the julia 0.3, the Nettle had build errors.
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" to list help topics
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.3.0-prerelease+600 (2013-12-20 08:48 UTC)
/ |_'|||__'| | Commit 9961762* (0 days old master)
|__/ | x86_64-linux-gnu

julia> Pkg.add("Nettle")
INFO: Installing Nettle v0.1.3
INFO: Building Nettle
=====================================================[ ERROR: Nettle ]======================================================

stack overflow
while loading /home/kh/.julia/Nettle/deps/build.jl, in expression starting on line 27

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

WARNING: Nettle had build errors.

  • packages with build errors remain installed in /home/kh/.julia
  • build a package and all its dependencies with Pkg.build(pkg)
  • build a single package by running its deps/build.jl script

INFO: REQUIRE updated

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

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

Suggest adding keywords to github project description

The github project description is currently: "Julia package for libnettle"
This is the text that shows up under "Nettle" at http://pkg.julialang.org.

Minor suggestion: change the description to: "Julia package for libnettle (SHA1, SHA256, MD5 etc)"

This would make the package more discoverable to someone who knows they want to compute a common hash, but does not know anything about libnettle.

error compiling/linking with Centos6 openssl

Because of patent concerns, RedHat (and by extension, Centos) remove ec.h and ecdsa.h from the distribution of openssl. This causes problems in building hogweed.

See https://bugzilla.redhat.com/show_bug.cgi?id=319901

...
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:51:24: error: openssl/ec.h: No such file or directory
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:52:27: error: openssl/ecdsa.h: No such file or directory
gcc -g -O2 -ggdb3 -Wno-pointer-sign -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs -L.. -L/home/kmsquire/.julia/v0.2/Nettle/deps/usr/lib -L/home/kmsquire/src/julia/usr//lib -Wl,-rpath -Wl,/home/kmsquire/.julia/v0.2/Nettle/deps/usr/lib base16enc.o io.o \
    -lnettle -lgmp -lgmp  -o base16enc
gcc -g -O2 -ggdb3 -Wno-pointer-sign -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs -L.. -L/home/kmsquire/.julia/v0.2/Nettle/deps/usr/lib -L/home/kmsquire/src/julia/usr//lib -Wl,-rpath -Wl,/home/kmsquire/.julia/v0.2/Nettle/deps/usr/lib base16dec.o io.o \
    -lnettle -lgmp -lgmp  -o base16dec
gcc -g -O2 -ggdb3 -Wno-pointer-sign -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs -L.. -L/home/kmsquire/.julia/v0.2/Nettle/deps/usr/lib -L/home/kmsquire/src/julia/usr//lib -Wl,-rpath -Wl,/home/kmsquire/.julia/v0.2/Nettle/deps/usr/lib base64enc.o io.o \
    -lnettle -lgmp -lgmp  -o base64enc
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:497: error: expected specifier-qualifier-list before 'EC_KEY'
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c: In function 'bench_openssl_init':
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:519: error: 'struct openssl_ctx' has no member named 'key'
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:519: warning: implicit declaration of function 'EC_KEY_new_by_curve_name'
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:519: warning: nested extern declaration of 'EC_KEY_new_by_curve_name'
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:520: error: 'struct openssl_ctx' has no member named 'digest_length'
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:521: error: 'struct openssl_ctx' has no member named 'digest'
/home/kmsquire/.julia/v0.2/Nettle/deps/src/nettle-2.7.1/examples/hogweed-benchmark.c:531: error: 'struct openssl_ctx' has no member named 'key'
...

load failure with Julia 0.4

I just updated Nettle to master and tried with the latest Julia, and got:

ERROR: type: cglobal: expected Symbol, got Array{Any,1}
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at ./loading.jl:152
 in _require at ./loading.jl:67
 in require at ./loading.jl:52
 in require at /Users/stevenj/Code/julia/usr/lib/julia/sys.dylib
while loading /Users/stevenj/.julia/Nettle/src/hash.jl, in expression starting on line 22
while loading /Users/stevenj/.julia/Nettle/src/Nettle.jl, in expression starting on line 7

Distributed and Nettle packages are conflicting on Julia 1.1

@staticfloat

On Julia 1.1 this fails:

Using Distributed, Nettle
addprocs(1)

Error below:

fatal: error thrown and no exception handler available.
#
reset_page at /Users/osx/buildbot/slave/package_osx64/build/src/gc.c:1044 [inlined]
add_page at /Users/osx/buildbot/slave/package_osx64/build/src/gc.c:1080
jl_gc_pool_alloc at /Users/osx/buildbot/slave/package_osx64/build/src/gc.c:1142
Type at ./iobuffer.jl:20 [inlined]
Type at ./iobuffer.jl:27 [inlined]
#IOBuffer#303 at ./iobuffer.jl:98
Type at ./none:0 [inlined]
#IOBuffer#304 at ./iobuffer.jl:114
Type at ./none:0 [inlined]
#print_to_string#330 at ./strings/io.jl:116
print_to_string at ./strings/io.jl:112 [inlined]
string at ./strings/io.jl:143 [inlined]
init at ./sysinfo.jl:114
jl_apply at /Users/osx/buildbot/slave/package_osx64/build/src/./julia.h:1571 [inlined]
jl_module_run_initializer at /Users/osx/buildbot/slave/package_osx64/build/src/toplevel.c:72
_julia_init at /Users/osx/buildbot/slave/package_osx64/build/src/init.c:832
main at /Applications/Julia-1.1.app/Contents/Resources/julia/bin/julia (unknown line)
ERROR: Unable to read host:port string from worker. Launch command exited with error?
error(::String) at ./error.jl:33
read_worker_host_port(::Base.PipeEndpoint) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/cluster.jl:275
connect(::Distributed.LocalManager, ::Int64, ::WorkerConfig) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/managers.jl:397
create_worker(::Distributed.LocalManager, ::WorkerConfig) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/cluster.jl:501
setup_launched_worker(::Distributed.LocalManager, ::WorkerConfig, ::Array{Int64,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/cluster.jl:447
(::getfield(Distributed, Symbol("##47#50")){Distributed.LocalManager,WorkerConfig})() at ./task.jl:259
Stacktrace:
[1] sync_end(::Array{Any,1}) at ./task.jl:226
[2] macro expansion at ./task.jl:245 [inlined]
[3] #addprocs_locked#44(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Distributed.LocalManager) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/cluster.jl:401
[4] addprocs_locked at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/cluster.jl:372 [inlined]
[5] #addprocs#43(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Distributed.LocalManager) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/cluster.jl:365
[6] addprocs at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/cluster.jl:359 [inlined]
[7] #addprocs#255 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/managers.jl:316 [inlined]
[8] addprocs(::Int64) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Distributed/src/managers.jl:315
[9] top-level scope at none:0

Nettle installation error when installing IJulia

Hi

I'm finding I'm having a problem with Nettle installation, which is being pulled in as part of IJulia.

This is on an up-to date kubuntu 14.04, and using latest Julia commit.

Details below is for calling Pkg.build("Nettle"), but the same error occurs if I delete all packages and try reinstalling IJulia

I've tried apt-get removing libnettle4 so the script adds it in, but the error still occurs.

Thanks a lot,
John

julia> Pkg.build("Nettle")
INFO: Building Nettle
Installing dependency libnettle4 via `sudo apt-get install libnettle4`:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libnettle4 is already the newest version.
0 to upgrade, 0 to newly install, 0 to remove and 190 not to upgrade.
==============================================================[ ERROR: Nettle ]===============================================================

Provider PackageManager failed to satisfy dependency nettle
while loading /home/john/.julia/v0.4/Nettle/deps/build.jl, in expression starting on line 35

==============================================================================================================================================

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

WARNING: Nettle had build errors.

 - packages with build errors remain installed in /home/john/.julia/v0.4
 - build a package and all its dependencies with `Pkg.build(pkg)`
 - build a single package by running its `deps/build.jl` script

==============================================================================================================================================

julia> 
Julia Version 0.4.0-dev+153
Commit 003169b (2014-08-16 04:48 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
julia> Pkg.installed()
Dict{ASCIIString,VersionNumber} with 12 entries:
  "REPLCompletions"   => v"0.0.2"
  "FixedPointNumbers" => v"0.0.1"
  "SHA"               => v"0.0.2"
  "PyCall"            => v"0.4.8"
  "Color"             => v"0.3.0"
  "ZMQ"               => v"0.1.13"
  "JSON"              => v"0.3.7"
  "IJulia"            => v"0.1.12"
  "PyPlot"            => v"1.2.10"
  "BinDeps"           => v"0.3.0"
  "Nettle"            => v"0.1.4"
  "URIParser"         => v"0.0.2"

Pkg.test() failure on OSX

This isn't due to the recently-merged #64, but is reproducible on my OSX machine. @tkelman is this a known problem with julia v0.4.3 perhaps?

julia> Pkg.test("Nettle")
INFO: Testing Nettle
INFO: Recompiling stale cache file /Users/sabae/.julia/lib/v0.4/Nettle.ji for module Nettle.
Testing hash show methods:
SHA256 Hash
  Context size: 112 bytes
  Digest size: 32 bytes
  Block size: 64 bytes
SHA256 Hash state
Testing HMAC show methods:
SHA256 HMAC state
Assertion failed: (rval->getType() == jl_pvalue_llvmt || rval->getType() == NoopType), function emit_assignment, file codegen.cpp, line 3007.

signal (6): Abort trap: 6
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
===============================================================[ ERROR: Nettle ]===============================================================

failed process: Process(`/usr/local/Cellar/julia/0.4.3/bin/julia --check-bounds=yes --code-coverage=none --color=yes /Users/sabae/.julia/v0.4/Nettle/test/runtests.jl`, ProcessSignaled(6)) [0]

===============================================================================================================================================
ERROR: Nettle had test errors
 in error at /usr/local/Cellar/julia/0.4.3/lib/julia/sys.dylib
 in test at pkg/entry.jl:803
 in anonymous at pkg/dir.jl:31
 in cd at file.jl:22
 in cd at pkg/dir.jl:31
 in test at pkg.jl:71

Nettle show ERRORS when using openSUSE

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

You had better use 'sizeof()' instead of 'length()' .

I think you had better use 'sizeof()' instead of 'length()' .

fails by c assertion

willcauseassertion = "this is 16 (โˆ€).."
length(willcauseassertion) # 16
sizeof(willcauseassertion) # 18
willcauseassertion.data == decrypt(dec, encrypt(enc, willcauseassertion))

or unexpected through the length check

willbebroken = "this is 16 (โˆ€)"
length(willbebroken) # 14
sizeof(willbebroken) # 16
willbebroken.data == decrypt(dec, encrypt(enc, willbebroken)) # must be true, but broken result = Array(Uint8, length(data))

Fix it, and open the pull request.
https://github.com/HatsuneMiku/Nettle.jl/tree/_dev_aes256cbc

Deprecated type name `Uint8`

Nettle uses the deprecated type name Uint8 e.g. in hmac.jl. After the recent Julia 0.4 release branch update, I see deprecation warnings about this.

segfault on windows

Seeing this:

julia> using Nettle

julia> s = HMACState(SHA256,"foobar")
Please submit a bug report with steps to reproduce this fault, and any error mes
sages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6a7094a8 -- ??? at ???:1785762984
nettle_hmac_set_key at ???:1785762984
HMACState at C:\Users\karbarcca\.julia\v0.3\Nettle\src\hmac.jl:24
jl_apply_generic at ???:1705056858
jl_interpret_toplevel_expr at ???:1705273036
jl_interpret_toplevel_thunk_with at ???:1705269810
jl_interpret_toplevel_thunk_with at ???:1705270404
jl_interpret_toplevel_expr_in at ???:1705274385
jl_interpret_toplevel_thunk_with at ???:1705268728
jl_toplevel_eval at ???:1705337595
jl_f_top_eval at ???:1705082617
eval_user_input at REPL.jl:53
jlcall_eval_user_input;20312 at ???:46733675
??? at ???:46305952
??? at ???:46145200
??? at ???:12909680
??? at ???:94626544
??? at ???:12909520
jl_apply_generic at ???:1705056732
anonymous at task.jl:95
jl_f_task at ???:1705301525
julia_trampoline at ???:1705296549
??? at ???:4202432
??? at ???:4199369
??? at ???:4199672
BaseThreadInitThunk at ???:588060333
RtlUserThreadStart at ???:593184297
Please submit a bug report with steps to reproduce this fault, and any error mes
sages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6a7094a8 -- nettle_hmac_set_key at ??
?:1785762984
RtlUserThreadStart at ???:593184297
Please submit a bug report with steps to reproduce this fault, and any error mes
sages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6a7094a8 -- nettle_hmac_set_key at ??
?:1785762984
RtlUserThreadStart at ???:593184297
Please submit a bug report with steps to reproduce this fault, and any error mes
sages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6a7094a8 -- nettle_hmac_set_key at ??
?:1785762984
RtlUserThreadStart at ???:593184297
Please submit a bug report with steps to reproduce this fault, and any error mes
sages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6a7094a8 -- nettle_hmac_set_key at ??
?:1785762984
RtlUserThreadStart at ???:593184297

C:\Users\karbarcca\julia>

warning with Pkg.build on julia-0.5

I was building IJulia which has a Nettle dependency and got the following warning:

WARNING: `@windows_only` is deprecated, use `@static if is_windows()` instead
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in @windows_only(::Any) at ./deprecated.jl:489
 in include_from_node1(::String) at ./loading.jl:426
 in evalfile(::String, ::Array{String,1}) at ./loading.jl:442 (repeats 2 times)
 in cd(::##2#4, ::String) at ./file.jl:59
 in (::##1#3)(::IOStream) at ./none:13
 in open(::##1#3, ::String, ::String) at ./iostream.jl:113
 in eval(::Module, ::Any) at ./boot.jl:234
 in process_options(::Base.JLOptions) at ./client.jl:239
 in _start() at ./client.jl:318
while loading /Users/XXXX/.julia/v0.5/Nettle/deps/build.jl, in expression starting on line 8

Precompile failing with julia 0.6-dev

Pinging @staticfloat as requested.

I'm getting errors during precompilation of Nettle on Julia master:

julia> using Nettle
INFO: Precompiling module Nettle.
ERROR: LoadError: UndefVarError: call not defined
Stacktrace:
 [1] _precompile_() at /Users/rdeits/.julia/v0.6/Nettle/src/precompile.jl:4
 [2] include_from_node1(::String) at ./loading.jl:539
 [3] include(::String) at ./sysimg.jl:14
 [4] anonymous at ./<missing>:2
while loading /Users/rdeits/.julia/v0.6/Nettle/src/Nettle.jl, in expression starting on line 34
ERROR: Failed to precompile Nettle to /Users/rdeits/.julia/lib/v0.6/Nettle.ji.

The relevant line in precompile.jl is:

precompile(Nettle.call, (Type{Nettle.Decryptor}, Compat.ASCIIString, Vector{UInt8},))

and several other lines which also attempt to precompile calls to Nettle.call. Presumably this is failing because call overloading is dropped in 0.6, although from the Travis logs it looks like this was working on 0.6-dev as of January. I'm not sure what's going on there.

Switching all of the precompile(call... calls to

precompile(Nettle.Decryptor, (Compat.ASCIIString, Vector{UInt8},))

resolves the issue. If that's the right thing to do, I'm happy to open a PR with the appropriate changes (presumably with some run-time version checking).

Problem installing on Windows

After installing Julia 0.3.0-prelease on a 64-bit Windows 7 machine at work, I get the following error when trying to install Nettle:

              _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0-prerelease+1570 (2014-02-14 21:07 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit a6f6461* (16 days old master)
|__/                   |  x86_64-w64-mingw32

julia> Pkg.installed()
Dict{ASCIIString,VersionNumber}()

julia> Pkg.add("Nettle")
INFO: Installing BinDeps v0.2.12
INFO: Installing HTTPClient v0.1.0
INFO: Installing LibCURL v0.1.0
INFO: Installing LibExpat v0.0.3
INFO: Installing Nettle v0.1.3
INFO: Installing URIParser v0.0.1
INFO: Installing URLParse v0.0.0
INFO: Installing WinRPM v0.0.12
INFO: Installing Zlib v0.1.5
INFO: Building Nettle
===============================[ ERROR: Nettle ]================================


"ErrorException(\"Error parsing document : 0\"), mismatched tag, 33, 3, 1061"
while loading C:\Users\simonp\.julia\WinRPM\src\WinRPM.jl, in expression startin
g on line 391
while loading C:\Users\simonp\.julia\Nettle\deps\build.jl, in expression startin
g on line 8

================================================================================


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


WARNING: Nettle had build errors.

 - packages with build errors remain installed in C:\Users\simonp\.julia
 - build a package and all its dependencies with `Pkg.build(pkg)`
 - build a single package by running its `deps/build.jl` script

================================================================================

INFO: Package database updated

I tried following this with Pkg.update() but Julia reported that no packges needed updating.

Non-sudo build option

Nettle came up as a dependency for another module (IJulia). Unfortunately I do not have sudo access in my environment, and was wondering if there was some way to install from source.

could not spawn `yum list nettle` on MacOS

Doing Pkg.build("Nettle") with a fresh Julia master install gives:

LoadError: could not spawn `yum list nettle`: no such file or directory (ENOENT)
while loading /Users/stevenj/.julia/v0.6/Nettle/deps/build.jl, in expression starting on line 39

on MacOS, which is surprising since it shouldn't even be using yum on a Mac.

Same error with both the tagged and master versions of Nettle, Homebrew, and BinDeps.

Make a type for every hash function

Currently, it is not possible to write a hash function generic security protocols. To understand that, consider data and hash value. Let's say we want to test that the hash value corresponds to the data:

ishash(data,hash)

The problem is that one can not make that generic.

A resolution for such a problem is to give type information for the hashes. Thus one could write a generic function:

ishash(data,hash::Hash) = typeof(hash)(data).hash==hash.hash

I started to implement an interface in my Signatures.jl package (lines 40 to 63), but that does not have a place there. @staticfloat could that be implemented in Nettle.jl?

Does not build on macOS with Julia v0.7

@staticfloat There are multiple issues. I tried fixing it and addressed the obvious problems, until I got stuck -- I don't understand how is this supposed to work:

ERROR: LoadError: UndefVarError: ctxt not defined
Stacktrace:
 [1] setup_easy_handle(::String, ::HTTPClient.HTTPC.RequestOptions) at /Users/adrian/.julia/dev/HTTPClient/src/HTTPC.jl:211
 [2] get(::String, ::HTTPClient.HTTPC.RequestOptions) at /Users/adrian/.julia/dev/HTTPClient/src/HTTPC.jl:382
 [3] #get#7(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at /Users/adrian/.julia/dev/HTTPClient/src/HTTPC.jl:534
 [4] get at /Users/adrian/.julia/dev/HTTPClient/src/HTTPC.jl:534 [inlined]
 [5] download at /Users/adrian/.julia/packages/WinRPM/Zs9v/src/WinRPM.jl:51 [inlined]
 [6] (::getfield(WinRPM, Symbol("#cacheget#9")){Bool,Bool})(::String, ::Bool) at /Users/adrian/.julia/packages/WinRPM/Zs9v/src/WinRPM.jl:151
 [7] update(::Bool, ::Bool) at /Users/adrian/.julia/packages/WinRPM/Zs9v/src/WinRPM.jl:162
 [8] update() at /Users/adrian/.julia/packages/WinRPM/Zs9v/src/WinRPM.jl:129
 [9] top-level scope
 [10] include at ./boot.jl:314 [inlined]
 [11] include_relative(::Module, ::String) at ./loading.jl:1071
 [12] include(::Module, ::String) at ./sysimg.jl:29
 [13] include(::String) at ./client.jl:393
 [14] top-level scope
in expression starting at /Users/adrian/.julia/packages/WinRPM/Zs9v/deps/build.jl:2

Build error on Windows

On Win7 64-bit, I received this error while trying to build Nettle (as a part of IJulia)

           _

_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" to list help topics
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 0.2.0 (2013-11-16 23:44 UTC)
/ |_'|||__'| | Official http://julialang.org release
|__/ | x86_64-w64-mingw32

julia> Pkg.add("Nettle")
INFO: Cloning cache of BinDeps from git://github.com/JuliaLang/BinDeps.jl.git
INFO: Cloning cache of Nettle from git://github.com/staticfloat/Nettle.jl.git
INFO: Installing BinDeps v0.2.12
INFO: Installing Nettle v0.1.3
INFO: Building Nettle
WARNING: skipping repodata/repomd.xml, not in cache
WARNING: skipping repodata/repomd.xml, not in cache
INFO: Updating WinRPM package list
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win3
2/openSUSE_Factory//repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win3
2/openSUSE_Factory//repodata/f23410e50cd4b88aad057263ad609342cb05c51d880c5d999e2
4bb2ebe867751-primary.xml.gz
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win6
4/openSUSE_Factory//repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win6
4/openSUSE_Factory//repodata/bdade38f5a9e7abbc7ecdfe3715c9a05655c57cefa575a46c8b
7aa2a44e12510-primary.xml.gz
===============================[ ERROR: Nettle ]================================

WARNING: backtraces on your platform are often misleading or partially incorrect

sexpr not defined
at C:\Users\fullerf.julia\Nettle\deps\build.jl:35

Ideas?

Error when installing on OS X

I am unable to install the package in a clean Julia installation when running Pkg.add("Nettle")

Julia version: Julia-0.2.0-pre-721c9fb988

Log:

WARNING: An exception occured while building binary dependencies.
You may have to take manual steps to complete the installation, see the error message below.
To reattempt the installation, run Pkg.fixup("Nettle").

 in build at pkg.jl:412
ERROR: syntax: invalid assignment location
 in include at boot.jl:238
 in include_from_node1 at loading.jl:96
 in reload_path at loading.jl:121
 in require at loading.jl:50
 in include at boot.jl:238
 in include_from_node1 at loading.jl:96
 in anonymous at no file:415
 in cd at file.jl:25
 in cd at pkg/dir.jl:30
 in build at pkg.jl:412
 in __fixup at pkg.jl:464
 in _fixup at pkg.jl:491
 in _fixup at pkg.jl:476 (repeats 3 times)
 in _resolve at pkg.jl:291
 in _resolve at pkg.jl:220
 in anonymous at no file:34
 in cd at file.jl:25
 in cd at pkg/dir.jl:30
 in edit at pkg.jl:24
 in add at pkg.jl:21
at /Users/danielfrg/.julia/BinDeps/src/BinDeps.jl:289
at /Users/danielfrg/.julia/Nettle/deps/build.jl:1

Any ideas to solve this?
Thanks

Is possible to save this decryptor dec ?

Very usefull package! Thanks.
I need to save and keep decryptor !

dec = Decryptor("AES256", key)

Is possible to save this decryptor ?
is not possibile with JLD or JLD2 . Do you have some idea how to do?
Paul

Move to JuliaLang as well?

Since this repository is (perhaps surprisingly) critical for IJulia functionality, should it be moved to JuliaLang as well? I don't see myself doing anything useful with it beyond what I've already done.

don't call @eval in hash_init()

The hash_init() function in hash.jl currently calls @eval on a bunch of definitions. This is a bit ugly, and it interacts badly with precompilation (Base.compilecache(:IJulia) generates a raft of warnings).

It seems like it would be much cleaner to simply define

immutable HashAlgorithm{name}
    nh::NettleHash
end

rather than defining a bunch of subtypes at compile-time, and then have the constructor HashAlgorithm(name::AbstractString) look it up at runtime to see if that hash is available.

take better advantage of precompilation

Currently, there are a lot of things happening in the __init__ statement, which makes precompilation not help much for Nettle. I think this can probably be fixed.

e.g. consider hash_init. Instead of defining a new type <: HashAlgorithm for each hash Nettle defines (detected at runtime), why not just work with NettleHash directly, with a constructor like NettleHash(name::AbstractString) to look up the structure at runtime for a given name, and a function nettlehashes() to return the available names?

In most applications, like IJulia, we only want a particular hash, and we know which one we want in advance โ€” if Nettle is missing this one, we just want to throw an error. So, there is no point in setting up all the hashes when the module is loaded.

Nettle 3.0/3.1 compatibility

I've got the following segfault when running the tests on ArchLinux.
Julia 0.4-dev (should not matter)

Backtrace,

_nettle_aes_set_key at /usr/bin/../lib/libnettle.so (unknown line)
call at /usr/share/julia/site/v0.4/Nettle/src/cipher.jl:79
aes128_encrypt at /usr/share/julia/site/v0.4/Nettle/src/cipher.jl:117
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
anonymous at ./test.jl:87
do_test at ./test.jl:47
anonymous at ./no file:29
unknown function (ip: -140173077)
unknown function (ip: -140170412)
jl_load at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: -185256800)
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: -184260780)
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: -140248077)
unknown function (ip: -140251264)
unknown function (ip: -140173274)
unknown function (ip: -140170412)
jl_load at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: -186565232)
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
include_from_node1 at ./loading.jl:129
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: -184311739)
unknown function (ip: -184316692)
unknown function (ip: -184314231)
jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: 4200533)
unknown function (ip: 4199391)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
unknown function (ip: 4199481)
unknown function (ip: 0)

The line number is a little bit confusing but apparently it was the line 78 ccall that causes the segfault.

A quick look at my nettle-meta.h and nettle-types.h shows that the signature of nettle_set_key_func doesn't have a length argument here

/* Ciphers */
typedef void nettle_set_key_func(void *ctx, const uint8_t *key);

A google search lead me to this post. I haven't read it through but it seems that there's a ABI break last year.

The construction of these functions are at runtime so I suppose it shouldn't be too hard to add additional version tests. However, I'm not familiar with nettle so I'm not sure what is the best way to do that.

My nettle soname is libnettle.so.6 if that helps..

@staticfloat (just to make sure the notification get through... ;P )

Release a new version.

Could you tag and release a new version?
v0.4.0-rc2 emits massive amounts of deprecated warnings.
Since IJulia.jl depends on this package, many people would be affected.

Cannot be statically compiled.

This package actually has a good example of why we may need some more sophisticated caching for ccall. In particular, we're reading function pointers out of a struct that we need to use in ccall. I guess we can use a global variable. Interesting use case nevertheless. Currently it throws a warning that it can't be statically compiled (@vtjnash, should we disable that warning if we're not in imaging mode?).

cc also @JeffBezanson

@async

Ping @staticfloat!
spawning a @async hexdigest("MD5", file) isn't spawned away, it's stuck until the process is finished. Since calculating the md5sum for large files can take a while, it would be great if asyncing these commands would work as expected.
Thanks a lot!

Reuse gmp dependency?

I just noticed on a fresh installation on OSX 10.9.1 that Nettle pulls a homebrew bottle of gmp 5.1.3. Since gmp is a dependency of Julia itself, would it make more sense to reuse the build from Julia rather than installing a fresh copy?

Install error on RHEL 6.1: ERROR: no method package_available(Yum,)

Hi,

I'm using RHEL 6.1 without root permissions and I get the following error on today's Pkg.update() version:

INFO: Installing Nettle v0.0.0
INFO: Running build script for package Nettle
WARNING: An exception occured while building binary dependencies.
You may have to take manual steps to complete the installation, see the error message below.
To reattempt the installation, run Pkg.fixup("Nettle").

in build at pkg.jl:362
ERROR: no method package_available(Yum,)

If I comment out line 35 of build.jl:

provides( Yum, "nettle", nettle )

and then run it then it downloads the source and tries to compile it but runs into another error:

... hogweed-benchmark.c:51:24: error: openssl/ec.h: No such file or directory
... hogweed-benchmark.c:52:27: error: openssl/ecdsa.h: No such file or directory

I believe this is because RH doesn't ship these files and this is being tracked elsewhere.

Glen

Cloning hash state

Hi,

I needed to copy the hashing state (avoiding recomputation for common prefixes).
Following worked well, and I'd like it to be included (IMO commonly supported functionality).

copy(hsh:: Hasher) = Hasher(hsh.hash_type, copy(hsh.state))

Thanks.

edit: ping @staticfloat

Tag new release?

@staticfloat The latest tagged version has some deprecation warnings (and also failed failed tests for me). Master is fine though. Could you please tag a new release?

[PackageEvaluator.jl] Your package Nettle may have a testing issue.

This issue is being filed by a script, but if you reply, I will see it.

PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their test (if available) on both the stable version of Julia (0.2) and the nightly build of the unstable version (0.3).

The results of this script are used to generate a package listing enhanced with testing results.

The status of this package, Nettle, on...

  • Julia 0.2 is 'Tests fail, but package loads.' PackageEvaluator.jl
  • Julia 0.3 is 'Tests pass.' PackageEvaluator.jl

'No tests, but package loads.' can be due to their being no tests (you should write some if you can!) but can also be due to PackageEvaluator not being able to find your tests. Consider adding a test/runtests.jl file.

'Package doesn't load.' is the worst-case scenario. Sometimes this arises because your package doesn't have BinDeps support, or needs something that can't be installed with BinDeps. If this is the case for your package, please file an issue and an exception can be made so your package will not be tested.

This automatically filed issue is a one-off message. Starting soon, issues will only be filed when the testing status of your package changes in a negative direction (gets worse). If you'd like to opt-out of these status-change messages, reply to this message.

Out-of-bounds writing and related unexpected behavior when element size > 1

There are some problems when key or data is an Array or Strings with an element size > 1 (e.g. Array{UInt32} or UTF16String).

encrypt! and decrypt! can write out of bounds and only encrypt parts of the data. The constructors of Encryptor and Decryptor expect a longer key than necessary and ignores the extra characters that you have to pass.

Some examples of this behavior: https://gist.github.com/cookiemon/408491052f701bc82973
The output this prints is: https://gist.github.com/cookiemon/06cf732f1ee94d9419c8

I expect it to either fail on unsupported types or encrypt/decrypt whole data, not write oob and not ignore bytes in key that must be passed.

not using brew when available?

I just tried to help a bunch of mac users install ijulia, and it always seemed to try to compile nettle. This build always failed for some reason, sometimes involving gmp symbols. However more importantly, some of these users had homebrew installed and Nettle.jl's build script didn't try to use it. If they ran brew install nettle in a separate terminal, then the rest of the IJulia install went through fine.

Deprecation fix

diff --git a/src/hash_common.jl b/src/hash_common.jl
index 12f1679..f54a3cf 100644
--- a/src/hash_common.jl
+++ b/src/hash_common.jl
@@ -31,7 +31,7 @@ end

 # The function that maps from a NettleHash to a HashType
 function HashType(nh::NettleHash, nhptr::Ptr{Void})
-    HashType( uppercase(bytestring(nh.name)),
+    HashType( uppercase(unsafe_string(nh.name)),
                     nh.context_size, nh.digest_size, nh.block_size,
                     nh.init, nh.update, nh.digest, nhptr)

/usr/bin/ld: cannot find -lgmp

So unfortunately on the Linux system I am trying to install this package on the libgmp is not called libgmp.so but rather libgmp.so.3 and therefore gcc does not find it. Do you know the correct environment variable or change to the Makefile needed to get Nettle to build?

Thanks

Nettle install "None of the selected providers can install dependency nettle."

I am trying to build "Nettle" to install "IJulia", I got an error:

julia> Pkg.build("Nettle")
INFO: Building WinRPM
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win32/openSUSE_13.2/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win64/openSUSE_13.2/repodata/repomd.xml
INFO: Building Nettle
INFO: Updating WinRPM package list
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win32/openSUSE_13.2/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win64/openSUSE_13.2/repodata/repomd.xml
===============================[ ERROR: Nettle ]================================

LoadError: None of the selected providers can install dependency nettle.
Use BinDeps.debug(package_name) to see available providers

while loading C:\Users\Szymek.julia\v0.4\Nettle\deps\build.jl, in expression st
arting on line 39

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

WARNING: Nettle had build errors.

  • packages with build errors remain installed in C:\Users\Szymek.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 tried to remove and install "Ijulia" package but it didn't help, I also tried to remove https://cache.e.ip.saba.us/ from winRPM sources.list but it didn't help either.

Error building Nettle on Windows

While attempting to install Nettle.jl as part of an IJulia installation for a 32-bit Julia 0.3.11 on a 64-bit Windows Server 2012 environment (I have justification for such madness), I am receiving build errors for both Nettle and ZMQ. I will file a similar issue under ZMQ.jl.

A similar (or possibly the same) issue seems to have been noticed yesterday and filed in an existing closed issue within IJulia.

Below is the terminal output when attempting to do a Pkg.add("IJulia") as part of a new Julia installation on a new OS installation:


                _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.11 (2015-07-27 06:18 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  i686-w64-mingw32

julia> Pkg.add("IJulia")
INFO: Initializing package repository C:\Users\Administrator\.julia\v0.3
INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl
INFO: Cloning cache of BinDeps from git://github.com/JuliaLang/BinDeps.jl.git
INFO: Cloning cache of Compat from git://github.com/JuliaLang/Compat.jl.git
INFO: Cloning cache of IJulia from git://github.com/JuliaLang/IJulia.jl.git
INFO: Cloning cache of JSON from git://github.com/JuliaLang/JSON.jl.git
INFO: Cloning cache of LibExpat from git://github.com/amitmurthy/LibExpat.jl.git

INFO: Cloning cache of Nettle from git://github.com/staticfloat/Nettle.jl.git
INFO: Cloning cache of REPLCompletions from git://github.com/Keno/REPLCompletion
s.jl.git
INFO: Cloning cache of SHA from git://github.com/staticfloat/SHA.jl.git
INFO: Cloning cache of URIParser from git://github.com/JuliaWeb/URIParser.jl.git

INFO: Cloning cache of WinRPM from git://github.com/JuliaLang/WinRPM.jl.git
INFO: Cloning cache of ZMQ from git://github.com/JuliaLang/ZMQ.jl.git
INFO: Cloning cache of Zlib from git://github.com/dcjones/Zlib.jl.git
INFO: Installing BinDeps v0.3.15
INFO: Installing Compat v0.6.0
INFO: Installing IJulia v0.2.5
INFO: Installing JSON v0.4.5
INFO: Installing LibExpat v0.0.8
INFO: Installing Nettle v0.1.10
INFO: Installing REPLCompletions v0.0.3
INFO: Installing SHA v0.1.1
INFO: Installing URIParser v0.0.5
INFO: Installing WinRPM v0.1.12
INFO: Installing ZMQ v0.2.0
INFO: Installing Zlib v0.1.8
INFO: Building WinRPM
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to d
ownload
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to d
ownload
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 1/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 2/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 3/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 4/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 5/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: received error 0 while downloading https://cache.e.ip.saba.us/http://do
wnload.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/re
pomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 1/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 2/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 3/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 4/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 5/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: received error 0 while downloading https://cache.e.ip.saba.us/http://do
wnload.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/re
pomd.xml
INFO: Building Nettle
INFO: Updating WinRPM package list
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 1/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 2/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 3/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 4/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 5/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
WARNING: received error 0 while downloading https://cache.e.ip.saba.us/http://do
wnload.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/re
pomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/reposi
tories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 1/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 2/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 3/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 4/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270094
WARNING: Retry 5/5 downloading: https://cache.e.ip.saba.us/http://download.opens
use.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
WARNING: received error 0 while downloading https://cache.e.ip.saba.us/http://do
wnload.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/re
pomd.xml
===============================[ ERROR: Nettle ]================================


None of the selected providers can install dependency nettle.
Use BinDeps.debug(package_name) to see available providers

while loading C:\Users\Administrator\.julia\v0.3\Nettle\deps\build.jl, in expres
sion starting on line 39

================================================================================

INFO: Building ZMQ
=================================[ ERROR: ZMQ ]=================================


None of the selected providers can install dependency zmq.
Use BinDeps.debug(package_name) to see available providers

while loading C:\Users\Administrator\.julia\v0.3\ZMQ\deps\build.jl, in expressio
n starting on line 23

================================================================================

INFO: Building IJulia
Found IPython version 3.2.0 ... ok.
Creating julia profile in IPython...
Changing KernelManager.kernel_cmd to ["C:\\\\Users\\\\Administrator\\\\AppData\\
\\Local\\\\Julia-0.3.11\\\\bin\\\\julia.exe","-i","-F","C:\\\\Users\\\\Administr
ator\\\\.julia\\\\v0.3\\\\IJulia\\\\src\\\\kernel.jl","{connection_file}"] in ip
ython_config.py...
(Existing IPythonWidget.execute_on_complete_input setting in ipython_qtconsole_c
onfig.py is untouched.)
(Existing FrontendWidget.lexer_class setting in ipython_qtconsole_config.py is u
ntouched.)
(Existing NotebookApp.port setting in ipython_notebook_config.py is untouched.)
(Existing ipynblogo.png file untouched.)
(Existing ipynblogo.svg file untouched.)
(Existing favicon.ico file untouched.)
(Existing custom.js file untouched.)
(Existing julia.js file untouched.)
Writing IJulia kernelspec to C:\Users\Administrator\.ipython\kernels\julia-0.3\k
ernel.json ...
(Existing logo-32x32.png file untouched.)
(Existing logo-64x64.png file untouched.)

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


WARNING: Nettle and ZMQ had build errors.

 - packages with build errors remain installed in C:\Users\Administrator\.julia\
v0.3
 - build the package(s) and all dependencies with `Pkg.build("Nettle", "ZMQ")`
 - build a single package by running its `deps/build.jl` script

================================================================================

INFO: Package database updated

julia>

Tag a new release?

Hi @staticfloat . Would you be willing to tag a new release of Nettle.jl? The issues resolved in #81 are causing packages that depend on IJulia to fail on v0.6-dev.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.