-
Notifications
You must be signed in to change notification settings - Fork 376
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
Implement a declarative autobuild system (prototype) #2620
Closed
Closed
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ed59d17
Refactor the processing logic out of parseGeneratedSpecs() for reuse
pmatilai 8ab9805
Implement autobuild "template" system (prototype)
pmatilai c0c1e76
fixup! Implement autobuild "template" system (prototype)
pmatilai 6035a58
Autobuild WIP documentation
pmatilai 11769ba
fixup! Implement autobuild "template" system (prototype)
pmatilai 15d6f9e
fixup! Autobuild WIP documentation
pmatilai 52342d4
fixup! Autobuild WIP documentation
pmatilai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Name: amhello | ||
Version: 1.0 | ||
Release: 1 | ||
Source: %{name}-%{version}.tar.gz | ||
License: GPLv2 | ||
Summary: Autotools example | ||
Autobuild: autotools | ||
|
||
%description | ||
%{summary} | ||
|
||
%build -a | ||
cat << EOF > README.distro | ||
Add some distro specific notes. | ||
EOF | ||
|
||
%files | ||
%doc README.distro | ||
%{_bindir}/hello | ||
%{_docdir}/%{name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand
%prep
being part of this. It's not going to differ from one build system to another, and including it in the%build -a
steps increases the number of spec files that won't be able to use autobuild because they need to perform some sort of pre-build shenanigans. (Runningsed
on some of the extracted files, extracting additional%SOURCEN
tarballs, etc...)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, the %prep part is here more for demo purposes than something we'd want to ship for real. Instead we should probably just automatically add "%autosetup -p1" %prep section to everything that has sources and does not have a prep. I don't understand the remark about %build -a though. If you need to do pre-build shenanigans, you do it in one %prep -a for the earliest opportunity (assuming automatically added %prep %autosetup) , or in %conf -p/-a or %build -p, as appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, there was a reason %prep is a part of this: language ecosystems may have source formats outside the tarball realm, and in those cases we'd rather just have the ecosystem define %prep as they see fit, using their native tools. Ruby is an example here - rpm shouldn't have to know about .gem.
As for the rest, we could indeed just autopopulate %prep with a generic "%autosetup -p1" when Autobuild is set, but I'm not sure it's somehow better than doing it explicitly in the autobuild definition. It's just one line in the definition, and there could be other ecosystem preferences I guess. Thoughts welcome certainly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and that's what the last fixup does: add autobuild defaults that will be applied if there's no build-system specific section. Only probably makes sense for %prep and %clean but the mechanism is generic so supporting the all makes no difference in code.