-
Notifications
You must be signed in to change notification settings - Fork 17
Use Guile-Gcrypt instead of 'openssl' to compute HMACs. #5
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
base: master
Are you sure you want to change the base?
Conversation
|
Hi! Wow, it is so good to avoid using openssl client tool! Let me test the change on my side. Thank you very much! |
| ``` | ||
| $ wget https://notabug.org/cwebber/guile-gcrypt/archive/v0.1.0.tar.gz | ||
| $ tar xvf v0.1.0.tar.gz | ||
| $ cd guile-gcrypt-0.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get guile-gcrypt folder after unpacking
I installed (Ubuntu 18.04) guile-2.2-dev and texinfo and executed
./configure --prefix=/usr/ --with-libgcrypt-libdir=/usr/lib/x86_64-linux-gnu/ and it worked, but make returns an error:
cd "$am__cwd"; \
if /bin/bash /home/jerry/Downloads/guile-gcrypt/build-aux/missing makeinfo -I . \
-o guile-gcrypt.info guile-gcrypt.texi; \
then \
rc=0; \
CDPATH="${ZSH_VERSION+.}:" && cd .; \
else \
rc=$?; \
CDPATH="${ZSH_VERSION+.}:" && cd . && \
$restore $backupdir/* `echo "./guile-gcrypt.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
./pre-inst-env compile -Wunbound-variable -Warity-mismatch -Wformat -o "gcrypt/base16.go" "gcrypt/base16.scm"
./pre-inst-env: 33: exec: compile: not found
Makefile:1410: recipe for target 'gcrypt/base16.go' failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the guild program wasn't found. Did autoreconf emit warnings? What does grep GUILD config.log return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autoreconf:
jerry@MS-7721:~/Downloads/guile-gcrypt$ autoreconf -vfi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
guild:
jerry@MS-7721:~/Downloads/guile-gcrypt$ guild --version
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling /usr/bin/guild
;;; compiled /home/jerry/.cache/guile/ccache/2.2-LE-8-3.A/usr/bin/guild.go
guild (GNU Guile) 2.2.3
Copyright (C) 2017 Free Software Foundation, Inc.
hm...
jerry@MS-7721:~/Downloads/guile-gcrypt$ grep GUILD config.log
GUILD=''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fishy, indeed! What does configure show when looking for guild?
I see this:
$ grep -i guild ~/src/guile-gcrypt/config.log
configure:2633: checking for guild
configure:2663: result: /home/ludo/.guix-profile/bin/guild
ac_cv_path_GUILD=/home/ludo/.guix-profile/bin/guild
GUILD='/home/ludo/.guix-profile/bin/guild'
GUILE_TOOLS='/home/ludo/.guix-profile/bin/guild'
As a workaround you can always run:
./configure ac_cv_path_GUILD=/usr/bin/guild
... but that shouldn't be necessary.
HTH!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it is looking for guld-2.2 command
jerry@MS-7721:~/Downloads/guile-gcrypt$ grep -i guild config.log
configure:2645: checking for guild-2.2
GUILD=''
Interesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand why it searches for guild-2.2.
guile.m4:
# This macro looks for programs @code{guile} and @code{guild}, setting
# variables @var{GUILE} and @var{GUILD} to their paths, respectively.
# The macro will attempt to find @code{guile} with the suffix of
# @code{-X.Y}, followed by looking for it with the suffix @code{X.Y}, and
# then fall back to looking for @code{guile} with no suffix. If
# @code{guile} is still not found, signal an error. The suffix, if any,
# that was required to find @code{guile} will be used for @code{guild}
# as well.
jerry@MS-7721:~$ ls -al /usr/bin/guile*
lrwxrwxrwx 1 root root 23 июл 6 19:47 /usr/bin/guile -> /etc/alternatives/guile
lrwxrwxrwx 1 root root 43 июл 17 16:42 /usr/bin/guile-2.2 -> ../lib/x86_64-linux-gnu/guile-2.2/bin/guile
-rwxr-xr-x 1 root root 6822 июл 17 16:42 /usr/bin/guile-config
-rwxr-xr-x 1 root root 3246 июл 17 16:42 /usr/bin/guile-snarf
lrwxrwxrwx 1 root root 5 июл 17 16:42 /usr/bin/guile-tools -> guild
So it finds guile-2.2 and therefore thinks that suffix for guild should be the same.
PS It seems that your workaround worked:
./configure --prefix=/usr/ --with-libgcrypt-libdir=/usr/lib/x86_64-linux-gnu/ ac_cv_path_GUILD=/usr/bin/guild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I get this message (guile can't find hmac module in the current dir?)
;;; compiling /home/jerry/.local/share/jupyter/kernels/guile/guile-jupyter-kernel.scm
;;; WARNING: compilation of /home/jerry/.local/share/jupyter/kernels/guile/guile-jupyter-kernel.scm failed:
;;; no code for module (hmac)
Backtrace:
11 (primitive-load "/home/jerry/.local/share/jupyter/kerne…")
In ice-9/eval.scm:
721:20 10 (primitive-eval (use-modules (simple-zmq) (json) (#) # …))
In ice-9/psyntax.scm:
1235:36 9 (expand-top-sequence ((use-modules (simple-zmq) (#) …)) …)
1182:24 8 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
285:10 7 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) …)
In ice-9/boot-9.scm:
3365:20 6 (process-use-modules _)
222:29 5 (map1 (((simple-zmq)) ((json)) ((hmac)) ((srfi #)) (#)))
222:29 4 (map1 (((json)) ((hmac)) ((srfi srfi-1)) ((srfi #))))
222:17 3 (map1 (((hmac)) ((srfi srfi-1)) ((srfi srfi-13))))
3366:31 2 (_ ((hmac)))
2791:6 1 (resolve-interface _ #:select _ #:hide _ #:prefix _ # _ …)
In unknown file:
0 (scm-error misc-error #f "~A ~S" ("no code for modu…" …) …)
ERROR: In procedure scm-error:
no code for module (hmac)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggests that hmac.scm is not in Guile's module search path.
To fix that, you need to either set GUILE_LOAD_PATH to contain the current directory (it's not there by default, for security reasons), or to pass the -L flag to guile. See the manual for details.
HTH!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Yes I think I can avoid this, but I'd like to provide an installation process to users as easy as it can be. I'm afraid that people can be disappointed if the process is too difficult. Can we do anything in order to make it smoother?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello!
I understand your concern. I feel like ./configure && make && make install is as "simple as it can be" in terms of build systems and "least surprise", but I agree that even that can be daunting to some users.
To me, given my own biases ;-), the best answer to such questions is packaging: guile-gcrypt is already in openSuSE, in AUR (unofficial Arch packages), and in Guix. If more distros ship it, then it'll be easier for users building guile-kernel from source.
In the meantime, I don't have a better answer!
Ludo'.
Hello!
This change replaces the dependency on OpenSSL with a dependency on Guile-Gcrypt. It also makes
hmac.scma proper module (we should consider doing this fortools.scmas well.)Thanks for this nice kernel!
Ludo'.