Test error with mulitple ways to build the target

Hi,
This is my first platformio venture so apologies if not in the swing of things with the platformio community.

Processing native in native environment
-----------------------------------------------------------------------------------------------------------------------------
Building...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <someLib> (/vagrant/code/cart/lib/someLib)

*** Multiple ways to build the same target were specified for: /vagrant/code/cart/.pio/build/native/test/output_export.o  (from ['/vagrant/code/cart/test/output_export.c'] and from ['/vagrant/code/cart/test/output_export.cpp'])
File "/usr/local/lib/python2.7/dist-packages/platformio/builder/tools/platformio.py", line 347, in BuildSources

The same error is reported for the target in target environment build.

These output_export.c files must be auto-generated as they are not in the project and so I have no idea how to fix this issue.

(The eval_board in eval_f373vc environment also fails due to a missing .h file but that I should be able to resolve).

The final result is reported as

Test        Environment    Status    Duration
----------  -------------  --------  ------------
eval_board  eval_f373vc    FAILED    00:00:00.700
eval_board  target         IGNORED
eval_board  native         IGNORED
native      eval_f373vc    IGNORED
native      target         IGNORED
native      native         FAILED    00:00:00.375
target      eval_f373vc    IGNORED
target      target         FAILED    00:00:00.526
target      native         IGNORED

This is my platformio.ini file

[env:eval_f373vc]
platform = ststm32
board = eval_f373vc
; framework = cmsis
debug_tool = stlink
build_flags = -DEVAL_BOARD
extra_scripts = pre:cart_pre_hal.py
src_filter = -<*> +<common> +<eval_board>
check_patterns =
    src/eval_board/**/*.c
    src/common/**/*.c
test_filter = eval_board
test_transport = custom

[env:target]
platform = ststm32
board = stm32_board
; framework = cmsis
debug_tool = stlink
build_flags = -DTARGET
extra_scripts = pre:cart_pre_hal.py
src_filter = -<*> +<common> +<target>
check_patterns =
    src/target/**/*.c
    src/common/**/*.c
test_filter = target
test_transport = custom

[env:native]
platform = native
build_flags = -DNATIVE
src_filter = -<*> +<common> +<native>
check_patterns =
    src/native/**/*.c
    src/common/**/*.c
test_filter = native
test_transport = native

Thanks for any suggestions, John

Hmm interesting use case which should be directly reproducible. @valeros or @ivankravets might want to have a look at this src_filter + unit test combination.

1 Like

Please file an issue at https://github.com/platformio/platformio-core/issues

Could you please try to reproduce the issue using the latest platformio-core from dev branch (you can run pio upgrade --dev to switch to the dev version)? It looks like the issue is already fixed in the upcoming v4.4.

Thanks valeros,
That worked. Version installed is now 4.4.0.a.
I still get an error due to an undefined reference but that will be in my code so I should be able to solve that.
John