[opensuse-buildservice] local check for if the "Requires" statements are correct?
Hello, when I am doing an osc build locally all packages that are specified in the "BuildRequires" tags are installed in a isolated environment. Is the same possible for packages (including their versions) needed at runtime, i.e. specified by the "Requires" tags? My goal is to run some unit tests of packaged software to ensure the Requires dependencies are specified correctly without having to test it on a separate test machine. Best regards Gregor -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Gregor,
when I am doing an osc build locally all packages that are specified in the "BuildRequires" tags are installed in a isolated environment.
Quite.
Is the same possible for packages (including their versions) needed at runtime, i.e. specified by the "Requires" tags?
Needed? Or wanted? If your software will not work at runtime without a specific version of the library or other package on which your software depends, then yes, it is not only possible, but advisable.
My goal is to run some unit tests of packaged software to ensure the Requires dependencies are specified correctly without having to test it on a separate test machine.
Perhaps I do not understand your question quite correctly, but, here's my summary: Guaranteeing correct package versions at runtime is exactly what the 'Requires' tag accomplishes for you. Are you asking about the syntax of the Requires tag? Here are some examples for a piece of software which would (respectively) require any version of frobnitz, or any version newer than 1.2.0 or a dependency requiring exactly frobnitz-1.1.7 [0]. Requires: frobnitz Requires: frobnitz >= 1.2.0 Requires: frobnitz = 1.1.7 And, even in the OBS software: Requires: obs-api = %{version}-%{release} -Martin N.B. If I understood you correctly, then this is an RPM question, not so much an OBS question. [0] Bad technique. Do not resort to Requires: frobnitz = 1.1.17 unless you have no other choice. This is tough on software consumers and they may go away. -- Martin A. Brown http://linux-ip.net/ -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Hello Martin, thanks for the answer. On 25/10/14 04:34, Martin A. Brown wrote:
Gregor,
when I am doing an osc build locally all packages that are specified in the "BuildRequires" tags are installed in a isolated environment.
Quite.
Is the same possible for packages (including their versions) needed at runtime, i.e. specified by the "Requires" tags?
Needed? Or wanted? If your software will not work at runtime without a specific version of the library or other package on which your software depends, then yes, it is not only possible, but advisable.
The software needs a _minimum_ version of a dependent package but this fact was not automatically detected by rpm, see below.
My goal is to run some unit tests of packaged software to ensure the Requires dependencies are specified correctly without having to test it on a separate test machine.
Perhaps I do not understand your question quite correctly, but, here's my summary:
Guaranteeing correct package versions at runtime is exactly what the 'Requires' tag accomplishes for you.
Probably I am not familiar with the correct technical terms. I try to describe my scenario in more detail: 1) I created a package for a QT application [1] without secifying any Requires tag. 2) I installed the package on my machine. No problem when executing the app because (among others) libQt5Core 5.3 was already installed. 3a) I installed the package on another openSUSE 13.1 machine via YaST-1-Click-Install. 3b) To resolve dependencies libQT5Core 5.1 got installed automatically from openSUSE 13.1 repos. 3c) When execute the app I got a runtime failure because libQT5Core >= 5.2 is required. 4) To fix it, I specified Requires: libqt5-qtbase >= 5.2 So my question is if it is possible to have a sandboxed environment on my dev machine where I can test _in advance_ if the Requires tag is needed on non-dev maschines. - Gregor
Are you asking about the syntax of the Requires tag? Here are some examples for a piece of software which would (respectively) require any version of frobnitz, or any version newer than 1.2.0 or a dependency requiring exactly frobnitz-1.1.7 [0]. There is no question about the syntax. Thanks.
[1] https://build.opensuse.org/package/view_file/home:codeminister/kreenshot-edi... -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Hi, I found the solution to the problem with the runtime dependency detection were the following two lines in the spec file [1]: ``` %define _use_internal_dependency_generator 0 %define __find_requires %wx_requires ``` The first one apparently disables the automatic dependency detection. And the second one is just wrong (copy&paste error). Best regards Gregor [1] https://build.opensuse.org/package/view_file/home:codeminister/kreenshot-edi... On 24/10/14 10:37, Gregor Mi wrote:
Hello,
when I am doing an osc build locally all packages that are specified in the "BuildRequires" tags are installed in a isolated environment.
Is the same possible for packages (including their versions) needed at runtime, i.e. specified by the "Requires" tags?
My goal is to run some unit tests of packaged software to ensure the Requires dependencies are specified correctly without having to test it on a separate test machine.
Best regards
Gregor
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Monday 2015-02-09 22:09, Gregor Mi wrote:
Hi,
I found the solution to the problem with the runtime dependency detection were the following two lines in the spec file [1]:
``` %define _use_internal_dependency_generator 0 %define __find_requires %wx_requires ```
We don't do these overrides for wx-using packages anymore. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (3)
-
Gregor Mi
-
Jan Engelhardt
-
Martin A. Brown