Skip to content

Convert make_rpm to argparse and add an initial test for it. - #75

Merged
aiuto merged 2 commits into
bazelbuild:masterfrom
aiuto:rpm
Aug 15, 2019
Merged

aiuto merged 2 commits into
bazelbuild:masterfrom
aiuto:rpm

Conversation

@aiuto

@aiuto aiuto commented Aug 9, 2019 •

Copy link
Copy Markdown
Collaborator

Fixes #49

There are two things going on here.

  1. Convert make_rpm.py to use argparse
  2. Add a minimal test to show it working
  3. Drive by fixe to make_rpm.py because of a BUILDROOT issue.

While testing, I think I discovered a latent bug in the tool, w.r.t. BUILDROOT, so I had to fix that to make any pkg_rpm() instance build. Regardless of that issue, the change to argparse is what this PR is about. If it turns out there is still flakiness w.r.t. BUILDROOT, we can fix that as a distinct issue.

Comment thread pkg/make_rpm.py
def CallRpmBuild(self, dirname):
"""Call rpmbuild with the correct arguments."""

buildroot = os.path.join(dirname, RpmBuilder.BUILD_DIR)

@aiuto aiuto Aug 9, 2019 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the only interesting part of the change. It changes --builtroot from /BUILDROOT to /BUILD. Without that, it was not finding any of my sources. I think this is actually a manifestation of pkg_rpm being built for an old version of rpmbuild and rpmbiuld changing under it. That points to the fragility of the rule.

@brandjon brandjon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not too familiar with this but LGTM.

Comment thread pkg/make_rpm.py Outdated
@aiuto
aiuto merged commit ad8f0f2 into bazelbuild:master Aug 15, 2019
@aiuto
aiuto deleted the rpm branch August 15, 2019 20: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.

replace absl.flags with argparse in the tools (make_dep.py, make_rpm.py, ...)

2 participants