Skip to content

Fix "make rpm" - #172

Open
ldoktor wants to merge 2 commits into
avocado-framework:mainfrom
ldoktor:make-rpm
Open

Fix "make rpm"#172
ldoktor wants to merge 2 commits into
avocado-framework:mainfrom
ldoktor:make-rpm

Conversation

@ldoktor

@ldoktor ldoktor commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

this is a follow-up after #165 which fixes the Makefile so the "make rpm" works and then contains extra commit to attempt to restore dynamic versioning for pip versions while keeping hardcoded one for RPMs.

@pevogam please try this out I hope it'll work for you as well as for me. My main problem with the current version is that any issue reported will only contain the hardcoded version but we will not know whether it was released, development or even custom dirty version. I'd really like to have some dynamic versioning in-place.

ldoktor and others added 2 commits July 21, 2026 16:13
the setuptools version and SPEC_VERSION might not be in-sync, which
breaks "make rpm" and "make release-rpm". Let's prioritize the
spec-version for RPM builds and VERSION everywhere else.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
with hardcoded versions we can not distinguish between released or any
development or even dirty versions, which could have terrible
consequences when reading issues. Let's bring back the "dynamic"
versioning but add "fallback_version" to use the hardcoded value in rpm
builds.

Note the "make rpm" should always use the spec-version, this is
deliberate to ensure rpms use spec files while pipy/devel versions use
dirty versioning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
@pevogam

pevogam commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Gladly! Will let you know within a few days.

@pevogam pevogam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @ldoktor, the build indeed passes just fine. However I have one major question in the comments below in addition to a few minor change suggestions.

Comment thread Makefile
PROJECT=aexpect
VERSION=$(shell $(PYTHON) -m setuptools_scm)
VERSION=$(shell $(PYTHON) -m setuptools_scm 2>/dev/null || grep '^Version:' python-$(PROJECT).spec | awk '{print $$2}')
SPEC_VERSION=$(shell grep '^Version:' python-$(PROJECT).spec | awk '{print $$2}')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This line seems repetitive of the one above, how about simply getting SPEC_VERSION first and then retrieving the backup version directly from this variable being already set?

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.

sure

Comment thread Makefile
source-release: clean
mkdir -p SOURCES
git archive --prefix="$(PROJECT)-$(VERSION)/" -o "SOURCES/$(PROJECT)-$(VERSION).tar.gz" $(VERSION)
git archive --prefix="$(PROJECT)-$(SPEC_VERSION)/" -o "SOURCES/$(PROJECT)-$(SPEC_VERSION).tar.gz" $(SPEC_VERSION)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So I assume this and the below diff blocks need SPEC_VERSION explicitly? What would happen if the SPEC_VERSION differs from the VERSION here? Would this still be reasonable?

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.

The previous (hardcoded) version used a fixed version to avoid problems passing it between mock and the repo. To keep this behaviour I added the SPEC_VERSION which is used for rpm targets while keeping it dynamic for the other targets. So different version should result in the RPM force-setting to the SPEC one.

Ideally I'd like to remove the SPEC_VERSION completely, but you claimed it didn't work on your build system.

Comment thread pyproject.toml
[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "node-and-date"
fallback_version = "1.8.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So in some sense we still end up with non-dynamic version, no? Because either we have to update this each time as we would have updated version or we don't update it but get strange cases where higher version might display as lower version which could cause some havoc in deployment pipelines.

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.

2 participants