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

Add %specpartsdir to macros.in #2534

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

ffesti
Copy link
Contributor

@ffesti ffesti commented Jun 7, 2023

so it can be configured from the spec file

Also move the dir beside the %buildsubdir as %{buildsubdir}-SPECPARTS so it doesn't pollute the %buildsubdir.

This patch is still missing adjustments to the dynamic_specs.md as we might decide to keep the SPECPARTS in %buildsubdir

@ffesti
Copy link
Contributor Author

ffesti commented Jun 7, 2023

Replaces: #2533
Resolves: #2532

@pmatilai
Copy link
Member

pmatilai commented Jun 8, 2023

Right, that's another way to deal with it. Having an extra directory seems a bit messy but then it'd be just temporary thing until (and further motivation for) #2078 .

It does add an unconditional dependency on using a buildsubdir (and so, %setup), but that's not necessarily a bad thing at all.

macros.in Outdated
@@ -132,6 +132,8 @@

%_keyringpath %{_dbpath}/pubkeys/

%specpartsdir %{_builddir}/%{buildsubdir}-SPECPARTS
Copy link
Member

Choose a reason for hiding this comment

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

Move this next to the other build directory stuff, _specdir and buildroot and whatnot.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is buildsubdir always defined?

Copy link
Member

Choose a reason for hiding this comment

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

In practise yes, because the debuginfo machinery depends on it.

Copy link
Member

Choose a reason for hiding this comment

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

Oh and just realized that moving the specparts dir out of buildsubdir makes it kinda unnecessary to make it user overridable, but maybe there are other use-cases for that anyhow.

@pmatilai
Copy link
Member

pmatilai commented Jun 8, 2023

It's of course not actually introduced in this patch, but I have to say the %specpartsdir macro name continues to look odd without a leading underscore. But probably that's just from years of conditioning from exposure to the weird underscorey names 😆

@pmatilai
Copy link
Member

pmatilai commented Jun 8, 2023

Of course, moving it out of the main build directory has the same caveat as renaming to a dotfile: the magic becomes largely invisible to the packager.

@ffesti
Copy link
Contributor Author

ffesti commented Jun 8, 2023

Yes, the underscores in macros are a bit of a mess. I modeled %specpartsdir on %buildsubdir which also comes without an underscore. I think the idea is that macros to be used directly don't have an underscore. Stuff to be configured have one underscore and stuff not to be touched have two.

so it can be configured from the spec file

Also move the dir beside the %buildsubdir as %{buildsubdir}-SPECPARTS so
it doesn't pollute the %buildsubdir.

Resolves: rpm-software-management#2532
@ffesti
Copy link
Contributor Author

ffesti commented Jun 13, 2023

Adjusted the docs to the new location and added Resolved tag to the original ticket in the commit message.

@pmatilai pmatilai merged commit df8d1fb into rpm-software-management:master Jun 13, 2023
lbarcziova added a commit to lbarcziova/packit that referenced this pull request Aug 23, 2023
In newer version of rpmbuild, for spec file snippets generated during build prep
there is a directory created with default location %{_builddir}/%{buildsubdir}-SPECPARTS.
This location can be configured via specpartsdir macro. More details: rpm-software-management/rpm#2534

With this solution, when getting the build directory in get_BUILD_dir method, we ignore
the directory with the default location (but this doesn't cover the case when
specpartsdir macro is configured to other location). Without ignoring it, the method
 resulted in an exception because more than one directory could be obtained from the
BUILD directory.
lbarcziova added a commit to lbarcziova/packit that referenced this pull request Aug 23, 2023
In newer version of rpmbuild, for spec file snippets generated during build prep
there is a directory created with default location %{_builddir}/%{buildsubdir}-SPECPARTS.
This location can be configured via specpartsdir macro. More details: rpm-software-management/rpm#2534

With this solution, when getting the build directory in get_BUILD_dir method, we ignore
the directory with the default location (but this doesn't cover the case when
specpartsdir macro is configured to other location). Without ignoring it, the method
 resulted in an exception because more than one directory could be obtained from the
BUILD directory.
@ffesti ffesti deleted the specpartsdir branch October 25, 2024 09:15
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.

3 participants