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

Support client-only build #494

Closed
wants to merge 14 commits into from
Closed

Conversation

lslebodn
Copy link
Contributor

How to test:

  • autoreconf -if
  • ./configure --disable-server
  • make srpms
  • mock --rebuild dist/rpms/freeipa-4.4.90.*.src.rpm --resultdir .
  • mock --rebuild dist/rpms/freeipa-4.4.90.*.src.rpm --resultdir . --without=server

Lukas Slebodnik added 13 commits February 22, 2017 09:39
libini_config is used only in ipa-getkeytab and it uses
only functions from libini_config-1.1

  sh$ objdump -p /usr/sbin/ipa-getkeytab | grep INI_CONFIG
      0x00acdc20 0x00 04 INI_CONFIG_1.1.0

There is not any reason ho have dependency for higher version and lower
dependency will allow to build client only on older distributions.
libpopt added pkg-config file in 1.16 but there are still distributions
which has older version of library (el6, el7). And new features from
libpopt are not used anywhere. Configure should try to detect as much as
possible and users should not use workarounds with explicitely enabled
variables as parameters e.g.
   ./configure POPT_LIBS="-lpopt "
The pkg-config files for xmlrpc_c libraries are shipped just
in fedora/rhel due to downstream patch. Debian does not have
pkg-config files for xmlrpc_c. Therefore we need to fallback to older
method of detection XMLRPC_*FLAGS which was reverted
by the commit 1e0143c
The gettext provided macro AM_GNU_GETTEXT checks for required
header file "libintl.h" and also provide variable with linker flags
LTLIBINTL. The detection is more robus an platform independent.
It can also detect situation when gettext is not part of glibc
and external library is required.

This patch simplify detection and improve portability.
It was used to replace value in ipa-opts.socket but it was removed
in the commit d05d111
It is required for installation of python modules therefore
it should be checked at aonfigure time.

  GEN      ipasetup.py
make[3]: Leaving directory `/workdir/freeipa'
cd .; /usr/bin/python setup.py \
        "--verbose" \
        build \
        --build-base "/workdir/freeipa/ipaclient/build"
Traceback (most recent call last):
  File "setup.py", line 29, in <module>
    from ipasetup import ipasetup  # noqa: E402
  File "/workdir/freeipa/ipasetup.py", line 20, in <module>
    from setuptools.command.build_py import build_py as setuptools_build_py
ImportError: No module named setuptools.command.build_py
"dirsrv/slapi-plugin.h" is unnecessary for build of ipa_pwd.
This patch allow us to move DIRSRV to daemon only dependencies
CentOS and rhel are equivalent but configure time detection failed
  configure: error: IPA platform centos is not supported
Most of autoconf macros has implicit parameters
[action-if-found], [action-if-not-found]. They were not used
on many places and configure script tried to check result of tests
from ac_cv_* variables. Sometimes variable was checked twice
and there was error in both cases. (the 2nd check was a dead code)
e.g. ac_cv_header_dirsrv_slapi-plugin_h

This patch also fixed mixed horizontal tabs and spaces.
It also fixes ver long lines which was difficult to read.

Resolves:
https://fedorahosted.org/freeipa/ticket/6517
The separate file server.m4/unit_tests.m4 were created as a copy of
configure.ac and client parts from server.m4/unit_tests.m4
and server parts from configure.ac were removed in file diff tool.

Resolves:
https://fedorahosted.org/freeipa/ticket/6517
This patch adds new configure time option --enable-server
which is enabled by default.

If you want to run client-only part of freeIPA then you can run
--enable-server=no or --disable-server. Disabling server also disable
related lint checks to reduce dependencies for client-only build.

Resolves:
https://fedorahosted.org/freeipa/ticket/6517
Some packages from client-only build were in server
section and vice versa.

There are few unused build requirements:  autoconf,  automake,
libtool, gettext-devel because autoreconf is not executes as part of
build process. But They might be usefull in downstream when configure
related patches are backported.

Resolves:
https://fedorahosted.org/freeipa/ticket/6517
* the make target client-check was removed as part of build
  system refactoring 0a17155
* the directory /usr/share/ipa was removed from freeipa-client-common
  because packge didn't contain and files there
* python3 installation of client-only build was fixed as well

Resolves:
https://fedorahosted.org/freeipa/ticket/6517
@tkrizek
Copy link
Contributor

tkrizek commented Feb 22, 2017

I'm not able to run autoreconf, it fails with the following error:

configure.ac:447: error: required file 'init/tmpfilesd/Makefile.in' not found
asn1/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
autoreconf: automake failed with exit status: 1

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@tiran
Copy link
Member

tiran commented Feb 22, 2017

NACK on aece4c3

We compromised on --without-ipatests with installation of ipatests defaulting to true. The compromose was already ACKed by @simo5

@tkrizek
Copy link
Contributor

tkrizek commented Feb 22, 2017

@lslebodn My bad, there was some leftover stuff that git clean -dfx didn't clear for some reason.

Nevertheless, this does work and allows a client only, as well as installing tests with --with-tests option. The mock build when run with --without=server does install less dependencies.

But I'm not acking, because of the controversy with the --with-tests option (see #364).

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@tiran
Copy link
Member

tiran commented Feb 22, 2017

There are two reasons we decided on --without-ipatests:

  • --with-tests / --without-tests is technically not correct. We still compile C tests. The flag is about the component ipatests, so let's call it --without-ipatests.
  • --with-ipatests / --without-ipatests is only relevant for downstream packaging to make the life of a packager a bit easier. FreeIPA is an upstream first project. The default settings for configure should be convenient and user-friendly for upstream developers and users.

The final decision has been made.

Packagers does not have a use case for installation of
ipatests with client only build because integration tests
require server and unit tests can be executed as part of build process.

But tox uses virtualenv and unit test must be installed for execution.
This patch add new configure time option to install tests.
@tiran
Copy link
Member

tiran commented Feb 22, 2017

NACK on 42fb9b1

Either way, this should be handled by a separate PR and not mixed with client-only builds.

Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

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

see comments

[HAVE_LIBPDB=1],
[AC_MSG_ERROR([Neither libpdb nor libsamba-passdb does have make_pdb_method])],
[$SAMBA40EXTRA_LIBPATH])
AC_MSG_CHECKING($(basename $PYTHON) module setuptools )
Copy link
Member

Choose a reason for hiding this comment

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

Please put this in a separate PR. This is not related to --disable-server.

-name '*.h' -print dnl
> po/POTFILES.in && dnl
cd "${find_start_pwd}"])
[find_start_pwd=`pwd` && dnl
Copy link
Member

Choose a reason for hiding this comment

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

Don't mix reformatting with new features. Create another PR for cleanups.

if test "x${IPAPLATFORM}" == "x"; then
AC_MSG_ERROR([unable to find ID variable in /etc/os-release])
fi
if test -r "/etc/os-release"; then
Copy link
Member

Choose a reason for hiding this comment

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

Don't mix reformatting with new features. Create another PR for cleanups.

else
AC_MSG_RESULT([yes])
fi
AC_MSG_CHECKING([if source directory is a Git reposistory])
Copy link
Member

Choose a reason for hiding this comment

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

Don't mix reformatting with new features. Create another PR for cleanups.

[Vendor string used by package system, e.g. "-1.fc24"]),
[VENDOR_SUFFIX=${withval}],
[VENDOR_SUFFIX=""])
[AS_HELP_STRING([--with-vendor-suffix=STRING],
Copy link
Member

Choose a reason for hiding this comment

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

Don't mix reformatting with new features. Create another PR for cleanups.

fi
])
AC_ARG_ENABLE([more-warnings],
[AC_HELP_STRING([--enable-more-warnings],
Copy link
Member

Choose a reason for hiding this comment

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

Don't mix reformatting with new features. Create another PR for cleanups.

@@ -843,20 +856,25 @@ pushd %{_builddir}/freeipa-%{version}-python3
(cd ipalib && %make_install)
(cd ipaplatform && %make_install)
(cd ipapython && %make_install)
%if ! %{ONLY_CLIENT}
Copy link
Member

Choose a reason for hiding this comment

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

Why is --without-ipatests required at all when you don't install ipatests in ONLY_CLIENT builds any way? This shows that packaging is easily possible without the new argument.

CC @simo5

@@ -1 +1,3 @@
include $(top_srcdir)/Makefile.python.am

EXTRA_DIST=centos
Copy link
Member

Choose a reason for hiding this comment

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

NACK, see comment

configure.ac Outdated
fi

AC_ARG_WITH([tests],
[AC_HELP_STRING([--with-tests],
Copy link
Member

Choose a reason for hiding this comment

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

NACK, without-ipatests

configure.ac Outdated
[Whether to install ipatests. ]
[Default inherited from --disable-server])],
[with_tests=$withval],
[with_tests=$enable_server])
Copy link
Member

Choose a reason for hiding this comment

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

NACK, default to true, not $enable_server.

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@tiran
Copy link
Member

tiran commented Feb 22, 2017

You assumption is incorrect. ipatests does not depend on ipaserver, https://github.com/freeipa/freeipa/blob/master/ipatests/setup.py#L61

        install_requires=[
            "cryptography",
            "dnspython",
            "gssapi",
            "ipaclient",
            "ipalib",
            "ipaplatform",
            "ipapython",
            "nose",
            "polib",
            "pyldap",
            "pytest",
            "pytest_multihost",
            "python-nss",
            "six",
],

Only some subcomponents of ipatests do depend on the ipaserver package or a running server for integration tests, https://github.com/freeipa/freeipa/blob/master/ipatests/setup.py#L77

        extras_require={
            "integration": ["dbus-python", "pyyaml", "ipaserver"],
            "ipaserver": ["ipaserver"],
            "webui": ["selenium", "pyyaml", "ipaserver"],
            "xmlrpc": ["ipaserver"],
}

Regarding pylint and jsl, neither of the components should be a build requirement. But that's off-topic for this PR. Please discuss the matter in https://fedorahosted.org/freeipa/ticket/6604 .

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@tiran
Copy link
Member

tiran commented Feb 22, 2017

You are aware that your example code checks the wrong code? It is testing in-tree sources, not the actual sources that get packaged and installed.

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@tiran
Copy link
Member

tiran commented Feb 22, 2017

python-requests is a bad example because it suffers from the same issue as IPA.

A better example is any other modern Python project like cryptography. It runs tests with installed files, not in-tree files.

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@lslebodn
Copy link
Contributor Author

lslebodn commented Feb 22, 2017 via email

@pvoborni pvoborni added the rejected Pull Request has been rejected label Feb 22, 2017
@pvoborni
Copy link
Member

#364 was pushed.

@tjaalton
Copy link
Contributor

+ack on the xmlrpc-c detection patch at least, I need that on Debian

@tjaalton
Copy link
Contributor

sorry, I just saw PR#600 which is a subset of this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rejected Pull Request has been rejected
Projects
None yet
5 participants