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

Fix failing RPM builds due to files ignored by Git #679

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

apyrgio
Copy link
Contributor

@apyrgio apyrgio commented Jan 18, 2024

Fix failing RPM builds by doing the following:

  1. Remove .gitignore from a dir where Poetry would ultimately build our Python wheel.
  2. Include data files only on sdist, and in a way that Poetry understands.

Fixes #678
Refs #677

@deeplow
Copy link
Contributor

deeplow commented Jan 22, 2024

On another discussion you also mentioned:

Turns out that Poetry will silently ignore everything and create an empty wheel, without any indication in the logs. If you don't have git installed, or do this from any other path in your system, Poetry will create a functional wheel. See python-poetry/poetry#2809.

Do you want to add an assert that git exists? It'll be kind of an edge-case but might be worth referencing somewhere since you came across it.

@apyrgio
Copy link
Contributor Author

apyrgio commented Jan 22, 2024

We can't assert that Git exists, because it's not a requirement for build our RPM packages. Actually, some of our CI runners don't have Git installed, which is why we could build RPM packages all this time.

Copy link
Contributor

@deeplow deeplow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I tried installing and running and it worked well.

I also uncompressed the .rpm file with rpm2cpio dangerzone*.rpm | cpio -idmv and confirmed the files made sense. It even put the README.md in the doc directory and didn't include anything in the install/.

I have tested on any other platforms but since you concluded that PEP-517 isn't really used by other platforms for building, I don't expect any of that to break.

Remove the .gitignore file for rpm-build, because it leads to making
Poetry ignore the Dangerzone module, when building the Python wheel.

Refs #678
Make Poetry include data files only in the source distribution, and not
on our wheels. This mainly makes RPM packaging a bit easier, but does
not solve the problem of how to install files to
`/usr/share/dangerzone`.

Also, include files using globs, which is the way Poetry prefers.

Fixes #678
Refs #677
@apyrgio apyrgio force-pushed the 678-poetry-include branch from a510a09 to d854657 Compare January 23, 2024 14:19
@apyrgio apyrgio merged commit d854657 into main Jan 23, 2024
10 of 11 checks passed
@apyrgio apyrgio deleted the 678-poetry-include branch May 22, 2024 09:35
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.

Poetry cannot build wheel in a build directory ignored by Git
2 participants