Bug 2102298 - adapt automake to removal of java on i686
Summary: adapt automake to removal of java on i686
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: automake
Version: rawhide
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
Assignee: Frédéric Bérat
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2083750
TreeView+ depends on / blocked
 
Reported: 2022-06-29 15:28 UTC by jiri vanek
Modified: 2022-07-13 15:41 UTC (History)
9 users (show)

Fixed In Version: automake-1.16.5-7.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-13 15:40:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description jiri vanek 2022-06-29 15:28:23 UTC
We are removing i686 java from f37 - https://fedoraproject.org/wiki/Changes/Drop_i686_JDKs
Automake depends on our pkgs, and thus completely whole distribution is affected, as at the end, everything transitively epends on automake (and few others). For the success of proposal, automake have to adjust itself.

For the control over java arches, new macro have been added - %{java_arches}, to be used as

ExclusiveArch: %{java_arches} 

for arch-full packages
and as 

ExclusiveArch: %{java_arches}  noarch

for noarch pkgs.


For plain java pkg, the adaptation is straightforward - https://src.fedoraproject.org/rpms/maven/c/520942645bfd1e4721dacd536a6ccbf80495a8ae?branch=rawhide

for arch-full java pkg, it is harder - https://src.fedoraproject.org/rpms/graphviz/pull-request/9#request_diff

But for automake, I have no idea. looking forward to hear back. Please note, that due to my unplanned absence, I lost one month of work on this proposal, and automake is foundation stone. I'm really sorry for my delay and am most kindly asking you for as quick as possible resolution. TYVVM in advance!!

Comment 1 Frédéric Bérat 2022-06-30 05:40:01 UTC
On automake, the java_devel packages are only needed for the test phase. The tests that need it only make sense if there can be packages that would need java JDK as build requirement (obviously). If java JDK is removed from i686, then there is no point having these tests for i686.

The solution would therefore be to condition the java-devel BuildRequires on the architecture the package is being build for (i.e. not i686) . In theory, if the package isn't here, the corresponding tests will simply be skipped and the build will go forward silently.

Comment 2 jiri vanek 2022-06-30 17:36:07 UTC
Good! That wil make my sleeping much much more easy.
Note that you really have to ifarch the depndece out, so you do not randomly fail becasue of BR not satisfied if your builder wil be i686, which can happen.

Comment 3 jiri vanek 2022-06-30 17:45:02 UTC
(In reply to jiri vanek from comment #2)
> Good! That wil make my sleeping much much more easy.
> Note that you really have to ifarch the depndece out, so you do not randomly
> fail becasue of BR not satisfied if your builder wil be i686, which can
> happen.

Or simply move to ExclusiveArch: %{java_arches} noarch
and you are done.

Comment 4 Frédéric Bérat 2022-07-01 05:52:44 UTC
(In reply to jiri vanek from comment #3)
> (In reply to jiri vanek from comment #2)
> > Good! That wil make my sleeping much much more easy.
> > Note that you really have to ifarch the depndece out, so you do not randomly
> > fail becasue of BR not satisfied if your builder wil be i686, which can
> > happen.
> 
> Or simply move to ExclusiveArch: %{java_arches} noarch
> and you are done.

If I understand well hoe ExclusiveArch works, that solution would also imply that the automake package would not be available in i686 repositories, which is not what you want.

Comment 5 Pavel Raiskup 2022-07-01 12:12:29 UTC
I'm not excited about this, but:
%if 0%(exp=`uname -m`; for arch in %java_arches; do test $exp = $arch && echo 1 && break ; done)
BuildRequires: java-devel
%endif

Or write this in Lua.  It would be nice if there was a system macro
(sister of %java_arches) like %java_supported_arch => 1/0.

Comment 6 Pavel Raiskup 2022-07-01 12:18:31 UTC
What we really need here though is a way to tell the build-system
not to pick the "i686" builders.

Comment 7 Frédéric Bérat 2022-07-01 12:40:26 UTC
(In reply to Pavel Raiskup from comment #5)
> I'm not excited about this, but:
> %if 0%(exp=`uname -m`; for arch in %java_arches; do test $exp = $arch &&
> echo 1 && break ; done)
> BuildRequires: java-devel
> %endif


That looks complicated, I actually wonder if keeping this BuildRequires at all is worth the effort.

Comment 8 jiri vanek 2022-07-01 13:53:16 UTC
(In reply to Frédéric Bérat from comment #4)
> (In reply to jiri vanek from comment #3)
> > (In reply to jiri vanek from comment #2)
> > > Good! That wil make my sleeping much much more easy.
> > > Note that you really have to ifarch the depndece out, so you do not randomly
> > > fail becasue of BR not satisfied if your builder wil be i686, which can
> > > happen.
> > 
> > Or simply move to ExclusiveArch: %{java_arches} noarch
> > and you are done.
> 
> If I understand well hoe ExclusiveArch works, that solution would also imply
> that the automake package would not be available in i686 repositories, which
> is not what you want.

I think not. Automake is noarch. So the ExclusiveArch will only limit build time architectures.

Comment 9 jiri vanek 2022-07-01 13:53:49 UTC
(In reply to Pavel Raiskup from comment #6)
> What we really need here though is a way to tell the build-system
> not to pick the "i686" builders.

Yah, thats what ExclusiveArch should do.

Comment 10 Frédéric Bérat 2022-07-01 14:01:38 UTC
(In reply to jiri vanek from comment #8)
> (In reply to Frédéric Bérat from comment #4)
> > (In reply to jiri vanek from comment #3)
> > > (In reply to jiri vanek from comment #2)
> > > > Good! That wil make my sleeping much much more easy.
> > > > Note that you really have to ifarch the depndece out, so you do not randomly
> > > > fail becasue of BR not satisfied if your builder wil be i686, which can
> > > > happen.
> > > 
> > > Or simply move to ExclusiveArch: %{java_arches} noarch
> > > and you are done.
> > 
> > If I understand well hoe ExclusiveArch works, that solution would also imply
> > that the automake package would not be available in i686 repositories, which
> > is not what you want.
> 
> I think not. Automake is noarch. So the ExclusiveArch will only limit build
> time architectures.

I'm afraid not only, if I believe the doc:
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_noarch_with_unported_dependencies

"you run into a situation where you may need to exclude your package from certain architectures' package repositories or prevent it from building on certain architectures in the buildsystem."
"You can limit both the architectures used to build a noarch package, and the repositories to which the built noarch package will be added, by using either the ExcludeArch: or ExclusiveArch: tags:"

They explicitly specify that both the builder and the repositories are filtered.

Comment 11 Dan Horák 2022-07-01 14:47:09 UTC
I think there is no simple solution if automake should stay available on i686. The one from comment #5 might work, but if the java-devel dependency is used for some java specific parts of automake and not for some general functionality, then I would drop the BR and skip the tests. I think java support in automake is used only very rarely (if at all in the Fedora packages).

Comment 12 jiri vanek 2022-07-01 14:53:52 UTC
I'm pretty sure that both #c10 #c11 are wrong. 

ExclusiveArch: %{java_arches}  noarch

should do all the job, and automake will remain available on all arches as runtime requires allows. Here java is only BR so it will be ok, and include i686

Comment 13 jiri vanek 2022-07-01 14:55:09 UTC
For the arhfull pkg you are of course correct, and  different workaround would need to come to play - see eg graphvviz - https://src.fedoraproject.org/rpms/graphviz/pull-request/9#request_diff

Comment 14 Dan Horák 2022-07-01 15:40:33 UTC
I am pretty sure the "noarch arch" combo worked as described in the docs (I used it personally for some EPEL packages), so if such rpms are being put into all repos, then it's a bug in the current compose tools (pungi) and I would not rely on it.

Comment 15 jiri vanek 2022-07-01 15:53:29 UTC
Ok. Will elaborate on this topic.

Comment 16 jiri vanek 2022-07-01 16:09:37 UTC
 mock  -r fedora-rawhide-i386 --install ant
...
Installing:
 ant                                                              noarch                                               1.10.12-6.fc37                  
...
Running transaction
  Running scriptlet: copy-jdk-configs-4.0-3.fc36.noarch      
  Running scriptlet: java-17-openjdk-headless-1:17.0.3.0.7-5.fc37.i686
  Installing       : javapackages-filesystem-6.1.0-1.fc37.noarch      
  Preparing        :                                                 
  Installing       : javapackages-tools-6.1.0-1.fc37.noarch           
  Installing       : ant-lib-1.10.12-6.fc37.noarch                    
  Installing       : ant-1.10.12-6.fc37.noarch        
...

This version of ant is 100% with  %{java_arches} noarch: https://src.fedoraproject.org/rpms/ant/blob/rawhide/f/ant.spec#_44

Is it enough as a proof?

Comment 17 jiri vanek 2022-07-01 16:10:28 UTC
(In reply to Dan Horák from comment #14)
> I am pretty sure the "noarch arch" combo worked as described in the docs (I
> used it personally for some EPEL packages), so if such rpms are being put
> into all repos, then it's a bug in the current compose tools (pungi) and I
> would not rely on it.

Maybe it is based on fact, that if you honor depndencie's arches, the cdepndnecy itself is not on that arch, and thus indeed you cannot be installed here?

Comment 18 Frédéric Bérat 2022-07-04 06:23:59 UTC
(In reply to jiri vanek from comment #16)
>  mock  -r fedora-rawhide-i386 --install ant
> ...
> Installing:
>  ant                                                              noarch    
> 1.10.12-6.fc37                  
> ...
> Running transaction
>   Running scriptlet: copy-jdk-configs-4.0-3.fc36.noarch      
>   Running scriptlet: java-17-openjdk-headless-1:17.0.3.0.7-5.fc37.i686
>   Installing       : javapackages-filesystem-6.1.0-1.fc37.noarch      
>   Preparing        :                                                 
>   Installing       : javapackages-tools-6.1.0-1.fc37.noarch           
>   Installing       : ant-lib-1.10.12-6.fc37.noarch                    
>   Installing       : ant-1.10.12-6.fc37.noarch        
> ...
> 
> This version of ant is 100% with  %{java_arches} noarch:
> https://src.fedoraproject.org/rpms/ant/blob/rawhide/f/ant.spec#_44
> 
> Is it enough as a proof?

I got confirmation that this behavior is due to a bug that got introduced by switching to Pungi, and that this behavior was different before Pungi was used.
https://pagure.io/fesco/issue/2772#comment-804351

Therefore, either the doc is outdated, or we can't rely on this behavior of the composer.

Comment 19 jiri vanek 2022-07-04 11:38:23 UTC
Thanx. That is important info which I underestimated, and will affect the text  mass bugzilla swarming I will do as soon as possible.

Still, i686  repo is no longer here, only remains as multi-lib in x86_64 so all (except build root?)  will remain ok.
Anyway, yu are right that packages like autoconf can not use  "ExclusiveArch: %{java_arches}  noarch" workaround.

Generally you have two  options, if you don't build on %{java_arches}, do to require java and skip (subset of) tests xor remove javadepndence and skip (subset of) tests always.

Luckily  for us, its "jsut test". Thanx a lof for vlauable fedback!


Note You need to log in before you can comment on or make changes to this bug.