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 rpm build issues introduced by jsonschema feature #74

Merged
merged 6 commits into from
Apr 12, 2023

Conversation

phlogistonjohn
Copy link
Collaborator

@phlogistonjohn phlogistonjohn commented Apr 6, 2023

Upon merging #69 the samba-container builds broke.

The RPM build failed because the tox test dependencies listed jsonschema and no jsonschema python packages were installed. On top of that, the python3-jsonschema package in fedora 36 is incompatible and breaks the tests. So we're mostly just undoing the initial damage to try and get samba-containers working again.

To prevent future damage this PR enables the CI to run the RPM build step which was previously skipped (and only executed by samba-container builds).

Annoyingly, the tests passed and nothing seemed amiss at first, but
the package was missing from the list.

Signed-off-by: John Mulligan <[email protected]>
Due to a somewhat hilarious misalignment of the stars the recently added
jsonschema support doesn't actually work on the distro we build for.
This was masked by the fact that the sambacc CI didn't test the distro
level stuff that actually showed there was a problem.
This change just tells mypy to chillax if it fails to import typing data
for jsonschema so that it can pass the tests with or without the
jsonschema library present (as it is an optional dep).

Signed-off-by: John Mulligan <[email protected]>
We need to unscramble our distro level dependencies before
we can really use jsonschema.

Signed-off-by: John Mulligan <[email protected]>
Previously, we only executed the rpm build if the `distname` was given,
meaning we expected to output the rpms to a "distribution" location.
But this meant that the rpms were typically only built when samba
containers are being built and never as part of a CI run.
This change updates the build script to always build the RPMs, even
if distname is not supplied by using a "scratch" dist dir.
Now, the rpm build should be executed as part of a typical CI run.

Signed-off-by: John Mulligan <[email protected]>
@phlogistonjohn
Copy link
Collaborator Author

The build fails in the CI and works locally. Even though we're (in theory) using the same containerized environment.

The first thing that appears significantly different is:

 running egg_info
writing sambacc.egg-info/PKG-INFO
writing dependency_links to sambacc.egg-info/dependency_links.txt
writing entry points to sambacc.egg-info/entry_points.txt
writing top-level names to sambacc.egg-info/top_level.txt
listing git files failed - pretending there aren't any                       <---- this isn't in my output
reading manifest file 'sambacc.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'COPYING'
writing manifest file 'sambacc.egg-info/SOURCES.txt'

despite tweaking the checkout config, I still don't see why this happens

@phlogistonjohn phlogistonjohn added the do-not-merge Hold on label Apr 6, 2023
@phlogistonjohn
Copy link
Collaborator Author

Fixed the problem, but now I need to clean up the debris.

In some cases, specifically the github CI runner, calls made to
git by setuptools_scm were failing leading to source taballs that
were missing files, which lead to rpmbuild failures. This was all
because of "stricter repository ownership checks" in git.
Use the `safe.directory` configuration key to always permit
the use of our checkout when run in the container.

Signed-off-by: John Mulligan <[email protected]>
By default, github ci action checks out with no history. This leads to
warnings in setuptools_scm and may lead to errors in a future version.
This is a pretty small repo too and thus we shouldn't have much if any
drawbacks to pulling all history.

Signed-off-by: John Mulligan <[email protected]>
Copy link
Contributor

@obnoxxx obnoxxx left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit 3c61a4c into samba-in-kubernetes:master Apr 12, 2023
@phlogistonjohn phlogistonjohn deleted the jjm-fix-rpm branch April 13, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants