[opensuse-buildservice] Expansion-Error on suse-macros
Hi, due to my lazyness, I didn't read the instructions for KMP-packages and fdupes correctly. When I used the respective macros %fdupes and %suse_kernel_module_package I got really weird errors (e.g. 'fg no job control' for %fdupes), because the corresponding BuildRequires was not in place. Is it possible to integrate the suse-macros into the Expansion-check so that the real error is made more obvious ? Many thanks, Christof -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Christof Hanke napsal(a):
due to my lazyness, I didn't read the instructions for KMP-packages and fdupes correctly. When I used the respective macros %fdupes and %suse_kernel_module_package I got really weird errors (e.g. 'fg no job control' for %fdupes), because the corresponding BuildRequires was not in place. Is it possible to integrate the suse-macros into the Expansion-check so that the real error is made more obvious ?
I fear it's hard to do it correctly. E.g. does this snippet require fdupes.rpm or not? %if %{defined fdupes} %fdupes ... %endif Michal -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2/17/2009 at 5:52 PM, Michal Marek
wrote: Christof Hanke napsal(a): I fear it's hard to do it correctly. E.g. does this snippet require fdupes.rpm or not? %if %{defined fdupes} %fdupes ... %endif
I guess that OBS spec parser is already somewhat 'smart' with such things, otherwise a snippet like %if 0%{suse_version} <= 1110 BuildRequires: foo-devel %endif would also cause trouble with detecting when foo-devel is required. Dominique -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Dominique Leuenberger napsal(a):
On 2/17/2009 at 5:52 PM, Michal Marek
wrote: Christof Hanke napsal(a): I fear it's hard to do it correctly. E.g. does this snippet require fdupes.rpm or not? %if %{defined fdupes} %fdupes ... %endif
I guess that OBS spec parser is already somewhat 'smart' with such things, otherwise a snippet like
%if 0%{suse_version} <= 1110 BuildRequires: foo-devel %endif
%suse_version is defined in the project config, it doesn't change if you add or remove packages. Or if you want another example: if test -x /usr/bin/fdupes %fdupes ... fi Michal -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Michal Marek napsal(a):
Christof Hanke napsal(a):
due to my lazyness, I didn't read the instructions for KMP-packages and fdupes correctly. When I used the respective macros %fdupes and %suse_kernel_module_package I got really weird errors (e.g. 'fg no job control' for %fdupes), because the corresponding BuildRequires was not in place. Is it possible to integrate the suse-macros into the Expansion-check so that the real error is made more obvious ?
I fear it's hard to do it correctly. E.g. does this snippet require fdupes.rpm or not? ...
That said, a cool feature would be a script that takes the failed build log and tries to gues what went wrong, e.g. /fg: no job control/ => undefined macro. But not "I refuse to build your package because I think you are using undefined macros" :-). Michal -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Michal Marek wrote:
Michal Marek napsal(a):
Christof Hanke napsal(a):
due to my lazyness, I didn't read the instructions for KMP-packages and fdupes correctly. When I used the respective macros %fdupes and %suse_kernel_module_package I got really weird errors (e.g. 'fg no job control' for %fdupes), because the corresponding BuildRequires was not in place. Is it possible to integrate the suse-macros into the Expansion-check so that the real error is made more obvious ?
I fear it's hard to do it correctly. E.g. does this snippet require fdupes.rpm or not?
...
That said, a cool feature would be a script that takes the failed build log and tries to gues what went wrong, e.g. /fg: no job control/ => undefined macro. But not "I refuse to build your package because I think you are using undefined macros" :-).
Michal
Maybe im just being obvious, but generally when I am writing a spec file I check for the existence of any custom/distro macros before using them, makes porting them easier. The way to avoid undefined macros killing the build is to call them with substitution, e.g. %{?fdupes} evaluates to "" (nothing) if fdupes is not defined and "%{fdupes}" if it is, etc. You can even do if-then e.g. %{?suse_version:%fdupes} (if suse_version is defined then run fdupes otherwise nothing). Regards, MasterPatricko -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tuesday 17 February 2009 22:16:59 MasterPatricko wrote:
Michal Marek wrote:
Michal Marek napsal(a):
Christof Hanke napsal(a):
due to my lazyness, I didn't read the instructions for KMP-packages and fdupes correctly. When I used the respective macros %fdupes and %suse_kernel_module_package I got really weird errors (e.g. 'fg no job control' for %fdupes), because the corresponding BuildRequires was not in place. Is it possible to integrate the suse-macros into the Expansion-check so that the real error is made more obvious ?
I fear it's hard to do it correctly. E.g. does this snippet require fdupes.rpm or not?
...
That said, a cool feature would be a script that takes the failed build log and tries to gues what went wrong, e.g. /fg: no job control/ => undefined macro. But not "I refuse to build your package because I think you are using undefined macros" :-).
Michal
Sorry for the delay....
Maybe im just being obvious, but generally when I am writing a spec file I check for the existence of any custom/distro macros before using them, makes porting them easier. True, but it's not always that the macros don't exist... for fdupes you are right, but %suse_kernel_module_package just throws "internal kmp-error" IIRC if the BuildRequires does not include the corresponding packages.
The way to avoid undefined macros killing the build is to call them with substitution, e.g. %{?fdupes} evaluates to "" (nothing) if fdupes is not defined and "%{fdupes}" if it is, etc.
Thanks, I'll do it like this. In that way, I only need one %if for the Buildrequires for the enterprise versions.
You can even do if-then e.g. %{?suse_version:%fdupes} (if suse_version is defined then run fdupes otherwise nothing).
That doesn't work, because fdupes is not in SLES_9 nor in SLE_10. Regards, Christof -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Christof Hanke
Hi,
due to my lazyness, I didn't read the instructions for KMP-packages and fdupes correctly.
When I used the respective macros %fdupes and %suse_kernel_module_package I got really weird errors (e.g. 'fg no job control' for %fdupes), because the corresponding BuildRequires was not in place.
Is it possible to integrate the suse-macros into the Expansion-check so that the real error is made more obvious ?
The challenge is that you _might_ actually use job control in a build script, and refer to background jobs with %1, %2. This is very rare, though, and I agree it would be most helpfull to a warning to "%" signs remaining in the spec file after macro expansion. I'd also like to be able to suppress that warning, so I can easily say: "_this_ % here is really what I want." S. -- Susanne Oberhauser +49-911-74053-574 SUSE -- a Novell Business OPS Engineering Maxfeldstraße 5 Processes and Infrastructure Nürnberg SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (6)
-
Christof Hanke
-
Christof Hanke
-
Dominique Leuenberger
-
MasterPatricko
-
Michal Marek
-
Susanne Oberhauser