From fec566a12a0fa581a836c8db43b270588e37da00 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 2 Apr 2020 15:54:21 -0700 Subject: [PATCH 1/3] Upgrade Nettle to Julia 1.3+ * Use JLL package (death to BinaryProvider!) * Add Project.toml --- Manifest.toml | 70 +++++++++++++++++++++++++++++++++++++++++++++++ Project.toml | 17 ++++++++++++ deps/.gitignore | 3 -- deps/build.jl | 43 ----------------------------- src/Nettle.jl | 13 +-------- src/precompile.jl | 1 - 6 files changed, 88 insertions(+), 59 deletions(-) create mode 100644 Manifest.toml create mode 100644 Project.toml delete mode 100644 deps/.gitignore delete mode 100644 deps/build.jl diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 0000000..7978ede --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,70 @@ +# This file is machine-generated - editing it directly is not advised + +[[Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[GMP_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "4dd9301d3a027c05ec403e756ee7a60e3c367e5d" +uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" +version = "6.1.2+5" + +[[InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[LibGit2]] +deps = ["Printf"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[Nettle_jll]] +deps = ["GMP_jll", "Libdl", "Pkg"] +git-tree-sha1 = "10e4a49e5f6324b30e1d86ba024dd3a8afae59df" +uuid = "4c82536e-c426-54e4-b420-14f461c4ed8b" +version = "3.4.1+0" + +[[Pkg]] +deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + +[[Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..fc0a1d8 --- /dev/null +++ b/Project.toml @@ -0,0 +1,17 @@ +name = "Nettle" +uuid = "49dea1ee-f6fa-5aa6-9a11-8816cee7d4b9" +authors = ["Elliot Saba "] +version = "0.5.0" + +[deps] +Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +Nettle_jll = "4c82536e-c426-54e4-b420-14f461c4ed8b" + +[compat] +julia = "1.3" + +[extras] +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Test"] diff --git a/deps/.gitignore b/deps/.gitignore deleted file mode 100644 index 9e45a42..0000000 --- a/deps/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!build.jl diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index ce44581..0000000 --- a/deps/build.jl +++ /dev/null @@ -1,43 +0,0 @@ -using BinaryProvider # requires BinaryProvider 0.3.0 or later - -# Parse some basic command-line arguments -const verbose = "--verbose" in ARGS -const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) -products = [ - LibraryProduct(prefix, String["libnettle"], :libnettle), - ExecutableProduct(prefix, "nettle-hash", :nettle_hash), -] - -# Download binaries from hosted location -bin_prefix = "https://github.com/staticfloat/NettleBuilder/releases/download/v3.4-0" - -# Listing of files generated by BinaryBuilder: -download_info = Dict( - BinaryProvider.Linux(:aarch64, :glibc, :blank_abi) => ("$bin_prefix/Nettle.aarch64-linux-gnu.tar.gz", "89f768ba67ab3f977a4528c68bfb02bc922620da4f3907109f84ad520ed56ade"), - BinaryProvider.Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/Nettle.arm-linux-gnueabihf.tar.gz", "6fc8551dca3887e33ceebd1989ff2479a8d41875c8a595a5aa8a82c35a92b27c"), - BinaryProvider.Linux(:i686, :glibc, :blank_abi) => ("$bin_prefix/Nettle.i686-linux-gnu.tar.gz", "c9e201a1c707b060432dbed3a93141dafd043f5fa4a22c3e9c2ad5b6906b3f6d"), - BinaryProvider.Windows(:i686, :blank_libc, :blank_abi) => ("$bin_prefix/Nettle.i686-w64-mingw32.tar.gz", "db155ee4e60763480efb718855c109f7d9efa9766fa8e75af6aec30bf302b59f"), - BinaryProvider.Linux(:powerpc64le, :glibc, :blank_abi) => ("$bin_prefix/Nettle.powerpc64le-linux-gnu.tar.gz", "5b8d7fff2e85b2afd3e4b467f2e1df7e6df6b30d7cdde8d3067fffc6fea47682"), - BinaryProvider.MacOS(:x86_64, :blank_libc, :blank_abi) => ("$bin_prefix/Nettle.x86_64-apple-darwin14.tar.gz", "d89e558ab2cbc0da5d051db973a019ef80ddcc73dc0ee2dc6c27bd607957cf83"), - BinaryProvider.Linux(:x86_64, :glibc, :blank_abi) => ("$bin_prefix/Nettle.x86_64-linux-gnu.tar.gz", "d1d028c3d656914ecc426ecdb1bd1df1c120677fe3ecfe74d13f292456d37aae"), - BinaryProvider.FreeBSD(:x86_64, :blank_libc, :blank_abi) => ("$bin_prefix/Nettle.x86_64-unknown-freebsd11.1.tar.gz", "e9ce7318378d4883073edc1764662435753b5d3911443d5ff3bb7d00c8f0811c"), - BinaryProvider.Windows(:x86_64, :blank_libc, :blank_abi) => ("$bin_prefix/Nettle.x86_64-w64-mingw32.tar.gz", "f0fc724c5b383d7b2411d604c868f43ca78063f4e0eb5377360d23565224ecee"), -) - -# Install unsatisfied or updated dependencies: -unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) -if haskey(download_info, platform_key()) - url, tarball_hash = download_info[platform_key()] - if unsatisfied || !isinstalled(url, tarball_hash; prefix=prefix) - # Download and install binaries - install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) - end -elseif unsatisfied - # If we don't have a BinaryProvider-compatible .tar.gz to download, complain. - # Alternatively, you could attempt to install from a separate provider, - # build from source or something more even more ambitious here. - error("Your platform $(triplet(platform_key())) is not supported by this package!") -end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products) diff --git a/src/Nettle.jl b/src/Nettle.jl index c315fd7..367505e 100644 --- a/src/Nettle.jl +++ b/src/Nettle.jl @@ -1,22 +1,11 @@ module Nettle - -# Load libnettle from our deps.jl -const depsjl_path = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl") -if !isfile(depsjl_path) - error("Nettle not installed properly, run Pkg.build(\"Nettle\"), restart Julia and try again") -end -include(depsjl_path) +using Nettle_jll, Libdl include("hash_common.jl") include("hash.jl") include("hmac.jl") include("cipher.jl") -function __init__() - # Always check your dependencies that live in `deps.jl` - check_deps() -end - # SnoopCompile acceleration include("precompile.jl") _precompile_() diff --git a/src/precompile.jl b/src/precompile.jl index a58982c..63a2cc6 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -22,5 +22,4 @@ function _precompile_() precompile(Nettle.update!, (Nettle.HMACState, String,)) precompile(Nettle.encrypt, (String, Vector{UInt8}, Vector{UInt8},)) precompile(Nettle.hexdigest!, (Nettle.Hasher,)) - precompile(Nettle.__init__, ()) end From 888beeb6a3646225de2b6ac631b8739ae9055b5c Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 2 Apr 2020 15:55:53 -0700 Subject: [PATCH 2/3] Upgrade CI --- .travis.yml | 27 +++++++-------------------- appveyor.yml | 39 --------------------------------------- 2 files changed, 7 insertions(+), 59 deletions(-) delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 82b9aa6..6157d4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,13 @@ language: julia os: - - osx - - linux + - osx + - linux + - windows julia: - - 0.7 - - 1.0 - - nightly - -# # uncomment the following lines to allow failures on nightly julia -# # (tests will run but not make your overall status red) -# matrix: -# allow_failures: -# - julia: 0.7 -# - julia: 1.0 -# - julia: nightly + - 1.3 + - 1.4 + - nightly notifications: - email: false - -after_success: - # submit test coverage - - cd ${TRAVIS_BUILD_DIR} - - julia -e 'using Pkg; Pkg.add("Coverage")' - - julia -e 'using Coverage; Coveralls.submit(Coveralls.process_folder())' + email: false diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7fca40b..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,39 +0,0 @@ -environment: - matrix: - - julia_version: 0.7 - - julia_version: 1.0 - - julia_version: latest - -platform: - - x86 # 32-bit - - x64 # 64-bit - -# # uncomment the following lines to allow failures on nightly julia -# # (tests will run but not make your overall status red) -# matrix: -# allow_failures: -# - julia_version: 0.7 -# - julia_version: 1.0 -# - julia_version: latest - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" From f692490885c811a9d001385fac098e4587bce5e0 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 2 Apr 2020 16:00:19 -0700 Subject: [PATCH 3/3] Keep coverage on codecov --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6157d4a..a22fc4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,3 +11,6 @@ julia: notifications: email: false + +after_success: + - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())';