Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: allow some ordering of package builds #6113

Closed
wants to merge 3 commits into from

Conversation

kaspar030
Copy link
Contributor

Previously, packages would be built in alphabetical ordering and possibly in parallel.
This PR adds an option to build certain packages prior to others and adds them as dependencies.

Fixes #6022.

@kaspar030 kaspar030 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: build system Area: Build system labels Nov 13, 2016
@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 13, 2016
@kaspar030
Copy link
Contributor Author

Hm, does anyone know how to get rid of this:

make: Circular /home/kaspar/src/riot/examples/nanocoap_server/bin/nrf52dk/nordic_softdevice_ble.a <- /home/kaspar/src/riot/examples/nanocoap_server/bin
/nrf52dk/nordic_softdevice_ble.a dependency dropped.

@miri64
Copy link
Member

miri64 commented Nov 13, 2016

Hm, does anyone know how to get rid of this:

Break the circle ;-).

@kaspar030
Copy link
Contributor Author

Break the circle ;-).

Yeah. It is caused by making all packages depend on all buildfirst packages. How can I filter the dependencies so the prerequisite doesn't include the target?

@miri64
Copy link
Member

miri64 commented Nov 13, 2016

mhh… using $(filter-out, ..., ...) but I don't see where you should apply that.

@@ -573,3 +573,8 @@ USEPKG := $(sort $(USEPKG))
ifneq ($(OLD_USEMODULE) $(OLD_USEPKG),$(USEMODULE) $(USEPKG))
include $(RIOTBASE)/Makefile.dep
endif

USEPKG_BUILDFIRST := nordic_softdevice_ble
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this ordering problem persist for packages in USEPKG_BUILDFIRST with the proposed solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. I consider this a quickfix for the problem at hand. I'd prefer full dependencies, or split download/patch and compile steps. But they'd be a lot more work to implement...

@kaspar030
Copy link
Contributor Author

ping

This fixes everything for nrf52dk which uses a package name > nordic_softdevice_ble...

@miri64
Copy link
Member

miri64 commented Nov 18, 2016

Is this fixed?

Hm, does anyone know how to get rid of this:

make: Circular /home/kaspar/src/riot/examples/nanocoap_server/bin/nrf52dk/nordic_softdevice_ble.a <- /home/kaspar/src/riot/examples/nanocoap_server/bin
/nrf52dk/nordic_softdevice_ble.a dependency dropped.

@kaspar030
Copy link
Contributor Author

Is this fixed?

No, but I don't know how to fix it, and it is purely cosmetic.

@miri64
Copy link
Member

miri64 commented Nov 18, 2016

Is this fixed?

No, but I don't know how to fix it, and it is purely cosmetic.

I argue that it is not just cosmetic if there is a circular dependency. That's a conceptual issue.

@kaspar030
Copy link
Contributor Author

I argue that it is not just cosmetic if there is a circular dependency. That's a conceptual issue.

In general I totally agree. In this specific case the circular dependency is spotted where defined and removed by make, in this one line, and there's no easy way to remove the circular dependency beforehand. It also doesn't harm in any way other than the notice.

@miri64
Copy link
Member

miri64 commented Nov 18, 2016

In general I totally agree. In this specific case the circular dependency is spotted where defined and removed by make, in this one line, and there's no easy way to remove the circular dependency beforehand. It also doesn't harm in any way other than the notice.

Here is one easy (not sure of ugly ^^") way:

diff --git a/Makefile.include b/Makefile.include
index fa9e85b..238320b 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -303,8 +303,13 @@ USEMODULE_INCLUDES_ = $(shell echo $(USEMODULE_INCLUDES) | tr ' ' '\n' | awk '!a

 INCLUDES += $(USEMODULE_INCLUDES_:%=-I%)

-.PHONY: $(USEPKG:%=${BINDIR}/%.a)
-$(USEPKG:%=${BINDIR}/%.a): $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG_BUILDFIRST:%=${BINDIR}/%.a)
+USEPKG_BUILDLATER := $(filter-out $(USEPKG_BUILDFIRST),$(USEPKG))
+.PHONY: $(USEPKG_BUILDLATER:%=${BINDIR}/%.a)
+$(USEPKG_BUILDLATER:%=${BINDIR}/%.a): $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG_BUILDFIRST:%=${BINDIR}/%.a)
+       @mkdir -p ${BINDIR}
+       "$(MAKE)" -C $(RIOTPKG)/$(patsubst ${BINDIR}/%.a,%,$@)
+
+$(USEPKG_BUILDFIRST:%=${BINDIR}/%.a): $(RIOTBUILD_CONFIG_HEADER_C)
        @mkdir -p ${BINDIR}
        "$(MAKE)" -C $(RIOTPKG)/$(patsubst ${BINDIR}/%.a,%,$@)

@miri64
Copy link
Member

miri64 commented Jun 20, 2017

No activity for over half a year. Closing as memo for now. Reopen if you disagree.

@miri64 miri64 closed this Jun 20, 2017
@miri64 miri64 added the State: archived State: The PR has been archived for possible future re-adaptation label Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR State: archived State: The PR has been archived for possible future re-adaptation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants