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 proper src.rpm packages #1508

Open
marmarek opened this Issue Dec 11, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@marmarek
Member

marmarek commented Dec 11, 2015

Currently building src.rpm packages is broken. Mostly because we're building directly from git checkout, without proper source tarball. But src.rpm packages are needed for #816 .
The work include:

  • generate proper (deterministic) source tarball - git archive can be useful here
  • create static spec file - currently it uses content of version file for getting package version - similar problem is already solved in Debian packages

Optional:

  • generate proper changelog - similar code is already in Debian packages; additionally PLD Linux have a script exactly for that

@marmarek marmarek added this to the Release 3.2 milestone Dec 11, 2015

andrewdavidwong added a commit that referenced this issue May 31, 2016

marmarek added a commit to marmarek/qubes-core-libvirt that referenced this issue Jul 29, 2016

@marmarek marmarek modified the milestones: Release 3.2, Release 4.0 Aug 5, 2016

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Apr 2, 2017

Closed

core-libvirt v3.1.0-1 (r4.0) #24

@marmarek marmarek referenced this issue in QubesOS/qubes-core-qubesdb Nov 6, 2017

Closed

rpmbuild: fix build error for empty debug files #7

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Nov 9, 2017

Split building targets into separate file
This is preparation for adding mock-based build.

QubesOS/qubes-issues#1508

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Nov 9, 2017

Add spec file generator
Generate spec file based on spec.in, by replacing placeholders instead
of dynamically obtaining values at build time. Supported placeholders:

* @Version@ - package version, from `version` file
* @BACKEND_VMM@ - BACKEND_VMM setting from builder.conf
* @rel@ - package release, from `rel` file if present

QubesOS/qubes-issues#1508

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Nov 9, 2017

Add mock-based build process
This implement second mode of building package: using mock. This is
enabled by a package by specifying RPM_USE_MOCKBUILD=1 in
Makefile.builder.
Using this mode will result in packages built in _dedicated_ isolated
environment (as opposed to legacy mode, where the same isolated
environment is used for building multiple packages).
Additionally, source tarball and src.rpm package are built.

QubesOS/qubes-issues#1508

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Nov 9, 2017

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Nov 9, 2017

marmarek added a commit to marmarek/qubes-linux-utils that referenced this issue Nov 9, 2017

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 9, 2017

Member

Work in progress version here: https://github.com/marmarek/qubes-builder-fedora/tree/reprobuild + https://github.com/marmarek/qubes-builder/tree/reprobuild

This require source component to be modified:

  1. Rename .spec to .spec.in, use @VERSION@ instead of cat version hack.
  2. Make sure that symlink hack in %prep is either under %if 0%{?qubes_builder}, or removed.
  3. Same for %define _builddir %(pwd).
  4. Add Source0: %{name}-%{version}.tar.gz
  5. If component use BACKEND_VMM variable, set it in spec with @BACKEND_VMM@, for example export BACKEND_VMM=@BACKEND_VMM@.
  6. Set RPM_USE_MOCKBUILD = 1 in Makefile.builder of that component.

Example modified component: https://github.com/marmarek/qubes-linux-utils/tree/srcrpm

Missing parts:

  • replace git archive with tar and move it to builder-fedora plugin; to have more explicit format and archive layout, and also to take into account local changes (devel builds) - see reprobuild branch in builder-debian
  • fill changelog in spec (see issue description)
  • handle the case when source tarball is already provided (vmm-xen, linux-kernel, installer-qubes-os)
  • handle multi-package components (installer-qubes-os) - related to replacing git archive
  • fix building "new" type packages using "old" code - for fast devel builds (avoid installing build deps every time)
  • verify if "old" code really build all "old" components - for example if all Qubes 3.2 can be built
  • verify if INCREMENT_DEVEL_VERSIONS=1 still works
  • verify if sign and update-repo/check-repo targets still works

cc @fepitre

Member

marmarek commented Nov 9, 2017

Work in progress version here: https://github.com/marmarek/qubes-builder-fedora/tree/reprobuild + https://github.com/marmarek/qubes-builder/tree/reprobuild

This require source component to be modified:

  1. Rename .spec to .spec.in, use @VERSION@ instead of cat version hack.
  2. Make sure that symlink hack in %prep is either under %if 0%{?qubes_builder}, or removed.
  3. Same for %define _builddir %(pwd).
  4. Add Source0: %{name}-%{version}.tar.gz
  5. If component use BACKEND_VMM variable, set it in spec with @BACKEND_VMM@, for example export BACKEND_VMM=@BACKEND_VMM@.
  6. Set RPM_USE_MOCKBUILD = 1 in Makefile.builder of that component.

Example modified component: https://github.com/marmarek/qubes-linux-utils/tree/srcrpm

Missing parts:

  • replace git archive with tar and move it to builder-fedora plugin; to have more explicit format and archive layout, and also to take into account local changes (devel builds) - see reprobuild branch in builder-debian
  • fill changelog in spec (see issue description)
  • handle the case when source tarball is already provided (vmm-xen, linux-kernel, installer-qubes-os)
  • handle multi-package components (installer-qubes-os) - related to replacing git archive
  • fix building "new" type packages using "old" code - for fast devel builds (avoid installing build deps every time)
  • verify if "old" code really build all "old" components - for example if all Qubes 3.2 can be built
  • verify if INCREMENT_DEVEL_VERSIONS=1 still works
  • verify if sign and update-repo/check-repo targets still works

cc @fepitre

@fepitre

This comment has been minimized.

Show comment
Hide comment
@fepitre

fepitre Nov 9, 2017

Member

Great job! So the starting point here is to handle the missing parts and doing the "repack" of all the components?

Member

fepitre commented Nov 9, 2017

Great job! So the starting point here is to handle the missing parts and doing the "repack" of all the components?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 9, 2017

Member

So the starting point here is to handle the missing parts and doing the "repack" of all the components?

Yes. While working on some of them it may turn out some better options for Makefile.builder in each component will suit there. Some alternative approach is to specify "builder compatibility version", instead of requested feature. This might ease handling similar changes in the future.

Member

marmarek commented Nov 9, 2017

So the starting point here is to handle the missing parts and doing the "repack" of all the components?

Yes. While working on some of them it may turn out some better options for Makefile.builder in each component will suit there. Some alternative approach is to specify "builder compatibility version", instead of requested feature. This might ease handling similar changes in the future.

@fepitre

This comment has been minimized.

Show comment
Hide comment
@fepitre

fepitre Nov 11, 2017

Member

I'm looking at Mock possibilities and I'm testing the --buildsrpm using the spec file. Preliminaries tests of packaging work great but I encounter a problem with folders of patches. Is there a way to include easily folders of patches (e.g. patches.misc) with all the patches inside included? It seems that we have to list explicitly all the patches (like it is done in series.conf) and or Fedora upstream xen.spec. It that case it would rethink the way of applying patches?

Member

fepitre commented Nov 11, 2017

I'm looking at Mock possibilities and I'm testing the --buildsrpm using the spec file. Preliminaries tests of packaging work great but I encounter a problem with folders of patches. Is there a way to include easily folders of patches (e.g. patches.misc) with all the patches inside included? It seems that we have to list explicitly all the patches (like it is done in series.conf) and or Fedora upstream xen.spec. It that case it would rethink the way of applying patches?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 12, 2017

Member

Is there a way to include easily folders of patches (e.g. patches.misc) with all the patches inside included?

No, listing a folder of patches is a bug in rpm packaging. It require explicit patch list. It works for us because of _builddir hack. Part of fixing components is about listing patches in spec file... See libvirt.spec for example how to not list them twice (the second one in %prep). I was thinking about generating that list (add @PATCHES@ or such), but finally abandoned that idea, because we don't have that much components with many patches.

Member

marmarek commented Nov 12, 2017

Is there a way to include easily folders of patches (e.g. patches.misc) with all the patches inside included?

No, listing a folder of patches is a bug in rpm packaging. It require explicit patch list. It works for us because of _builddir hack. Part of fixing components is about listing patches in spec file... See libvirt.spec for example how to not list them twice (the second one in %prep). I was thinking about generating that list (add @PATCHES@ or such), but finally abandoned that idea, because we don't have that much components with many patches.

fepitre added a commit to fepitre/qubes-linux-utils that referenced this issue Jan 22, 2018

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Jan 22, 2018

Split building targets into separate file
This is preparation for adding mock-based build.

QubesOS/qubes-issues#1508

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Jan 22, 2018

Add spec file generator
Generate spec file based on spec.in, by replacing placeholders instead
of dynamically obtaining values at build time. Supported placeholders:

* @Version@ - package version, from `version` file
* @BACKEND_VMM@ - BACKEND_VMM setting from builder.conf
* @rel@ - package release, from `rel` file if present

QubesOS/qubes-issues#1508

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Jan 22, 2018

Add mock-based build process
This implement second mode of building package: using mock. This is
enabled by a package by specifying RPM_USE_MOCKBUILD=1 in
Makefile.builder.
Using this mode will result in packages built in _dedicated_ isolated
environment (as opposed to legacy mode, where the same isolated
environment is used for building multiple packages).
Additionally, source tarball and src.rpm package are built.

QubesOS/qubes-issues#1508

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Jan 22, 2018

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Jan 22, 2018

fepitre added a commit to fepitre/qubes-linux-utils that referenced this issue Jan 25, 2018

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Apr 1, 2018

Split building targets into separate file
This is preparation for adding mock-based build.

QubesOS/qubes-issues#1508

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Apr 1, 2018

Add spec file generator
Generate spec file based on spec.in, by replacing placeholders instead
of dynamically obtaining values at build time. Supported placeholders:

* @Version@ - package version, from `version` file
* @BACKEND_VMM@ - BACKEND_VMM setting from builder.conf
* @rel@ - package release, from `rel` file if present

QubesOS/qubes-issues#1508

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Apr 1, 2018

Add mock-based build process
This implement second mode of building package: using mock. This is
enabled by a package by specifying RPM_USE_MOCKBUILD=1 in
Makefile.builder.
Using this mode will result in packages built in _dedicated_ isolated
environment (as opposed to legacy mode, where the same isolated
environment is used for building multiple packages).
Additionally, source tarball and src.rpm package are built.

QubesOS/qubes-issues#1508

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Apr 1, 2018

fepitre added a commit to fepitre/qubes-builder-rpm that referenced this issue Apr 1, 2018

fepitre added a commit to fepitre/qubes-linux-utils that referenced this issue Apr 1, 2018

fepitre added a commit to fepitre/qubes-linux-utils that referenced this issue Apr 3, 2018

fepitre added a commit to fepitre/qubes-linux-utils that referenced this issue Apr 3, 2018

@marmarek marmarek referenced this issue Apr 3, 2018

Closed

Fedora 27 template #3783

5 of 5 tasks complete
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 18, 2018

Member

@fepitre vmm-xen build fails with RPM_USE_MOCKBUILD=1. Because git submodules (Source3[3-6] in spec) are not included in any tarball. I think each of them should have own tarball (created with create-archive in source-copy-in or such). Probably with some artificial version number, for example hash of last commit (or shortened hash), to avoid having same named tarball with different content.

stubdom-dhcp isn't a submodule, but there are only 3 files - IMO listing them directly should be ok.

Member

marmarek commented Apr 18, 2018

@fepitre vmm-xen build fails with RPM_USE_MOCKBUILD=1. Because git submodules (Source3[3-6] in spec) are not included in any tarball. I think each of them should have own tarball (created with create-archive in source-copy-in or such). Probably with some artificial version number, for example hash of last commit (or shortened hash), to avoid having same named tarball with different content.

stubdom-dhcp isn't a submodule, but there are only 3 files - IMO listing them directly should be ok.

@fepitre

This comment has been minimized.

Show comment
Hide comment
@fepitre

fepitre Apr 18, 2018

Member

Oh yes. I will solve this problem as top priority.

Member

fepitre commented Apr 18, 2018

Oh yes. I will solve this problem as top priority.

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Apr 21, 2018

Closed

linux-utils v4.0.18 (r4.0) #486

@fepitre fepitre referenced this issue in QubesOS/qubes-vmm-xen Apr 30, 2018

Merged

Handle sources archives for submodules/subfolders #39

fepitre added a commit to fepitre/qubes-linux-utils that referenced this issue May 5, 2018

fepitre added a commit to fepitre/qubes-linux-utils that referenced this issue May 5, 2018

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status May 7, 2018

Closed

linux-utils v3.2.8 (r3.2) #515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment