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

Build system refactoring phase 3 #213

Closed
wants to merge 52 commits into from
Closed

Conversation

pspacek
Copy link
Contributor

@pspacek pspacek commented Nov 7, 2016

This monster patch-set refactors most of build system and moves most of the logic from SPEC file to build system.

It is not yet complete, missing parts are:

These will be sorted out later on but the review of the patch set can begin.

@MartinBasti
Copy link
Contributor

Why are there these whitespace errors?

git am ...
...
Applying: Build: stop build when a step in web UI build fails
Applying: Build: fix distribution of static files for web UI
.git/rebase-apply/patch:413: space before tab in indent.
    "./fs",
.git/rebase-apply/patch:414: space before tab in indent.
    "./fileUtils",
.git/rebase-apply/patch:415: space before tab in indent.
    "./process",
.git/rebase-apply/patch:418: space before tab in indent.
    "./stringify",
.git/rebase-apply/patch:419: space before tab in indent.
    "./version",
warning: squelched 49 whitespace errors
warning: 54 lines add whitespace errors.
Applying: Web UI: Remove offline version of Web UI

@MartinBasti
Copy link
Contributor

I cannot build rpms

./makerpms.sh
...
config.status: executing libtool commands

                    IPA Server 4.4.90.201611071629GITbcd4f03
                    ========================

        prefix:                   /usr/local
        exec_prefix:              ${prefix}
        libdir:                   ${exec_prefix}/lib
        bindir:                   ${exec_prefix}/bin
        sbindir:                  ${exec_prefix}/sbin
        sysconfdir:               ${prefix}/etc
        localstatedir:            ${prefix}/var
        datadir:                  ${datarootdir}
        krb5rundir:               ${prefix}/var/run/krb5kdc
        systemdsystemunitdir:     /usr/lib/systemd/system
        source code location:     .
        compiler:                 gcc
        cflags:                   -g -O2
        LDAP libs:                -lldap_r -llber
        KRB5 libs:                -lkrb5 -lk5crypto -lcom_err
        KRAD libs:                -lkrad
        OpenSSL crypto libs:      -lcrypto
        Maintainer mode:          no

make: *** No rule to make target 'rpms'.  Stop.

@MartinBasti
Copy link
Contributor

Build works for me, error was on my side

@MartinBasti
Copy link
Contributor

Works for me

I read commits, it makes sense, works for me, but I'm not an autotools expert so I might miss something.

I'm curious about one commit: Build: cleanup unused LDIFs from install/share

  • do we have somewhere a documentation for Solaris that requires this file?

@pspacek pspacek force-pushed the build-steps branch 2 times, most recently from ecc26a5 to acb1929 Compare November 8, 2016 16:33
@pspacek
Copy link
Contributor Author

pspacek commented Nov 8, 2016

  • This version supports lint target and all configuration options for linters listed in the design document.
  • Fixes in systemd-tmpfiles call from make install.
  • Updates .travis.yml to account for new method of RPM build.

@MartinBasti
Copy link
Contributor

commit Build: add rpms target and makerpms.sh script misses makerpms.sh and ticket, and it looks like you forgot to squash this commit

@tiran tiran added the ack Pull Request approved, can be merged label Nov 9, 2016
@tiran
Copy link
Member

tiran commented Nov 9, 2016

The patch has some minor creases but works. Let's merge it to master and iron out the remaining small issues with PRs.

@tiran
Copy link
Member

tiran commented Nov 9, 2016

memo for me:

Version information is now in VERSION.m4 instead of VERSION.
Makefile target version-update was minimized and configure can be run
before make. Makefile temporarily contains hardcoded version which has
to match the one specified in VERSION.m4.

This is preparatory step which will allow us to replace hand-made
Makefile with one generated by Automake.

https://fedorahosted.org/freeipa/ticket/6418
The neither build nor dist targets work completely. This is temporary
breakage enabling further work.

https://fedorahosted.org/freeipa/ticket/6418
The name in setup.py should match real name of the module. It will be
used by the build system later on.

https://fedorahosted.org/freeipa/ticket/6418
This version builds only one version of Python packages. If you want to
build for Python 2 & 3 call configure twice using different --with-python
or specify PYTHON variable when calling make.

dist-hook is using SOURCES.txt file from egg-info.
According to Petr Viktorin this should be enough for our purposes
and avoids need to create plugins for setuptools.

Currently VPATH builds do not work for various reasons.
This should be fixed later on.

Most credit goes to these guys:
 Christian Heimes <cheimes@redhat.com>
 Petr Viktorin <pviktori@redhat.com>
 Kevin Brown <kevin@kevin-brown.com>

https://fedorahosted.org/freeipa/ticket/6418
Most of the logic was unnecessary and wrong. This caused make install to fail.

This commit removes unnecessary declarations and creates static library
which is not installed. make install in asn1 subdirectory is now passing
(and doing nothing).

https://fedorahosted.org/freeipa/ticket/6418
This is step forward working VPATH builds which cleanly separate sources
and build artifacts. It makes the system cleaner and easier to
understand.

Python and web UI likely require more work to make VPATH builds working.

https://fedorahosted.org/freeipa/ticket/6418
Some Makefile.am files were apparently created by copy-pasting other
files. As a result, some Makefiles require non-existing README files.
Remove this to fix dist target.

https://fedorahosted.org/freeipa/ticket/6418
The name from configure.ac is used when generating tarball.

https://fedorahosted.org/freeipa/ticket/6418
It now distributes po, pot, Makefile.in, and associated text files.

https://fedorahosted.org/freeipa/ticket/6418
By default automake does not distribute man pages. This marks then with
dist_ prefix to force their distribution in tarball.

https://fedorahosted.org/freeipa/ticket/6418
… directory

Static files from Git which are not touched by the build system
have to be explicitly listed in Makefile.am so they get into tarball.

ipa script was missing on installed systems for the same reason.

https://fedorahosted.org/freeipa/ticket/6418
Static files from Git which are not touched by the build system
have to be explicitly listed in Makefile.am so they get into tarball.

EXTRA_DIST lists whole sub-directories with static files.
This is not ideal but we do not have enough time to fix it properly.

Dojo builder patch files were renames to shorten their name.
The original names were exceeding autotools length limit.

https://fedorahosted.org/freeipa/ticket/6418
The offline version does not work for some time already.
I'm removing it right now to get rid of garbage which clutters
build system.

https://fedorahosted.org/freeipa/ticket/6447
FreeIPA has hard dependency on systemd for a long time already.
SystemV directory was just polluting the tarball (while being useless).

https://fedorahosted.org/freeipa/ticket/6418
At the same time, I've renamed tmpfilesd config file to static name
"ipa.conf" instead of using package-specific name. It had no purpose
and just complicated build and packaging.

Variable substitution into configuration has to be done in Makefile
and not in Autoconf as documented in:
Autoconf v2.69 manual chapter 4.8.2 Installation Directory Variables:
  ... Most of these variables have values that rely on prefix or
  exec_prefix. ... Similarly, you should not rely on AC_CONFIG_FILES
  to replace bindir and friends in your shell scripts and other files;
  instead, let make manage their replacement.

https://fedorahosted.org/freeipa/ticket/6418
Directory creating was moved from SPEC file to install-data-hook.
At the same time, it is using systemd-tmpfiles to create the directories
so we do not risk any inconsistency between SPEC file and tmpfilesd
configuration.

systemd-tmpfiles call is non-critical on purpose: The build would fail
when run under unprivileged user because systemd-tmpfiles tries to
change ownership. Luckily it creates all the files and just do not
change ownership so it works even under unprivileged user.

Interestingly, systemd-tmpfiles continues if user does not have
sufficient permissions to change ownership but fails if target username
does not exist at all. For this reason there is BuildRequires on httpd.

https://fedorahosted.org/freeipa/ticket/6418
Makefile in doc subdirectory should be integrated into the main build
system but I do not have time to do it now. For now it is enough
to distribute everything.

https://fedorahosted.org/freeipa/ticket/6418
At the time of this writting
https://fedoraproject.org/wiki/Packaging:Guidelines#Manpages
says this:
  When installing man pages, note that they should be installed uncompressed
  as the build system will compress them as needed. The compression method
  may change, so it is important to reference the pages in the %files section
  with a pattern that takes this into account:
  %{_mandir}/man1/foo.1*

Removing the compression also allows to remove several install-data-hook
targets from Makefile.am files.

https://fedorahosted.org/freeipa/ticket/6418
The only useful file is /etc/ipa/kdcproxy/kdcproxy.conf so I've removed
the other copy of the file in /usr.

https://fedorahosted.org/freeipa/ticket/6418
make rpms and ./makerpms.sh will produce the same RPM packages. The
advantage of makerpms.sh is that it will take care of initial
autoreconf & configure phases as needed.

rpm-build-4.13.0-1.fc24.x86_64 broke parallel build of RPMs.
If you get error
  INTERNAL: Exiting with 1 jobserver tokens available; should be 8!
undefine the MAKEFLAGS variable and do not specify neither -j nor -l.

https://fedorahosted.org/freeipa/ticket/6418
@pspacek
Copy link
Contributor Author

pspacek commented Nov 9, 2016

I've fixed cases where make generated some build artifacts but make clean did not remove them. These were distinct from Christian comments, I will fix these later on.

@pspacek
Copy link
Contributor Author

pspacek commented Nov 9, 2016

@tiran

add ipasetup.py to dist_noinst_SCRIPTS ?
ipasetup.py file is auto-generated from ipasetup.py.in so it should not be part of distibution tarball. I've marked this item as "done".

@pspacek
Copy link
Contributor Author

pspacek commented Nov 9, 2016

@tiran
I've tested the find command and it works. The trick is -o which acts like OR and allows you to specify different conditions and associate different actions to them. I'm going to check the checkbox as well :-)

@MartinBasti
Copy link
Contributor

ACK

@martbab martbab added the ack Pull Request approved, can be merged label Nov 9, 2016
@martbab
Copy link
Contributor

martbab commented Nov 9, 2016

Fixed upstream
master:
https://fedorahosted.org/freeipa/changeset/c48e5fd811326dc64e19490f88003e442815a052
https://fedorahosted.org/freeipa/changeset/0a17155e5b0434d4cab4d1696fac7f5ef88f0808
https://fedorahosted.org/freeipa/changeset/81da45ffb13d126c9b56a2022d88ba8bed2ee18c
https://fedorahosted.org/freeipa/changeset/8de11b091fc705f235b1304fb101c27a82dcda6f
https://fedorahosted.org/freeipa/changeset/3d6b8f8bdd5568c44d293cba960209941e4d2545
https://fedorahosted.org/freeipa/changeset/3a41b3bb8860cf73fef7efd54db2da5ecbd608d5
https://fedorahosted.org/freeipa/changeset/820fd4c7ce6ccc80272f45d6f64227567692dd39
https://fedorahosted.org/freeipa/changeset/24feae47f26f40f757fbdd711399128d88c9b62c
https://fedorahosted.org/freeipa/changeset/b8d81ba3a12d93c38c4a0a8d439845746a32ae35
https://fedorahosted.org/freeipa/changeset/fa8a468dba0ed866497669bd9c08b7de3a2cfbe3
https://fedorahosted.org/freeipa/changeset/7282776c05c2fb254ae65b63977ba604be316038
https://fedorahosted.org/freeipa/changeset/2f6712893be5e66260a169c367a4607be6043d11
https://fedorahosted.org/freeipa/changeset/021a52d6801b74ded03cfdf6c7fb73bd1cab978f
https://fedorahosted.org/freeipa/changeset/f95098b2b645a62497dc6e1d66be2b7397567d25
https://fedorahosted.org/freeipa/changeset/441acf7797b2069e8d9a123aa11bb33fd42d9187
https://fedorahosted.org/freeipa/changeset/24525fd086450616d4edd2aaf26dec868ff80ea9
https://fedorahosted.org/freeipa/changeset/b910683e19356390351a6b82240762969ecf89c0
https://fedorahosted.org/freeipa/changeset/04be25082c60da01552d5e7c73d12930b10bd02e
https://fedorahosted.org/freeipa/changeset/deec97abaec933709718464c4aa233a04de1844a
https://fedorahosted.org/freeipa/changeset/a125370becb045b6e757df88e520ef3f8ab4ca09
https://fedorahosted.org/freeipa/changeset/dabc65f6b1989fb8f938e4b7249fcf5d41706e17
https://fedorahosted.org/freeipa/changeset/886d9167eb939a3ab5226ca420c404a9810186cf
https://fedorahosted.org/freeipa/changeset/c951a491a9082b8b5931782f45f82e251eb93c3c
https://fedorahosted.org/freeipa/changeset/0d5fe1dba0459b09bc7518d34c58444c96435801
https://fedorahosted.org/freeipa/changeset/125bf25577e58d11252cb41d34065d49f581e0ac
https://fedorahosted.org/freeipa/changeset/684a2c6a58b99a72f68e4c7f827d6601007cea26
https://fedorahosted.org/freeipa/changeset/4fb2f535ca73dd16738ce4a3b692931fb26227aa
https://fedorahosted.org/freeipa/changeset/14bce67cf0cad1aecc132a2c67ad2dc686bcd2af
https://fedorahosted.org/freeipa/changeset/c1652f92af6bea13ecd96c0ad7be38784e2faeb5
https://fedorahosted.org/freeipa/changeset/278cda7ede3777f61f31ec77199d02954512e133
https://fedorahosted.org/freeipa/changeset/53cd71a63c7d6ba97a5593e5a8922af71c5a4b6f
https://fedorahosted.org/freeipa/changeset/74820fe3d8774244476357036406014680d54211
https://fedorahosted.org/freeipa/changeset/39b17ef2abd885ab87c1a39d3036f762b6b084c8
https://fedorahosted.org/freeipa/changeset/f229bb56b73487758ed9bd9c7f0a4cc74134992b
https://fedorahosted.org/freeipa/changeset/312e780041fc9025ca3c189e6c9fcb54c7340714
https://fedorahosted.org/freeipa/changeset/8ffd3bdf142f0f852918186ce0a338a7818bbe8e
https://fedorahosted.org/freeipa/changeset/d3cab75d7e79fbc89ef08df3e6d2b1e28b4ef163
https://fedorahosted.org/freeipa/changeset/a027bf739848371fa91b5ba9766e031c9003d322
https://fedorahosted.org/freeipa/changeset/288d624336d502a7df9856cdc2f6543b6e7c0b79
https://fedorahosted.org/freeipa/changeset/6cb0271509fe95ae38fc743f2a13faf32fe29a99
https://fedorahosted.org/freeipa/changeset/cc6382550fcf32bd4b843c922c10c5a5d247dd38
https://fedorahosted.org/freeipa/changeset/dc5699a8a40dd27ffd25d9ad3185ba40d93ec95b
https://fedorahosted.org/freeipa/changeset/4ce3aa3b12004ca4eb29e4bbca415a585fbd432f
https://fedorahosted.org/freeipa/changeset/75a944e980c64061e51f4ec7215033c118f39863
https://fedorahosted.org/freeipa/changeset/fee9bbd85afeac3593abd791de2d002bed300c8e
https://fedorahosted.org/freeipa/changeset/2df98772556de0d964028bbb78a9efbdd13ecd40
https://fedorahosted.org/freeipa/changeset/14c1c8dfd0aa894af2d60dfa4f2ce2510d791328
https://fedorahosted.org/freeipa/changeset/f31a489d246e01250536b7187225fb7ca6398ba5
https://fedorahosted.org/freeipa/changeset/b54e9e86dfaed1320f7ccce560f82c233f67bf1a
https://fedorahosted.org/freeipa/changeset/e3b537af18afa03b1f04530b42cdba5c1fc3ff97
https://fedorahosted.org/freeipa/changeset/4498998f1763d673056423a73d3b3ff22f94954f
https://fedorahosted.org/freeipa/changeset/c0674e89d1e6b5abd82cf3b7bf8054eec0fa6418

@martbab martbab added the pushed Pull Request has already been pushed label Nov 9, 2016
@martbab martbab closed this Nov 9, 2016
@pspacek pspacek deleted the build-steps branch November 9, 2016 12:22
pspacek referenced this pull request in pspacek/freeipa Nov 9, 2016
make lint and make dist were generating files which were not removed by
make clean.

https://fedorahosted.org/freeipa/ticket/6418
@pspacek
Copy link
Contributor Author

pspacek commented Nov 9, 2016

@tiran

autoconf and automake files are not removed (Makefile.in, /config.sub ...)

According to Automake manual section 13 What Gets Cleaned we must not remove files necessary for ./configure.

As far as I can tell from testing, make distclean + PR #220 leaves behind only files generated by autoreconf so we should not remove any of them. It would prevent users from running configure again.

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
4 participants