Skip to content

Enable copr builds and add packit config #5000

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

Closed

Conversation

dhodovsk
Copy link

Let us introduce packit service to you - the automation to integrate upstream open source projects into Fedora operating system.

After merging this PR, you are just a few steps away from RPM builds being automatically triggered on your PR's.
It means, that you'll be able to try and play with your change, packaged as an RPM.

But there is more. By using packit, you can for example enable adding new releases into Fedora Rawhide.

What are the next steps?

For more info, please:

The spec you see in this PR was fetched from your package's Fedora dist-git.

@openscap-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@redhatrises
Copy link
Contributor

@openscap-ci test this please

@matejak
Copy link
Member

matejak commented Nov 18, 2019

The only thing I don't like about this is the .spec file - why to have it here, as it is already publicly accessible?

The packit documentation mentions that synced_files are "copied to the dist-git", but the documentation doesn't clearly say what it implies - does running packit mean that the Fedora spec file will be effectively moved from Fedora dist-git here to the upstream?

@matejak matejak self-assigned this Nov 18, 2019
@dahaic
Copy link
Contributor

dahaic commented Nov 21, 2019

Hello @dhodovsk (or should I reference @packit-service ? :) ), can you take a look at what Matej posted above?

(And thank you for proactive PR, and congrats for having item with number 5000!)

@redhatrises
Copy link
Contributor

The only thing I don't like about this is the .spec file - why to have it here, as it is already publicly accessible?

The packit service handles the the Fedora workflow for you. The reason that the spec file is upstream and downstream is because in many repos that keep their spec file upstream to mininize their workload downstream (except for changelog) means that changes made downstream can be synced upstream.

The packit documentation mentions that synced_files are "copied to the dist-git", but the documentation doesn't clearly say what it implies - does running packit mean that the Fedora spec file will be effectively moved from Fedora dist-git here to the upstream?

It means that the Fedora spec file will be kept "in sync" between dist-git and repo. https://packit.dev/docs/configuration/#more-examples-of-synced-files

@dhodovsk
Copy link
Author

@redhatrises is right :)

There is an option to use packit actions to always just get the spec from the dist-git before attempting the srpm build, so it doesn't have to be specified here. - similarly as in this example. Would you be interested in that?

@matejak
Copy link
Member

matejak commented Nov 25, 2019

There is an option to use packit actions to always just get the spec from the dist-git before attempting the srpm build, ...

This sounds good - having the spec file here would open the possibility of having it modified by accident or by contributors not fully aware of Fedora packaging guidelines.

@dhodovsk dhodovsk force-pushed the packit-onboard-w-copr branch from e3e538b to 6b26278 Compare November 25, 2019 15:38
@dhodovsk
Copy link
Author

The packit config is now changed, so before every build, it fetches newest spec from dist-git, instead of storing it in repo.

@shawndwells
Copy link
Member

The only thing I don't like about this is the .spec file - why to have it here, as it is already publicly accessible?

As stewards of open source, it's important for projects that Red Hat participates in be upstream first.

Having build files buried/hidden in downstream places only encumbers the community. There seems no downside to bringing the .spec file upstream.

The packit documentation mentions that synced_files are "copied to the dist-git", but the documentation doesn't clearly say what it implies - does running packit mean that the Fedora spec file will be effectively moved from Fedora dist-git here to the upstream?

@redhatrises
Copy link
Contributor

redhatrises commented Nov 27, 2019

The only thing I don't like about this is the .spec file - why to have it here, as it is already publicly accessible?

As stewards of open source, it's important for projects that Red Hat participates in be upstream first.

Having build files buried/hidden in downstream places only encumbers the community. There seems no downside to bringing the .spec file upstream.

The packit documentation mentions that synced_files are "copied to the dist-git", but the documentation doesn't clearly say what it implies - does running packit mean that the Fedora spec file will be effectively moved from Fedora dist-git here to the upstream?

Especially as there are several in the community who are actual Fedora packagers.

@matejak
Copy link
Member

matejak commented Nov 28, 2019

I have sent an e-mail to the mailing list, and based on the feedback, we conclude this in the first week of December.

@yuumasato
Copy link
Member

Loved the testing RPMs per PR and the capability to propose updates to Fedora.

We used to have the .spec file in upstream. It was used to allow community to build test RPMs, when CPack came in, we removed the spec file from upstream.
One of the burdens was synchronizing and keeping it working, as in the actual dist-git.
If Packit can keep them in sync, I don't mind having it upstream.

@dhodovsk If we have the .spec in upstream and "syncing it downstream" to Fedora. Would it mean that we would have to update Changelog in upstream before release and propose-downstream?

@redhatrises
Copy link
Contributor

@openscap-ci test this please

@redhatrises
Copy link
Contributor

/packit copr-build

@packit-as-a-service
Copy link

Neither account redhatrises nor owner ComplianceAsCode are on our whitelist!

@redhatrises
Copy link
Contributor

/packit copr-build

@redhatrises
Copy link
Contributor

/packit build

Co-Authored-By: Jiri Popelka <jpopelka@redhat.com>
@packit-as-a-service
Copy link

There was an error while creating SRPM. You can re-trigger build by adding a comment (/packit copr-build) into this pull request.

Output:

An unexpected error occurred when creating the SRPM: Command failed (rc=1, reason={"metadata":{},"status":"Failure","message":"command terminated with non-zero exit code: Error executing in Docker Container: 1","reason":"NonZeroExitCode","details":{"causes":[{"reason":"ExitCode","message":"1"}]}})
error: Bad source: ./scap-security-guide-0.1.48-xml_parsing.patch: No such file or directory

@dhodovsk
Copy link
Author

Sorry about the super late answer, here is an example of how the spec would change after propose -> https://src.fedoraproject.org/rpms/packit/pull-request/39#request_diff

@yuumasato
Copy link
Member

@openscap-ci test this please

@yuumasato
Copy link
Member

/packit build

Some compressed artifacts in our releases contain the build directory already. So it would fail if we don't use -p option.
@ggbecker
Copy link
Member

I have pushed d4dcd60 and now the builds are passing. It was failing on creating the dir build because it already existed.

@ggbecker
Copy link
Member

@openscap-ci test this please

@ggbecker
Copy link
Member

I have pushed d4dcd60 and now the builds are passing. It was failing on creating the dir build because it already existed.

I think I fully understood what was the problem now.
The "scap-security-guide.spec" in the official fedora builds use the tar.bz2 compressed files found under artifact releases and those are generated by running cmake .. && make package_source which in the end doesn't contain the build directory, so that's why the spec file creates it before compiling the code.

And Packit creates the compressed file by running something like: git archive --output content-v0.1.47.tar.gz --prefix content-v0.1.47 HEAD and then generates the source rpm using content-v0.1.47.tar.gz. This tar.gz file contains the build directory thus leaving us with the necessity of using mkdir -p build as in d4dcd60.

IMO, I think we should also update the spec files under fedora channels, because if in the future we update the one which is added by this PR, it will start to fail again.

@matejak matejak removed their assignment Mar 18, 2020
@shawndwells
Copy link
Member

Closing this as abandoned PR. Perhaps someone will want to take this on in the future.

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.

9 participants