-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Build dependencies - processing order issues #9913
Copy link
Copy link
Open
Labels
Area: build systemArea: Build systemArea: Build systemDiscussion: RFCThe issue/PR is used as a discussion starting point about the item of the issue/PRThe issue/PR is used as a discussion starting point about the item of the issue/PRState: WIPState: The PR is still work-in-progress and its code is not in its final presentable form yetState: The PR is still work-in-progress and its code is not in its final presentable form yetType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)Type: trackingThe issue tracks and organizes the sub-tasks of a larger effortThe issue tracks and organizes the sub-tasks of a larger effort
Metadata
Metadata
Assignees
Labels
Area: build systemArea: Build systemArea: Build systemDiscussion: RFCThe issue/PR is used as a discussion starting point about the item of the issue/PRThe issue/PR is used as a discussion starting point about the item of the issue/PRState: WIPState: The PR is still work-in-progress and its code is not in its final presentable form yetState: The PR is still work-in-progress and its code is not in its final presentable form yetType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)Type: trackingThe issue tracks and organizes the sub-tasks of a larger effortThe issue tracks and organizes the sub-tasks of a larger effort
There currently are concurrency issues in the order dependencies are defined and used, and cpu dependencies cannot be easily parsed.
I plan to address this by moving the processing of
Makefile.depbefore including$(BOARD)/Makefile.includeDependencies resolution uses the following variables
Steps
Add a new file in board that include the common files too and currently only definesReuseCPU,Makefile.board.Makefile.featuresto defineCPU$(CPU)/Makefile.depstm32_commonissue described in Makefile.dep: process cpu dependencies and fix stm32_common #9892cpu/stm32_common: fix source selection declared as module dependencies (broken) #10153include $(RIOTCPU)/$(CPU)/Makefile.featuresinstead of hardwriting it.CPU_FAMandCPU_ARCHdefined inMakefile.includewhen they should be already available forMakefile.dep. Define them inMakefile.cpuMakefile.featuresfiles.$(BOARD)/Makefile.depand$(CPU)/Makefile.depMakefile.includeissues (can be done in parallel)/sys/arduino/Makefile.includeMakefile.depbefore doingMakefile.include. Makefile.include: resolve dependencies before Makefile.include #14351Prerequisites cleanup
And even future improvement to remove multiple duplication between board/board_common cpu/cpu_common path:
Makefile.boardandMakefile.cpu, define someBOARD_IMPLEMENTATION_DIRSlike variables that can be re-used to remove duplication inMakefile,Makefile.deps,Makefile.include,Makefile.features.Explanation
To summarize, the main
Makefile.includedoes regarding modules:(a more detailed version is available here https://gist.github.com/cladmi/1c5af63c753635b7cb173cf8311d0b5b)
The main
Makefile.deponly includes$(BOARD)/Makefile.depwhich may sometime also end up includinghardwritten_cpu_name/Makefile.dep.In the same time
makefiles/info-global.inc.mkdoes:And so never takes into account any of the dependencies defined in
$(BOARD)/Makefile.includeor any otherMakeflie.includefiles.