Closed fred-r closed 1 year ago
Good suggestion, let's work on that.
Already I would push for some good practice having one repository folder per cproject.yml file. Sounds to me csolution / cproject / clayer is promoting hierarchical structure.
Based on your trial @fred-r I'm just realizing if multi target toolchains we are ending with one cprj per toolchain. @brondani no more intent to end with a single cprj file despite toolchain variations ? ... cprj schema is allowing such. Not pushing strongly for just for my information.
I'm in sync. with @fred-r we have to organize a bit all such. Possibly ?: In any case we have to keep path in general as short a possible thinking some Windows OS & possibly toolchains long path limitation.
Note: If single cprj per target device
@VGRSTM as discussed in the last Open-CMSIS-Pack meeting I'm writing here my considerations:
Considering @brondani valuable comments and current Open-CMSIS trend here is a new structure proposal:
CONFIG_ID="./\<customConfigPathPattern>" // "\<target-type>\/\<build-type>" as default ? RTEDIR="./\<customRteDir>" // "./RTE" as default ? BUILDDIR="./\<customBuildDir>/" // "./build/$CONFIG_ID" as default CPRJDIR="./\<customLockDir>/" // "./.lock" as default ?
./AppProject/AppProject.csolution.yml
./AppProject/Project_1/Project_1.cproject.yml ./AppProject/Project_1/$CPRJDIR/Project_1.\<target-type>+\<build-type>.cprj ./AppProject/Project_1/$BUILDDIR/inDir/CMakeLists.txt ./AppProject/Project_1/$BUILDDIR/outDir/src/main.o ./AppProject/Project_1/$BUILDDIR/outDir/Project_1.elf ./AppProject/Project_1/$RTEDIR/linkerscript.ld
./AppProject/Project_2/Project_2.cproject.yml ./AppProject/Project_2/$CPRJDIR/Project_2.\<target-type>+\<build-type>.cprj ./AppProject/Project_2/$BUILDDIR/inDir/CMakeLists.txt ./AppProject/Project_2/$BUILDDIR/outDir/src/main.o ./AppProject/Project_2/$BUILDDIR/outDir/Project_2.elf ./AppProject/Project_2/$RTEDIR/linkerscript.ld
High level message is "please hard code nothing but promote variables". Open-CMSIS is open solution we have to keep it open to integrator / end user choices.
Some rational then about proposal:
cprj file(s) location
build artifacts repository
RTE repository
High level message is "please hard code nothing but promote variables".
Yes, I fully agree and I would even say, let's not assume that everything goes under a top level directory. We may have some organisations with:
Also, the tooling should not assume it is "alone" in the tree. By this I mean that the end-user may create extra folders on his own. So, when the tool is doing clean-up or parsing, these folders must be ignored if needed.
@brondani Thanks past weekly call review I've well noticed comment about possible data clash(es) because flexible structure first guess proposal. Your comment is fully valid, Thanks ! Yes if considering case we are facing "flat" usage (no Project 1 & Project2 file system folders, means all yml files sharing same location) we have conflicts if build artefacts. Let have a refined proposal then !
My first guess is lacking so about "qualifier" uniqueness. I'm thinking way to solve is to add some $PROJECT
support reflecting project name (which is *.cproject.yml files prefix ? TBC ... see [projmgr] Get rid of project name usage as much as possible.
cprj
file(s) out of cproject.yml
file(s) are already made unique Thanks to project name usage under the hood .. let's allow same based on private variable introduction ("private" means devtools
owned, having value assigned at runtime by devtools
processing). Is such sounds better to you ? :
CONFIG_ID="./\<customConfigPathPattern>" // "\<target-type>/\<build-type>" as default ? RTEDIR="./\<customRteDir>" // "./RTE" as default ? BUILDDIR="./\<customBuildDir>/" // "./build/$PROJECT/$CONFIG_ID" as default CPRJDIR="./\<customLockDir>/" // "./.lock" as default ?
./AppProject/AppProject.csolution.yml
./AppProject/Project_1/Project_1.cproject.yml
./AppProject/Project_1/$CPRJDIR/Project_1.
./AppProject/Project_2/Project_2.cproject.yml
./AppProject/Project_2/$CPRJDIR/Project_2.
Same way I've introduced $PROJECT
private variable sounds to me good to add some extra ones:
$BUILD_TYPE
$TARGET_TYPE
$COMPILER
Which may serve the samePR #266 proposal aiming to update reference schemas opening door to dedicated output directories support if devtools
In your proposal Vincent, can we accept ../ to go up in the tree ?
@fred-r I guess yes ../
can be supported. As far of today already nothing prevent to do such.
According to me has to be supported as part of standard and related devtools
. Then up to end user to define its own way of working with. If we expect to get a project (cproject.yml) being "shared" / "reused" by multiple applications (csolution.yml) sounds to me ../
is must have.
Another problem in our naming today is the length of the paths it generates.
It is easy to hit this limit: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation
|-- test.AC6_UART+B-U585I-IOT02A_IntDir
| |-- CMakeCache.txt
| |-- CMakeFiles
| | |-- 3.22.1
| | | | `-- CMakeCCompiler.cmake
| | | `-- CMakeSystem.cmake
| | |-- CMakeOutput.log
| | |-- TargetDirectories.txt
| | |-- cmake.check_cache
| | |-- rules.ninja
| | `-- test.AC6_UART+B-U585I-IOT02A.dir
| | | `-- C_
| | | | `-- CMSIS_PACKS
| | | | `-- STMicroelectronics
| | | | | `-- STM32U5xx_DFP
| | | | | `-- 0.1.1
| | | | | `-- Source
| | | | | `-- startup_stm32u585xx.o
| | | | `-- STM32U5xx_Drivers
| | | | `-- 0.1.1
| | | | `-- Src
| | | | |-- stm32u5xx_hal.o
| | | | |-- stm32u5xx_hal_cortex.o
| | | | |-- stm32u5xx_hal_dma.o
| | | | |-- stm32u5xx_hal_dma_ex.o
| | | | |-- stm32u5xx_hal_gpio.o
| | | | |-- stm32u5xx_hal_pwr.o
| | | | |-- stm32u5xx_hal_pwr_ex.o
| | | | |-- stm32u5xx_hal_rcc.o
| | | | |-- stm32u5xx_hal_rcc_ex.o
| | | | |-- stm32u5xx_hal_uart.o
| | | | `-- stm32u5xx_hal_uart_ex.o
| | | `-- Cube
| | | `-- background
| | | `-- embsw_archi_studies
| | | `-- simple_trace
| | | |-- Src
| | | | `-- stm32_simple_trace_UART.o
| | | `-- internal
| | | |-- example_status.o
| | | |-- main.o
| | | |-- targets
| | | | `-- B-U585I-IOT02A
| | | | |-- stm32_system.o
| | | | `-- stm32_usart1.o
| | | `-- test.o
| | `-- c4672b92c63e51bfab1fbcdac4d19a9b
| | `-- simple_trace
| | `-- internal
| | `-- RTE
| | `-- Device
| | `-- STM32U585ZITx
| | `-- system_stm32u5xx.o
| |-- CMakeLists.txt
| |-- build.ninja
| |-- cmake_install.cmake
| `-- compile_commands.json
We can see for instance:
SKIPPED then "test.GCC_UART+B-U585I-IOT02A_IntDir/CMakeFiles/test.GCC_UART+B-U585I-IOT02A.dir/c4672b92c63e51bfab1fbcdac4d19a9b/simple_trace/internal/RTE/Device/STM32U585ZITx/system_stm32u5xx.c.obj"
==> already 182 chars...
Another problem in our naming today is the length of the paths it generates.
It is easy to hit this limit: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation
I'm running into this issue easily, too. Especially when CMSIS Packs are stored in %appdata% which is resolved to very long intermediate paths under the cmake build folder.
Take a look to my proposal here #314
There is not activity on that since a while. What is the take on my proposal #314
Closing this issue as it is somewhat solved
Let's consider a csolution with 1 board and 3 compilers:
Then I create the cprjs:
Already at this stage it becomes pretty fuzzy with 1 RTE with 1 device but 3 CPRJs at the same level.
Now, if I build:
Now we end up with many folders all at the same level....
Wouldn't it make sense to have something organized: