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

Wip make dist rpm 3 #4911

Closed
wants to merge 3 commits into from
Closed

Wip make dist rpm 3 #4911

wants to merge 3 commits into from

Conversation

osynge
Copy link

@osynge osynge commented Jun 9, 2015

replaces #4905

@osynge osynge mentioned this pull request Jun 9, 2015
@ghost
Copy link

ghost commented Jun 9, 2015

@osynge would you mind rebasing instead of creating new pull requests ? Unless there is a specific reason to do so, it saves a little time with pull request triage :-)

@ghost ghost added the build/ops label Jun 9, 2015
@ghost ghost assigned smithfarm Jun 9, 2015
@smithfarm smithfarm assigned ktdreyer and unassigned smithfarm Jun 9, 2015
@osynge
Copy link
Author

osynge commented Jun 9, 2015

@dachary sure, I will do in future, some thing funny happened when I tried to reorder so no commit would break anything (for bisecting)

@ktdreyer
Copy link
Member

ktdreyer commented Jun 9, 2015

The general concept is good here.

One detail regarding implementation: I'd really like this RPM generation process to be outside of autoconf entirely. The fact that we have to do a full ./configure run just to get a version number for an SRPM adds a lot of time onto the build process, since ./configure takes so long.

Sage wrote a ./make_dist.sh script (currently in master) that we're going use in place of "make dist" soon. This will allow us to get a tarball very quickly, without having to run ./configure.

Can we do the same thing with a "./make_rpm.sh" ? (it could take an --srpm flag if you want to have it build both SRPMs and RPMs, as this PR currently does with make rpm and make srpm.)

@ktdreyer
Copy link
Member

ktdreyer commented Jun 9, 2015

Re: my comment above, there's some background information about the "make dist" transition in this ceph-devel thread (http://www.spinics.net/lists/ceph-devel/msg23958.html)

@osynge
Copy link
Author

osynge commented Jun 9, 2015

@ktdreyer do you have any reason apart from performance ? This is a very bad idea in my opinion.

By not using configure to set the paths in the spec or debian files.

  • You have to set the paths in the code base of ceph for debian.
  • You have to set the paths in the code base of ceph for redhat.
  • You have to set the paths in the code base of ceph for SUSE.
  • You have to make conditionals for all the paths for each OS.

A good example would be the file :

src/ceph-osd-prestart.sh

By using configure we in a wrapper script such as ./make_rpm.sh we can set the paths to distribution in one place :)

@ktdreyer
Copy link
Member

ktdreyer commented Jun 9, 2015

The RPMs and DEBs will still run ./configure during the actual builds. For example, the RPMs will run ./configure during %prep. The point is that we shouldn't have to run ./configure just to get a tarball or SRPM.

The problem is that right now we have to run ./configure twice: once to simply build a tarball with the proper version number, and once within rpmbuild itself.

@osynge
Copy link
Author

osynge commented Jun 9, 2015

@ktdreyer this seems a very small issue compared to the potentially lost features.

I answered on the mailing list in more depth why I feel this is wrong.

@osynge
Copy link
Author

osynge commented Jun 9, 2015

@ktdreyer

  • First execution.
    • Defaulting all release values as specified into all templated files such as ceph.spec.
  • Second execution.
    • The subprocess of executing a rpm processed build that will result in an rpm.
    • In rpm based testing we can check is "make srpm" makes recursively building srpms.

@osynge
Copy link
Author

osynge commented Jun 9, 2015

Note "./make_rpm.sh" and "make rpm" applications provide different features.

  • making tar balls for publishing on the web.
  • makes rpm, srpm, and version tar ball.

They are two different use cases addressed.

@ktdreyer
Copy link
Member

ktdreyer commented Jun 9, 2015

@ktdreyer this seems a very small issue compared to the potentially lost features.

It's not clear to me what features we'd be losing by moving this out of autoconf and into a standalone script.

@osynge
Copy link
Author

osynge commented Jun 9, 2015

You will loose the ability to apply templates to things like "ceph.spec"

  • You loose sane default values and replace them with hard coded values.
  • Have to put a lot of conditionals in ceph.sepc.in
  • You can support configure time calculation of default values
    • eg "git hash"

@osynge
Copy link
Author

osynge commented Jun 9, 2015

Maybe I should have merged this patch and the #4871 and suggested they be used together.

@ktdreyer
Copy link
Member

ktdreyer commented Jun 9, 2015

You loose sane default values and replace them with hard coded values.

can you give some further examples?

Have to put a lot of conditionals in ceph.sepc.in

This is annoying. Ceph's .spec is a lot messier than anything else I've worked on. But os-specific conditionals have to go somewhere, and this follows the conventions that a lot of other projects and packages follow.

You can support configure time calculation of default values eg "git hash"

Right, that's what "make_dist.sh" does, entirely independent of autoconf, and a lot faster than autoconf.

@osynge
Copy link
Author

osynge commented Jun 9, 2015

So we are agreed the arguments about this duplicating functionality of "make_dist.sh" is irrelevant?

You agree now that I only need to provide examples of why variables are useful well I have to make a union of a few patches to show you :)

@osynge
Copy link
Author

osynge commented Jun 9, 2015

Being able to make nearly everything a variable in ceph.spec.in will prevent he turbulence caused by different conditionals being merged, ie where does this go?

%if (0%{?rhel} && 0%{?rhel} < 7)
install -m 0644 -D udev/95-ceph-osd-alt.rules $RPM_BUILD_ROOT/lib/udev/rules.d/95-ceph-osd.rules
%else
install -m 0644 -D udev/95-ceph-osd.rules $RPM_BUILD_ROOT/lib/udev/rules.d/95-ceph-osd.rules
%endif

clearly in the spec.in file it would be nice to be:

install -m 0644 -D udev/95-ceph-osd-alt.rules $RPM_BUILD_ROOT/@udev-dir@/95-ceph-osd-sysv.rules

Clearly the second line is better. We could even have configure find the directory, on every distribution if not set in the options :)

Its just a few lines in configure.ac and its done making the job easier :)

@osynge
Copy link
Author

osynge commented Jun 9, 2015

In summary

  • I think using autotools to provide autodetection of defaults and allow configure override with parameters is useful and simple.
  • Is a good way to insulate a project from the operating system configuration.
  • os-specific conditionals have to go somewhere

tip: If you explicitly set autotools options it can some times run faster, as it does not have to find out a default. Explicitly turning off java may help in configure run time.

@ktdreyer
Copy link
Member

ktdreyer commented Jun 9, 2015

Using @udev-dir@ in ceph.spec.in is not the way to go. Adding more autoconf variables into ceph.spec.in means building more layers of complexity on a system that's already horribly complex.

The particular example with the 95-ceph-osd.rules file vs 95-ceph-osd-alt.rules is a good example of a bad convention that was done as an expedient hack years ago to fix http://tracker.ceph.com/issues/4632. The two files have diverged since then, and the proper solution is to make ./configure detect the system's udev version and conditionally install the correct .rules file during make install.

@osynge
Copy link
Author

osynge commented Jun 10, 2015

Adding more autoconf variables into ceph.spec.in means building more layers of complexity to allow the variables, to be variable and stored else wear.

In the end it comes down to isolating the changed values from the debian defaults to SUSE and redhat and making them variable, and handling the conditionals in a language with nicer conditionals the an rpm spec file makes a lot of sence.

Aded options
    --with-rpm-dir=/yourrpmdir

Default is `pwd`/RPM rpm topdir.

Signed-off-by: Owen Synge <osynge@suse.com>
@osynge
Copy link
Author

osynge commented Jun 16, 2015

when tested on fedora it did not work reasons where:

1 not adding patch file to sources for fedora builds.

+cp rpm/init-ceph.in-fedora.patch  $(rpmtopdir)/SOURCES

2 fedora already defines _topodir so typo in _topdir definition caused failures.

-       rpmbuild --define "_rpmtopdir $(rpmtopdir)" -ba @PACKAGE@.spec
+       rpmbuild --define "_topdir $(rpmtopdir)" -ba @PACKAGE@.spec

These are now fixed in latest commit.

Add "make rpm" to Makefile.am

Use RPM_DIR created in configure.ac to define rpmtopdir.

Signed-off-by: Owen Synge <osynge@suse.com>
Add "make srpm" to Makefile.am as a build dependency to "make rpm"

Signed-off-by: Owen Synge <osynge@suse.com>
@osynge
Copy link
Author

osynge commented Jun 16, 2015

Added a comment between testing and making patch that caused build to fail. This comment is now in style of previous comments and no longer produces interesting errors.

@osynge
Copy link
Author

osynge commented Jun 18, 2015

@ktdreyer "using @udev-dir@ in ceph.spec.in is not the way to go."

(1) Please note this patch does not contain @udev-dir@ type changes.

On that subject, the only strong contender not to just put more logic into autotools defaults as in #4871

@ghost
Copy link

ghost commented Sep 1, 2015

@osynge this needs rebasing. And maybe a gentle ping ;-)

@ghost
Copy link

ghost commented Nov 25, 2015

@osynge feel free to re-open when you have time to rebase

@ghost ghost closed this Nov 25, 2015
@jan--f jan--f deleted the wip-make-dist-rpm_3 branch February 8, 2017 20:33
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants