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

Implement local source fetching #295

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Aug 31, 2021

This adds the ability to fetch sources by using:
(bundle exec) rake pkg:generate_source

This is implemented in the Foreman repositories and makes it easier to run local scratch builds.

It also fixes handling of remote sources and a TypeError.

The tests currently fail, but at least I've pushed my changes so I don't lose them.

Previously this resulted in a KeyError.
The build_srpm module handles this already so there's no need to
duplicate it.

It also moves the error handling to be local so it's easier to see where
that would fail.
This adds the ability to fetch sources by using:
(bundle exec) rake pkg:generate_source

This is implemented in the Foreman repositories and makes it easier to
run local scratch builds.
@ekohl ekohl marked this pull request as draft August 31, 2021 16:38
@ehelms
Copy link
Member

ehelms commented Aug 31, 2021

This initially feels like over reach to me. As in, something should have the ability to build or generate local source files but that should be a separate module or role that can then hand that off to the srpm module as inputs. That would align it with the remote sources that is simply fetching sources.

@ekohl
Copy link
Member Author

ekohl commented Aug 31, 2021

The thing I want to add too is to retrieve the commit and include that in the prerelease macro. Today we have that for regular nightly packages (see https://yum.theforeman.org/nightly/el8/x86_64/), but it's not there if you'd do a local mock build. I still consider that we don't have this easily available anymore in foreman-packaging a major regression from where we were.

These instructions to build from a local directory (and for srpm) do not work anymore: https://github.com/theforeman/foreman-packaging/tree/rpm/develop#with-mock.

@ehelms
Copy link
Member

ehelms commented Sep 1, 2021

I think you were on the right track with #178 as a dedicated module to handle building, that returns a path to the built source. That built source can then be fed into the srpm module as the source_location. So a parameter could trigger to build a local source based on a path (e.g. --build-source-dir) and that could trigger a block that builds the source and then overrides source_location to point at the local location for the source and source_system would be local.

This could even open the door for allowing a source_system that is github, source_location being the git repository, and source_ref that could handle building a PR. The build module you wrote could then fetch and build in a temporary directory and feed that to srpm module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants