Skip to content
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

libcurl backend #641

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .redhat-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,27 @@ env:
tests:
- make check TESTS=tests/test-rollsum

---

inherit: true
required: true

context: curl

packages:
- pkgconfig(libcurl)

build:
config-opts: >
--prefix=/usr
--libdir=/usr/lib64
--enable-installed-tests
--enable-gtk-doc
--with-curl

tests:
- make check
- gnome-desktop-testing-runner -p 0 ostree

artifacts:
- test-suite.log
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sudo: required
env:
- ci_distro=ubuntu ci_suite=trusty ci_test=no # TODO: use libcurl on this
- ci_docker=debian:jessie-slim ci_distro=debian ci_suite=jessie
- ci_docker=debian:jessie-slim ci_distro=debian ci_suite=jessie ci_configopts="--with-curl"
- ci_docker=debian:stretch-slim ci_distro=debian ci_suite=stretch ci_test=no # TODO gpgme flake https://github.com/ostreedev/ostree/pull/664#issuecomment-276033383
- ci_docker=ubuntu:xenial ci_distro=ubuntu ci_suite=xenial

Expand Down
17 changes: 15 additions & 2 deletions Makefile-libostree.am
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,31 @@ libostree_1_la_CFLAGS += $(LIBSYSTEMD_CFLAGS)
libostree_1_la_LIBADD += $(LIBSYSTEMD_LIBS)
endif

if USE_LIBSOUP
if USE_CURL_OR_SOUP
libostree_1_la_SOURCES += \
src/libostree/ostree-fetcher.h \
src/libostree/ostree-fetcher.c \
src/libostree/ostree-fetcher-util.h \
src/libostree/ostree-fetcher-util.c \
src/libostree/ostree-fetcher-uri.c \
src/libostree/ostree-metalink.h \
src/libostree/ostree-metalink.c \
$(NULL)
endif

if USE_CURL
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-curl.c \
src/libostree/ostree-soup-uri.h src/libostree/ostree-soup-uri.c \
src/libostree/ostree-soup-form.c \
$(NULL)
libostree_1_la_CFLAGS += $(OT_DEP_CURL_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_CURL_LIBS)
else
if USE_LIBSOUP
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-soup.c
libostree_1_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
libostree_1_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS)
endif
endif

if USE_LIBMOUNT
libostree_1_la_CFLAGS += $(OT_DEP_LIBMOUNT_CFLAGS)
Expand Down
30 changes: 20 additions & 10 deletions Makefile-ostree.am
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ ostree_SOURCES += \
src/ostree/ot-remote-builtin-summary.c \
$(NULL)

if USE_LIBSOUP
ostree_SOURCES += \
src/ostree/ot-remote-builtin-add-cookie.c \
src/ostree/ot-remote-builtin-delete-cookie.c \
src/ostree/ot-remote-builtin-list-cookies.c \
$(NULL)

if USE_CURL_OR_SOUP
ostree_SOURCES += src/ostree/ot-remote-builtin-add-cookie.c \
src/ostree/ot-remote-builtin-delete-cookie.c \
src/ostree/ot-remote-builtin-list-cookies.c \
src/ostree/ot-remote-cookie-util.h \
src/ostree/ot-remote-cookie-util.c \
$(NULL)
endif

src/ostree/parse-datetime.c: src/ostree/parse-datetime.y Makefile
Expand All @@ -112,15 +114,23 @@ ostree_CFLAGS = $(ostree_bin_shared_cflags)
ostree_LDADD = $(ostree_bin_shared_ldadd) libbsdiff.la libostree-kernel-args.la $(LIBSYSTEMD_LIBS)


if USE_LIBSOUP
ostree_SOURCES += src/ostree/ot-builtin-pull.c src/ostree/ot-builtin-trivial-httpd.c
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
if USE_CURL_OR_SOUP
ostree_SOURCES += src/ostree/ot-builtin-pull.c
endif

if USE_LIBSOUP
# Eventually once we stop things from using this, we should support disabling this
ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c
pkglibexec_PROGRAMS += ostree-trivial-httpd
ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c
ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)

if !USE_CURL
# This is necessary for the cookie jar bits
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
endif
endif

if USE_LIBARCHIVE
Expand Down
30 changes: 26 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,29 @@ PKG_CHECK_MODULES(OT_DEP_ZLIB, zlib)
dnl We're not actually linking to this, just using the header
PKG_CHECK_MODULES(OT_DEP_E2P, e2p)

dnl Arbitrary version that's in CentOS7.2 now
CURL_DEPENDENCY=7.29.0
AC_ARG_WITH(curl,
AS_HELP_STRING([--with-curl], [Use libcurl @<:@default=no@:>@]),
[], [with_curl=no])
AS_IF([test x$with_curl != xno ], [
PKG_CHECK_MODULES(OT_DEP_CURL, libcurl >= $CURL_DEPENDENCY)
with_curl=yes
AC_DEFINE([HAVE_LIBCURL], 1, [Define if we have libcurl.pc])
dnl Currently using libcurl requires soup for trivial-httpd for tests
with_soup_default=yes
], [with_soup_default=check])
AM_CONDITIONAL(USE_CURL, test x$with_curl != xno)
if test x$with_curl = xyes; then OSTREE_FEATURES="$OSTREE_FEATURES +libcurl"; fi

dnl When bumping the libsoup-2.4 dependency, remember to bump
dnl SOUP_VERSION_MIN_REQUIRED and SOUP_VERSION_MAX_ALLOWED in
dnl Makefile.am
SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
AC_ARG_WITH(soup,
AS_HELP_STRING([--with-soup], [Use libsoup @<:@default=yes@:>@]),
[], [with_soup=check])
AS_IF([test x$with_soup != xno ], [
[], [with_soup=$with_soup_default])
AS_IF([test x$with_soup != xno], [
AC_ARG_ENABLE(libsoup_client_certs,
AS_HELP_STRING([--enable-libsoup-client-certs],
[Require availability of new enough libsoup TLS client cert API (default: auto)]),,
Expand Down Expand Up @@ -120,6 +135,14 @@ if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libsoup"; fi
AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno)
AM_CONDITIONAL(HAVE_LIBSOUP_CLIENT_CERTS, test x$have_libsoup_client_certs = xyes)

AS_IF([test x$with_curl = xyes && test x$with_soup = xno], [
AC_MSG_ERROR([Curl enabled, but libsoup is not; libsoup is needed for tests])
])
AM_CONDITIONAL(USE_CURL_OR_SOUP, test x$with_curl != xno || test x$with_soup != xno)
AS_IF([test x$with_curl != xno || test x$with_soup != xno],
[AC_DEFINE([HAVE_LIBCURL_OR_LIBSOUP], 1, [Define if we have soup or curl])])
AS_IF([test x$with_curl = xyes], [fetcher_backend=curl], [test x$with_soup = xyes], [fetcher_backend=libsoup], [fetcher_backend=none])

m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])
])
Expand Down Expand Up @@ -374,8 +397,7 @@ echo "
introspection: $found_introspection
Rust (internal oxidation): $rust_debug_release
rofiles-fuse: $enable_rofiles_fuse
libsoup (retrieve remote HTTP repositories): $with_soup
libsoup TLS client certs: $have_libsoup_client_certs
HTTP backend: $fetcher_backend
SELinux: $with_selinux
systemd: $have_libsystemd
libmount: $with_libmount
Expand Down
Loading