Skip to contentSkip to conversation

Synchronisation of dependencies between Config.in and .mk files ?

Buildroot Thomas Petazzoni 5 participants 11 messages Oct 27, 2008 – Oct 28, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

Currently, there are two complementary ways of expressing dependencies between packages:

* Through the select BR2_FOOBAR statements in the Config.in files ;

* Through the FOOBAR_DEPS variable in the package makefiles.

The second one is absolutely necessary, as it makes sure that packages are built in the proper order. The first one allows packages Makefiles to adapt their configuration depending on the existing dependencies (i.e if tslib is available, then enable support for touchscreens, etc.).

However, there are great chances for these two lists of dependencies for each package to become unsynchronized.

What's the policy about this ? What are the current techniques to keep them synchronized ?

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#1 lore raw

2008/10/27 Thomas Petazzoni <[email protected]>:

Quoted 7 lines

Hi,

Currently, there are two complementary ways of expressing dependencies between packages:

* Through the select BR2_FOOBAR statements in the Config.in files ;

Good: because we can see in the menuconfig what is selected immediately
Bad: because once we remove the initial package we still stay with dependencies

Quoted 2 lines

* Through the FOOBAR_DEPS variable in the package makefiles.

Bad: because these dependencies are not displayed into menuconfig
Bad: because these dependencies would not be downloaded in 'make
sources' <--- !!!
Good: because these dependencies are necessary for building

Quoted 11 lines

The second one is absolutely necessary, as it makes sure that packages are built in the proper order. The first one allows packages Makefiles to adapt their configuration depending on the existing dependencies (i.e if tslib is available, then enable support for touchscreens, etc.).

However, there are great chances for these two lists of dependencies for each package to become unsynchronized.

What's the policy about this ? What are the current techniques to keep them synchronized ?

tristate, where x means depend on something:

BR2_CIAO=y
BR2_CIAO=x
# BR2_CIAO is not set

or

BR2_CIAO=y
# BR2_CIAO needed by BR2_PLUTO BR2_PAPERINO ...
# BR2_CIAO is not set

'select' in Config.in should not exist and 'make' should generate at
run-time all 'x-select' constrains accordingly with dependencies in package.mk

Easy to say but...
;-)

Cheers,

Signature · 1 line
/roberto
#2 lore raw
In reply to Thomas Petazzoni
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Thomas> However, there are great chances for these two lists of Thomas> dependencies for each package to become unsynchronized.

True, but I don't think there's any easy way of going from Kconfig selects to Makefile deps.

Thomas> What's the policy about this ? What are the current Thomas> techniques to keep them synchronized ?

Well, the policy is that they should be in sync - And we currently have no way of ensuring that they are in sync besides manual review.

Do you have any ideas about how to solve this in a nicer way?

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

Le Mon, 27 Oct 2008 19:43:07 +0100,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 1 line

Do you have any ideas about how to solve this in a nicer way?

Not really. Maybe the Config.in read by kconfig could be generated by the Makefile system. Either completely from the Makefiles, or from Config.in.tmp files, parsed and modified to contain the dependencies.

However, there are some packages with optional dependencies, like in matchbox:

ifeq ($(strip $(BR2_PACKAGE_X11R7_LIBXCOMPOSITE)),y) ifeq ($(strip $(BR2_PACKAGE_X11R7_LIBXPM)),y)
MATCHBOX_WM_OPTS+=--enable-composite MATCHBOX_WM_DEPS+=xlib_libXcomposite MATCHBOX_WM_DEPS+=xlib_libXpm MATCHBOX_LIB_DEPS+=xlib_libXpm
endif
endif

I'm not sure how to handle that kind of case.

Sincerly,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Le Mon, 27 Oct 2008 19:43:07 +0100, Thomas> Peter Korsgaard <[email protected]> a ?crit :

Quoted 1 line
Quoted 1 line

Do you have any ideas about how to solve this in a nicer way?

Thomas> Not really. Maybe the Config.in read by kconfig could be Thomas> generated by the Makefile system. Either completely from the Thomas> Makefiles, or from Config.in.tmp files, parsed and modified Thomas> to contain the dependencies.

Thomas> However, there are some packages with optional dependencies, Thomas> like in matchbox:

I'm also not sure all packages use exactly the same make symbol and BR2_PACKAGE_<symbol> - Personally I don't think it's worth the effort.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

2008/10/27 Peter Korsgaard <[email protected]>:

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Le Mon, 27 Oct 2008 19:43:07 +0100, Thomas> Peter Korsgaard <[email protected]> a ?crit :

Quoted 1 line
Quoted 1 line

Do you have any ideas about how to solve this in a nicer way?

Thomas> Not really. Maybe the Config.in read by kconfig could be Thomas> generated by the Makefile system. Either completely from the Thomas> Makefiles, or from Config.in.tmp files, parsed and modified Thomas> to contain the dependencies.

Quoted 6 lines

Thomas> However, there are some packages with optional dependencies, Thomas> like in matchbox:

I'm also not sure all packages use exactly the same make symbol and BR2_PACKAGE_<symbol> - Personally I don't think it's worth the effort.

A script which make people remember to keep those things synchronized?

Without this synchronization 'make source' is broken.

Cheers,

Signature · 1 line
/roberto
#6 lore raw
In reply to Thomas Petazzoni

Thomas Petazzoni, 27.10.2008:

Quoted 8 lines

Le Mon, 27 Oct 2008 19:43:07 +0100,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 1 line

Do you have any ideas about how to solve this in a nicer way?

Not really. Maybe the Config.in read by kconfig could be generated by the Makefile system. Either completely from the Makefiles, or from Config.in.tmp files, parsed and modified to contain the dependencies.

When reading it from the Makefiles, you couldn't automatically decide whether to use "select" or "depends on", because in the Makefile there is no difference between them.

Markus

#7 lore raw

2008/10/27 Markus Heidelberg <[email protected]>:

Quoted 6 lines

Thomas Petazzoni, 27.10.2008:

Quoted 5 lines

Le Mon, 27 Oct 2008 19:43:07 +0100,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 1 line

Do you have any ideas about how to solve this in a nicer way?

Quoted 7 lines
Quoted 3 lines

Not really. Maybe the Config.in read by kconfig could be generated by the Makefile system. Either completely from the Makefiles, or from Config.in.tmp files, parsed and modified to contain the dependencies.

When reading it from the Makefiles, you couldn't automatically decide whether to use "select" or "depends on", because in the Makefile there is no difference between them.

Reading/including only those .mk for which packages has been selected
and the meaning became always: 'select'

I think the use of "depends on" in Config.in should be used ONLY when
arch restrictions have been involved.

Example: I need nfs but nfs 'depends on' rpc... the first time in the
menuconfig I will waste minutes to understand I have to select rpc in order to select nfs, why? If I want a cold beer I ask for a cold beer. Why I have to ask "do you have the freezer pluged in", before? It is obvious that a freezer is needed for a cold beer but it is not obvious asking for a freezer when you are looking for a beer.

Cheers,

Signature · 1 line
/roberto
#8 lore raw

Roberto A. Foglietta, 27.10.2008:

Quoted 10 lines

2008/10/27 Markus Heidelberg <[email protected]>:

Quoted 3 lines

When reading it from the Makefiles, you couldn't automatically decide whether to use "select" or "depends on", because in the Makefile there is no difference between them.

Reading/including only those .mk for which packages has been selected
and the meaning became always: 'select'

I think the use of "depends on" in Config.in should be used ONLY when
arch restrictions have been involved.

Definitely not. For example sdl_image depends on sdl instead of selecting it. So you can have a hierarchical menu in Config.in and hide all the sdl_ packages unless sdl is not activated. Of course this is only possible for packages in direct relation to each other.

Quoted 6 lines

Example: I need nfs but nfs 'depends on' rpc... the first time in the
menuconfig I will waste minutes to understand I have to select rpc in order to select nfs, why? If I want a cold beer I ask for a cold beer. Why I have to ask "do you have the freezer pluged in", before? It is obvious that a freezer is needed for a cold beer but it is not obvious asking for a freezer when you are looking for a beer.

There are settings that probably shouldn't be selected automatically, for example such which require a recompilation of the toolchain. In this case there could also be a "comment NFS needs RPC" in the Config.in. But I think that is hard to decide, there shouldn't be too much comments in menuconfig.

Markus

#9 lore raw
In reply to Roberto A. Foglietta
Quoted 21 lines · Roberto A. Foglietta

2008/10/27 Markus Heidelberg <[email protected]>:

Quoted 6 lines

Thomas Petazzoni, 27.10.2008:

Quoted 5 lines

Le Mon, 27 Oct 2008 19:43:07 +0100,
Peter Korsgaard <[email protected]> a ?crit :

Quoted 1 line

Do you have any ideas about how to solve this in a nicer way?

Quoted 7 lines
Quoted 3 lines

Not really. Maybe the Config.in read by kconfig could be generated by the Makefile system. Either completely from the Makefiles, or from Config.in.tmp files, parsed and modified to contain the dependencies.

When reading it from the Makefiles, you couldn't automatically decide whether to use "select" or "depends on", because in the Makefile there is no difference between them.

Reading/including only those .mk for which packages has been selected
and the meaning became always: 'select'

I think the use of "depends on" in Config.in should be used ONLY when
arch restrictions have been involved.

Quoted 6 lines

Example: I need nfs but nfs 'depends on' rpc... the first time in the
menuconfig I will waste minutes to understand I have to select rpc in order to select nfs, why? If I want a cold beer I ask for a cold beer. Why I have to ask "do you have the freezer pluged in", before? It is obvious that a freezer is needed for a cold beer but it is not obvious asking for a freezer when you are looking for a beer.

However, IIRC "select" in Kconfig is dangerous because it completely overrides the dependencies on the option being force selected. There are technical issues with select and it must be used with caution.

g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#10 lore raw
In reply to Roberto A. Foglietta
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Roberto" == Roberto A Foglietta <[email protected]> writes:

Hi,

Roberto> I think the use of "depends on" in Config.in should be used Roberto> ONLY when arch restrictions have been involved.

We normally only use depends on for sub packages (E.G. X applications that don't make any sense without X) and for toolchain dependencies (E.G. locale support) as changing toolchain option with select isn't a good thing.

Signature · 1 line
Bye, Peter Korsgaard