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

Client-only builds with --disable-server #364

Closed
wants to merge 4 commits into from

Conversation

tiran
Copy link
Member

@tiran tiran commented Jan 3, 2017

https://fedorahosted.org/freeipa/ticket/6517

Simple approach to reduce dependencies for client only builds. I simply wrapped all daemon, init and install dependencies in AM_COND_IF(). I'm open to suggestions. Let the bike shedding begin!

@tkrizek
Copy link
Contributor

tkrizek commented Jan 11, 2017

Could you please extend V4/Build system refactoring to include steps describing how to perform client-only build?

Also, is this supposed to build the freeipa-client rpm package? I wasn't able to build the rpm ( *** No rule to make target 'distdir'. Stop.).

Or does it only support make + make install? When I tried to do this it also produced ipaserver and ipatests directories. It was probably a misconfiguration on my side.

Please provide instructions on how to do a proper client-only build.

@tiran
Copy link
Member Author

tiran commented Jan 11, 2017

The PR only affects make install, Python packaging and integration efforts. The goal is to reduce the amount of necessary build dependencies for installation and packaging of Python wheels or for developers that are only interested to build ipa-client locally.

At the moment it is not possible to build FreeIPA without Samba, talloc, tevent, 389 DS, systemd and a couple of more packages. The dependency tree is rather heavy. These dependencies are not relevant for clients, though.

I haven't touched RPM builds deliberately. RPM spec can be adjusted in a subsequent PR. It's not relevant for me.

@tkrizek
Copy link
Contributor

tkrizek commented Jan 11, 2017

The extra dependencies are indeed not necessary with this change.

However, make install produces directories like /usr/lib/python2.7/site-packages/ipaserver, /usr/lib/python2.7/site-packages/ipatests, ... I don't think these should be present when doing a client-only build.

@tiran
Copy link
Member Author

tiran commented Jan 11, 2017

Nit-pick: A build does not produce any files outside the build environment. Of course make install produces the files -- unless you change the prefix with ./configure --prefix.

@tkrizek
Copy link
Contributor

tkrizek commented Jan 17, 2017

I'm not really experienced with autotools, so I do not want to ack this PR without someone else taking a look. I'm also not sure about the best practices in this area. Perhaps @lslebodn could share his opinion on this change?

@lslebodn
Copy link
Contributor

I think it would be simpler to read the code without to many AM_COND_IF(). IMHO it would be simpler to move C-related part to separate file (e.g. server_daemons.m4) an conditionally include the file with m4_include.

I checked it very briefly; I might miss something. How do you want to handle python server part?

@tiran
Copy link
Member Author

tiran commented Jan 17, 2017

@lslebodn I like the idea to move the server related header and lib detection to a separate m4 file.

In server-less mode, I plan to ignore the Python server part completely.

@lslebodn
Copy link
Contributor

I fine with ignoring python related parts; but it should be documented. But you might ask other freeIPA developers. (maybe on freeipa-devel)

@tiran
Copy link
Member Author

tiran commented Jan 17, 2017

@lslebodn I think you misunderstood me. The PR adds a new build flavor that ignores and skips the any server-related steps of the build process. The fact that this PR ignores the server part is actually a a feature. :)

The last version of the patch now skips ipaserver subdir completely, too.

@lslebodn
Copy link
Contributor

lslebodn commented Feb 8, 2017

make dist failed if configure was executed with --disable-server

make[3]: Leaving directory '/workdir/freeipa/po'
make[2]: Leaving directory '/workdir/freeipa/po'
 (cd daemons && make  top_distdir=../freeipa-4.4.90.dev201702081623+git9da17b545 distdir=../freeipa-4.4.90.dev201702081623+git9da17b545/daemons \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory '/workdir/freeipa/daemons'
make[2]: *** No rule to make target 'distdir'.  Stop.
make[2]: Leaving directory '/workdir/freeipa/daemons'
make[1]: *** [Makefile:707: distdir] Error 1
make[1]: Leaving directory '/workdir/freeipa'
make: *** [Makefile:806: dist] Error 2

Do we care?

Makefile.am Outdated

if ENABLE_SERVER
SUBDIRS += daemons init install ipaserver
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can move ipatests as well because they require server.

Copy link
Member Author

Choose a reason for hiding this comment

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

Only some parts of the test suite require ipaserver. I have a branch that can execute just the client tests with tox.

Copy link
Contributor

Choose a reason for hiding this comment

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

ipatests/test_xmlrpc/ and ipatests/test_integration/ requires them

@lslebodn
Copy link
Contributor

lslebodn commented Feb 8, 2017

See inline comment and issue above; otherwise LGTM.

@tkrizek
Copy link
Contributor

tkrizek commented Feb 8, 2017

@tiran Do you need make dist for anything?

I'm not aware of any plans to release client-only IPA sources, so I don't think it's needed.

@tiran
Copy link
Member Author

tiran commented Feb 8, 2017

@tomaskrizek @lslebodn Although I don't need make dist, you made me aware of a bug in Makefile.am. automake and += do not mix well. I moved the list into a new var SERVER_SUBDIRS.

Makefile.am Outdated
IPACLIENT_SUBDIRS = ipaclient ipalib ipapython
SUBDIRS = asn1 util client contrib daemons init install $(IPACLIENT_SUBDIRS) ipaplatform ipaserver ipatests po
SUBDIRS = asn1 util client contrib $(IPACLIENT_SUBDIRS) ipaplatform ipatests po $(SERVER_SUBDIR)
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably a typo here, missing S at the end of $SERVER_SUBDIR.

configure.ac Outdated
install/updates/Makefile
install/restart_scripts/Makefile
install/wsgi/Makefile
install/oddjob/Makefile
ipaclient/Makefile
Copy link
Contributor

Choose a reason for hiding this comment

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

This change caused me troubles after fixing typo in SERVER_SUBDIR.
Why did you move them?

Copy link
Contributor

@lslebodn lslebodn Feb 8, 2017

Choose a reason for hiding this comment

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

  autoreconf -if
  ./configure --disable-server
  make dist

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved the makefiles because they use autoconf vars that are not available in --disable-server mode. I see two ways to solve the problem:

  • still generate all makefiles although some are potentially broken
  • set DIST_SUBDIRS = $(SUBDIRS)

https://www.gnu.org/software/automake/manual/html_node/SUBDIRS-vs-DIST_005fSUBDIRS.html

@tkrizek
Copy link
Contributor

tkrizek commented Feb 9, 2017

Server build works now, but there's still the make dist issue discussed above.

@tiran tiran force-pushed the client-only branch 2 times, most recently from 7dc6685 to 95026f5 Compare February 9, 2017 10:01
@tiran
Copy link
Member Author

tiran commented Feb 9, 2017

I followed @lslebodn advice and changed the PR a bit. I now generate all Makefiles again to fix the make dist issue. Some of the Makefile are not working correctly because some vars are declared empty (e.g. header locations, libs and so on). Since they are not included in SUBDIRS, they are not used in make. make dist uses DIST_SUBDIRS and does not depend on the missing vars.

@pvoborni
Copy link
Member

I still think that this use case needs to be documented in http://www.freeipa.org/page/V4/Build_system_refactoring#How_to_Use .

IMHO make dist can fail with --disable-server. Use case for make dist is releasing and there is no point to do release without server bitw. But make sure to document it and test that make dist works without it ;) .

@lslebodn
Copy link
Contributor

lslebodn commented Feb 10, 2017 via email

@pvoborni
Copy link
Member

I still fail to see why we should care about make dist with configure --disable-server this is not a combination of options which should be used together, there is no point in it except theoretical exercise.

then I will need to send PR to fix client-only build and it will not install ipatests with --disable-server.

Why?

@lslebodn
Copy link
Contributor

lslebodn commented Feb 17, 2017 via email

@lslebodn
Copy link
Contributor

lslebodn commented Feb 17, 2017 via email

@tiran
Copy link
Member Author

tiran commented Feb 17, 2017

Thanks for your contribution. I added your patch to my PR. On my system I ran into a minor issue. Some C99 types like uint8_t were not defined and I had to include stdint.h.

By the way I'm just going to ignore your snidely and snarky comment.

tiran and others added 4 commits February 21, 2017 20:36
"dirsrv/slapi-plugin.h" is unnecessary for build of ipa_pwd.
This patch allow us to move DIRSRV to daemon only dependencies
Signed-off-by: Christian Heimes <cheimes@redhat.com>
--without-ipatests skips building and installation of the ipatests
package. By default the ipatests package is always build and installed
by make install.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran
Copy link
Member Author

tiran commented Feb 21, 2017

Now --without-ipatests argument for @lslebodn

Copy link
Contributor

@simo5 simo5 left a comment

Choose a reason for hiding this comment

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

LGTM

@HonzaCholasta
Copy link
Contributor

@tiran, not just for @lslebodn, --without-ipatests will be very useful to me for RHEL and Arch Linux packaging as well 😉.

@lslebodn
Copy link
Contributor

lslebodn commented Feb 22, 2017

Thanks for your contribution. I added your patch to my PR. On my system I ran into a minor issue. >Some C99 types like uint8_t were not defined and I had to include stdint.h.

This change is not enough; there is still warning:

ipa_pwd_ntlm.c: In function 'encode_nt_key':
ipa_pwd_ntlm.c:58:5: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
     il = strlen(newPasswd);
     ^
ipa_pwd_ntlm.c:58:10: warning: incompatible implicit declaration of built-in function 'strlen'
     il = strlen(newPasswd);
          ^

By the way I'm just going to ignore your snidely and snarky comment.

No problem. I am going to forget that my proposal for compromise was ignored for 12 days.

The latest version is a small improvement; but there are still problems/small issues because this PR was created with intention to use tox. I know you are busy. So I wrote client-only implementation from scratch.

This PR is superseded by #494

@tkrizek
Copy link
Contributor

tkrizek commented Feb 22, 2017

The PR works and the --without-ipatests option omits the ipatests directory.

However, #494 doesn't install extra dependencies with mock --without=server.

@simo5
Copy link
Contributor

simo5 commented Feb 22, 2017

So this is the reasoning and why I am approving this PR and not #494.

When you build all components, including server bits, tests are installed, therefore when we build just client bits tets that are relevant to client bits also need to be installed for consistency.

Any switch should default to the same behavior regardless of whether server build is enabled. It is confusing if the --with[out]-[ipa]tests switch changes default based on a different switch passed to configure.

As far as I understand this PR maintains the same default for either server or client only builds, so it gets my approval.

@simo5 simo5 added the ack Pull Request approved, can be merged label Feb 22, 2017
@lslebodn
Copy link
Contributor

lslebodn commented Feb 22, 2017 via email

@pvoborni pvoborni added the pushed Pull Request has already been pushed label Feb 22, 2017
@pvoborni pvoborni closed this Feb 22, 2017
@pvoborni
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
7 participants