modm-io/lbuild

lbuild force module outputPath from outside

kikass13 opened this issue · 9 comments

Hello,

is it possible to force a the env.outbasepath of a module from the outside (when calling lbuild build or via the project.xml) ?

I could not find anything regarding that problem inside the lbuild readme, only ways to specificly add an option which could be set. In the case of pre existing modm repository + modules, this could be difficult.

Is there a way to have the lbuild generated files inside a separate dir?

Like this? lbuild --path path/to/folder build

oh ... you are right im an idiot :D
i totally misinterpreted what the --help was saying about the path option.

edit: shouldnt this be a argument within the build command instead?

when invoking scons after doing lbuild --path "build" build

scons: Reading SConscript files ...
scons: warning: Calling missing SConscript without error is deprecated.
Transition by adding must_exist=0 to SConscript calls.
Missing SConscript 'modm/SConscript'
File "/home/duck/gitclones/duckbrain_umbrella_embedded/ws/low-level-compute/app/SConstruct", line 34, in
scons: warning: Ignoring missing SConscript 'erpc_modm/SConscript'
File "/home/duck/gitclones/duckbrain_umbrella_embedded/ws/low-level-compute/app/SConstruct", line 34, in
TypeError: FindSourceFiles() got an unexpected keyword argument 'ignorePaths':
File "/home/duck/gitclones/duckbrain_umbrella_embedded/ws/low-level-compute/app/SConstruct", line 41:
sources += env.FindSourceFiles(".", ignorePaths=ignored)

the stuff inside the build directory builds, but failes at the end because the linker can't find main() (because my source files are not in the build dir, do i have to invoke scons in a specific way, can this be solved via lbuild instead?

You probably want to have a custom SConstruct, ie. copy the generated one to your source dir and fix the path to the modm/SConscript. It is intended to call multiple SConscripts to integrate other custom (non-lbuild) libraries/sources via SCons. But lbuild cannot help much here, since the specialization happens after the code gen phase, you need to solve this via SCons.

since the specialization happens after the code gen phase, you need to solve this via SCons.

doesn't that just mean, that a export_path_prefix has to be propagated through to the module build-file generator after lbuild invocation? I would try looking into hacking that into lbuild because i dont like the iea of versioning my sconstruct scripts :/

I'm honestly a little bit lost on what you're trying to do, but I'm happy to review whatever you hack together.

hmm, i can try saying it in another way:

  • i want this lbuild --path prefix to be present wherever the scons files are generated (this should be possible right?)
  • i also want to add that path to the generated scons file, so that the sconstruct file inside my application will build whatever is in build as well ?

whaht reason is there that this path prefox (builld/whatever) is not in the generator?

well i have added my feature and will create a pull request...
it's not clean ... but it works. maybe you can give more tips on how to it more "properly"

I have changed the scons module inside modm in a way, that allows other modules to generate the SConstruct.in template inside the current working directoy and link the repositories (via name) in it to the correct build export paths.

A detailed explanation can be seen in the MR.