Hi, I’ve written some unit test to run on native platform, they run fine in windows but the same project gives error on my mac M1 machine:
Building...
ar: no archive members specified
usage: ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
ar -t [-TLsv] archive [file ...]
ar -x [-ouTLsv] archive [file ...]
The project builds successfully for normal builds (i.e. ESP8266 and ESP32 builds with no unit testing)
command to run unit test is pio test -e native -f pg and native platform is defined as below
So I created a new project and it seems that adding rlogiacco/CircularBuffer @ ^1.3.3 to lib_deps causes the error, removing it fixes the error, but I dont know why since same project runs on windows without problem! @maxgerhardt
project structure
This is a header only library, so since there are no c/cpp files, no .o object files will be created, and from no object files, no .a archive files can be created. So in that regards, the error is understandable.
does not have any .o following it.
Interesting that it fails differently on Windows and Mac. Can you open a CLI and execute pio upgrade --dev on both Windows & Mac machines? Do they still behave differently after a clean&rebuild?
Does adding
lib_archive = no
(docs) to the native env help? (Should prevent generation of the archive in the first place)
Hold up a second – here it says it’s using 5.1.1 and multiple cores are installed. That is bad. Can you try and get rid of the other cores and just have the latest-beta 5.2.0b1, verified by pio --version in the CLI?
I almost always use cli and didnt notice this warning, my error is also present when using cli which is 5.2.0b1, anyway I set VSCode - Settings > Set platformio-ide.useBuiltinPIOCore to false. so VSCode is also using the global pio version and the warning disapeared
> Executing task: platformio run --verbose --environment native <
Processing native (platform: native; build_type: debug; build_flags: -std=gnu++11; lib_compat_mode: off; debug_test: pg; lib_deps: rlogiacco/CircularBuffer @ ^1.3.3; src_filter: +<native/*>)
--------------------------------------------------------------------------------------------------------------------------------
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ off
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <CircularBuffer> 1.3.3 (/Users/ali/Documents/PlatformIO/Projects/esp_template/.pio/libdeps/native/CircularBuffer)
Building in debug mode
ar rc .pioenvs/native/libcaf/libCircularBuffer.a
ar: no archive members specified
usage: ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
ar -t [-TLsv] archive [file ...]
ar -x [-ouTLsv] archive [file ...]
*** [.pioenvs/native/libcaf/libCircularBuffer.a] Error 1