openSUSE / obs-docu

Official Open Build Service Documentation. Content gets reviewed and edited. Generated books are available at http://www.openbuildservice.org
34 stars 70 forks source link

sync (with build script), update and fix build configuration chapter #331

Closed adrianschroeter closed 3 months ago

adrianschroeter commented 4 months ago

did we clarify your questions earlier this week?

smithfarm commented 3 months ago

@adrianschroeter This PR is not getting rid of the term "project config", so I guess it's OK that "project config" is being changed to "build config" only in certain places. But I'm missing an explanation of how the OBS determines which individual project configurations get merged to form the final build configuration?

On a somewhat unrelated note: is there an osc command to list the full expanded path for a given repo? That might help folks understand where certain lines from their build config are coming from.

adrianschroeter commented 3 months ago

I tried to adress the difference between the editable hunks and the effective build configuration at build time now.

smithfarm commented 3 months ago

The "macros" section ("Macro Definitions in the Build Configuration") is unfortunately still not clear. What I was able to figure out was:

  1. there are two types of macros: "%define macros" and "Macros: macros"
  2. %define macros are only expanded in the build configuration
  3. Macros: macros are only expanded in the build root

This necessarily implies that if you want to define a macro universally, so it expands in both places, you have to define it twice. And I can see this is being done "in real life", e.g. (direct quote from a prjconf):

%define sle_version 150600
Macros:
%sle_version 150600
:Macros

What is not clear:

  1. what happens if someone uses %global, instead of %define, in the build configuration? Is it effectively the same as %define, or different?
  2. I understand that Macros: macro definitions can be placed anywhere in the prjconf as long as they are terminated with a :Macros line. It is also possible to put them at the end of the prjconf, in which case the terminating :Macros line is optional. But is the beginning Macros: line also optional? For example, what happens if I have prjconf file consisting of only one line, e.g.:
%_with_foo 1
<EOF>

I tried it and the OBS accepts it, but I don't know what the effect is. Is it the same as:

Macros:
%_with_foo 1
<EOF>

and also the same as

Macros:
%_with_foo 1
:Macros
<EOF>

?

Oh, and another question: when I save my prjconf, does the OBS do any validation on it at all? For example, I tried the following prjconf, which in my understanding is invalid:

%_with_lowmem_builder 1
FileProvides: /usr/bin/dbus-run-session dbus-1

but the OBS accepts it. Is the first line (which is not a valid Macros: macro definition, nor a valid %defines macro defintion) simply ignored?

adrianschroeter commented 3 months ago

@smithfarm I tried to address your questions in my last commit.