How to setup packit

#1 · closed · 9 comments

View on GitHub ↗

Man2Dev

@LecrisUT

Comments

LecrisUT

Sorry for the long holdup. I hope you can manage the [packit onboarding](https://packit.dev/docs/guide), but let me know otherwise. For the configuration, here is a reference: ```yaml specfile_path: whisper-cpp.spec upstream_package_name: whisper-cpp downstream_package_name: whisper-cpp actions: # fix-spec-file: Optional if you want to make sure the spec file is exactly as in the git repo fix-spec-file: [ ] # create-archive: Here is the magic sauce. Just download the files in `Source` instead of running `git archive` create-archive: - spectool -g -s whisper-cpp.spec # Need to tell packit where the - sh -c 'echo whisper.cpp-${PACKIT_PROJECT_VERSION}.tar.gz' # get-current-version: Just read the `Version` from the spec file get-current-version: - rpmspec -q --qf "%{Version}" --srpm whisper-cpp.spec jobs: - job: copr_build trigger: commit targets: - fedora-rawhide ``` If you want a more reusable template where you just edit the `upstream_package_name` etc. parameters let me know, but I think for now, it would be better to just get accustomed to building for Fedora.

LecrisUT

Oh, I've found an alternative, simpler configuration: ```yaml actions: # fix-spec-file: Make sure the spec file is used as-is fix-spec-file: [ ] # create-archive: Do nothing, but point to a random file so that packit does not error create-archive: - echo whisper-cpp.spec ```

Man2Dev

so it becmoes:

Man2Dev

``` specfile_path: whisper-cpp.spec upstream_package_name: whisper-cpp downstream_package_name: whisper-cpp actions: # fix-spec-file: Optional if you want to make sure the spec file is exactly as in the git repo fix-spec-file: [ ] # create-archive: Here is the magic sauce. Just download the files in `Source` instead of running `git archive` create-archive: - echo whisper-cpp.spec get-current-version: - rpmspec -q --qf "%{Version}" --srpm whisper-cpp.spec jobs: - job: copr_build trigger: commit targets: - fedora-rawhide - fedora-stable ```

Man2Dev

@LecrisUT Small problem i dont think its making the aarch64 builds?

LecrisUT

```yaml targets: - fedora-rawhide-x86_64 - fedora-rawhide-aarch64 ```

LecrisUT

Just checking up, everything going well on this endevour?

Man2Dev

Thanks for reaching out, yeah its been working just fine for whisper-cpp i should close this issue. But if you are interested I was trying to add packit support to pytorch to test my patch but didn't have much luck i think the problem is due to the package requiring to many patches but i'm not sure [commits](https://github.com/Man2Dev/pytorch-vk/commits/rawhide/.packit.yml)

LecrisUT

That is quite a difficult spec file to work on. The patches should not be a problem, maybe you are having issues where the patches cannot be applied because the source has changed. I don't see any log files, so I am not sure. Can you open a PR there and add: ```yaml jobs: - job: copr_build trigger: pull_request targets: - fedora-rawhide ``` Packit would sometimes send PR messages if the configuration is broken, but if it cannot it might silently fail