Skip to content

Commit

Permalink
Merge pull request #1395 from giuseppe/drop-gcrypt-dependency
Browse files Browse the repository at this point in the history
Drop gcrypt dependency and use blake3
  • Loading branch information
rhatdan committed Jan 22, 2024
2 parents 84f5eec + 8d96f08 commit 0dca3a0
Show file tree
Hide file tree
Showing 20 changed files with 1,524 additions and 80 deletions.
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ endif
check_LIBRARIES = libcrun_testing.a

libcrun_SOURCES = src/libcrun/utils.c \
src/libcrun/blake3/blake3.c \
src/libcrun/blake3/blake3_portable.c \
src/libcrun/cgroup-cgroupfs.c \
src/libcrun/cgroup-resources.c \
src/libcrun/cgroup-setup.c \
Expand Down Expand Up @@ -138,6 +140,7 @@ crun_LDFLAGS = $(CRUN_LDFLAGS)
endif

EXTRA_DIST = COPYING COPYING.libcrun README.md NEWS SECURITY.md rpm/crun.spec autogen.sh \
src/libcrun/blake3/blake3_impl.h src/libcrun/blake3/blake3.h \
src/crun.h src/list.h src/run.h src/delete.h src/kill.h src/pause.h src/unpause.h \
src/create.h src/start.h src/state.h src/exec.h src/oci_features.h src/spec.h src/update.h src/ps.h \
src/checkpoint.h src/restore.h src/libcrun/seccomp_notify.h src/libcrun/seccomp_notify_plugin.h \
Expand Down Expand Up @@ -290,7 +293,7 @@ generate-mount_flags.c: src/libcrun/mount_flags.perf

clang-format:
# do not format files that were copied into the source directory.
git ls-files src tests | grep -E "\\.[hc]" | grep -v "chroot_realpath.c\|cloned_binary.c\|signals.c\|mount_flags.c" | xargs clang-format -style=file -i
git ls-files src tests | grep -E "\\.[hc]" | grep -v "blake3\|chroot_realpath.c\|cloned_binary.c\|signals.c\|mount_flags.c" | xargs clang-format -style=file -i

shellcheck:
shellcheck tests/*/*.sh contrib/*.sh
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ These dependencies are required for the build:

```console
$ sudo dnf install -y make python git gcc automake autoconf libcap-devel \
systemd-devel yajl-devel libseccomp-devel pkg-config libgcrypt-devel \
systemd-devel yajl-devel libseccomp-devel pkg-config \
go-md2man glibc-static python3-libmount libtool
```

Expand All @@ -69,7 +69,7 @@ $ sudo dnf install -y make python git gcc automake autoconf libcap-devel \
```console
$ sudo yum --enablerepo='*' --disablerepo='media-*' install -y make automake \
autoconf gettext \
libtool gcc libcap-devel systemd-devel yajl-devel libgcrypt-devel \
libtool gcc libcap-devel systemd-devel yajl-devel \
glibc-static libseccomp-devel python36 git
```

Expand All @@ -89,7 +89,7 @@ $ export PATH=$PATH:$GOPATH/bin
```console
$ sudo apt-get install -y make git gcc build-essential pkgconf libtool \
libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libyajl-dev \
libgcrypt20-dev go-md2man autoconf python3 automake
go-md2man autoconf python3 automake
```

### Alpine
Expand Down
2 changes: 1 addition & 1 deletion cfg.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ local-checks-to-skip = \
show-vc-list-except:
@$(VC_LIST_EXCEPT)

VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ABOUT-NLS|maint.mk|git.mk|tests.*|COPYING|contrib/.*$$
VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ABOUT-NLS|maint.mk|git.mk|tests.*|COPYING|contrib/.*|src/libcrun/blake3/.*$$

export gl_public_submodule_commit=
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ AM_CONDITIONAL([HAVE_MD2MAN], [test "x$ac_cv_path_MD2MAN" != x])
AC_CHECK_HEADERS([error.h linux/openat2.h stdatomic.h linux/ioprio.h])

AC_CHECK_TYPES([atomic_int], [], [], [[#include <stdatomic.h>]])
AC_CHECK_TYPES([atomic_bool], [], [], [[#include <stdatomic.h>]])

AC_CHECK_FUNCS(copy_file_range fgetxattr statx fgetpwent_r issetugid memfd_create)

Expand Down Expand Up @@ -90,9 +89,6 @@ AS_IF([test "x$enable_caps" != "xno"], [
])
])

dnl libgcrypt
AC_SEARCH_LIBS([gcry_check_version], [gcrypt], [AC_DEFINE([HAVE_GCRYPT], 1, [Define if gcrypt is available])], [])

dnl dl
AC_ARG_ENABLE([dl], AS_HELP_STRING([--disable-dl], [Disable dynamic libraries support]))
AS_IF([test "x$enable_dl" != "xno"], [
Expand Down
3 changes: 1 addition & 2 deletions nix/derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ with pkgs; stdenv.mkDerivation {
which
];
buildInputs = [
gcrypt
glibc
glibc.static
libcap
Expand All @@ -32,7 +31,7 @@ with pkgs; stdenv.mkDerivation {
export LDFLAGS='-s -w -static-libgcc -static'
export EXTRA_LDFLAGS='-s -w -linkmode external -extldflags "-static -lm"'
export CRUN_LDFLAGS='-all-static'
export LIBS='${lib.optionalString enableCriu "${criu}/lib/libcriu.a"} ${glibc.static}/lib/libc.a ${glibc.static}/lib/libpthread.a ${glibc.static}/lib/librt.a ${lib.getLib libcap}/lib/libcap.a ${lib.getLib libseccomp}/lib/libseccomp.a ${lib.optionalString enableSystemd "${lib.getLib libsystemd}/lib/libsystemd.a"} ${yajl}/lib/libyajl.a ${gcrypt}/lib/libgcrypt.a'
export LIBS='${lib.optionalString enableCriu "${criu}/lib/libcriu.a"} ${glibc.static}/lib/libc.a ${glibc.static}/lib/libpthread.a ${glibc.static}/lib/librt.a ${lib.getLib libcap}/lib/libcap.a ${lib.getLib libseccomp}/lib/libseccomp.a ${lib.optionalString enableSystemd "${lib.getLib libsystemd}/lib/libsystemd.a"} ${yajl}/lib/libyajl.a'
'';
buildPhase = ''
patchShebangs .
Expand Down
1 change: 0 additions & 1 deletion nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ in
self: super:
{
criu = (static super.criu);
gcrypt = (static super.libgcrypt);
gpgme = (static super.gpgme);
libassuan = (static super.libassuan);
libgpgerror = (static super.libgpgerror);
Expand Down
Loading

1 comment on commit 0dca3a0

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.