Local build problem: No sources found in

electron
Tags: #<Tag:0x00007fe21c02ff20>

#1

Hi,

SDK: v0.8.0-rc.26
Platform: Cygwin

Having the problem that when trying to perform a local build I get the error ‘No sources found…’ This error is generated on line 65 of main/build.mk.

I have modified the makefile (build.mk) and added the line:

ZZZ:= $(shell ls $(SOURCE_PATH)/$(USRSRC))

and then included $(ZZZ) in the error output and it clearly displays all the files in the source folder I supplied to APPDIR. It looks like target_files that is used to populate APPSOURCES is not working correctly and not including the C/C++ files in the folder listed. Any ideas?

Thanks for your help! :slight_smile:


#2

@brixworth, I would strongly suggest a newer DeviceOS toolchain and using Particle Workbench which is so much better than using Cygwin stand-alone.


#3

Thanks peekay123. This is for an automated build on a build machine so workbench is not an option.

I must be missing something but I’m really struggling to find a newer SDK for local builds? Anyone have a link to where I can download from?

Thanks!


#4

I’d still update the toolchain and install Workbench. You can still do automated builds and easily install additional or switch between toolchains. I use a Makefile that references the makefile installed with the toolchain (located in ~/.particle/toolchains).

Here is the makefile I use. It’s inside my APPDIR directory. I use a Mac for builds but this should work fine on Linux and Cygwin. Certain parts have been redacted, but you should get the idea of what I’m doing.

include ~/.particle/toolchains/buildscripts/1.5.1/Makefile

APPDIR=/your/source/path
BUILD_NUMBER_FILE=build_number
DEVICE_OS_PATH=/Users/myusername/.particle/toolchains/deviceOS/1.2.1-rc.2/firmware-1.2.1-rc.2
PLATFORM=boron
PORT=/dev/cu.usbmodem142301

VERSION=2.0

build: increment src/version.h
        make compile-user APPDIR=$(APPDIR) DEVICE_OS_PATH=$(DEVICE_OS_PATH) PLATFORM=$(PLATFORM)

clean:
        make clean-user APPDIR=$(APPDIR) DEVICE_OS_PATH=$(DEVICE_OS_PATH) PLATFORM=$(PLATFORM)

cleanall:
        make clean-all APPDIR=$(APPDIR) DEVICE_OS_PATH=$(DEVICE_OS_PATH) PLATFORM=$(PLATFORM)

cleandebug:
        make clean-debug APPDIR=$(APPDIR) DEVICE_OS_PATH=$(DEVICE_OS_PATH) PLATFORM=$(PLATFORM)

buildall:
        make compile-all APPDIR=$(APPDIR) DEVICE_OS_PATH=$(DEVICE_OS_PATH) PLATFORM=$(PLATFORM)

flash:
        stty -f $(PORT) 14400
        make flash-user APPDIR=$(APPDIR) DEVICE_OS_PATH=$(DEVICE_OS_PATH) PLATFORM=$(PLATFORM)

flashall:
        stty -f $(PORT) 14400
        make flash-all APPDIR=$(APPDIR) DEVICE_OS_PATH=$(DEVICE_OS_PATH) PLATFORM=$(PLATFORM)

increment:
        @if ! test -f $(BUILD_NUMBER_FILE); then echo 0 > $(BUILD_NUMBER_FILE); fi
        @echo $$(($$(cat $(BUILD_NUMBER_FILE)) + 1)) > $(BUILD_NUMBER_FILE)
        @echo $$(cat $(BUILD_NUMBER_FILE))
        @echo "#define PICSIL_VERSION \"$(VERSION).$$(cat $(BUILD_NUMBER_FILE))\"" > src/version.h

deploy:
        scp target/picsilsense.bin user@webserver:/home/picsil/xxxxxxxx/firmware/picsilsense-$(VERSION).$(shell cat $(BUILD_NUMBER_FILE)).bin

#5

Thanks picsil. I have an up to date toolchain (Linaro) and it’s definitely not the toolchain that’s the problem, it’s the way you have to build against the SDK that is the issue - Particles focus seems too cloud centric to me with local builds seeming like an afterthought. However, I will see if workbench solves my problem. I have a much simpler time with other vendors SDK’s but I do like Particles products.:slight_smile:


#6

@brixworth that’s the problem I solved with my solution. I use Workbench for development and testing, but built my Makefile for automated or command line builds (with auto incrementing build number not available in Workbench). I do not use the Particle cloud at all. Workbench does try to hide the details of the local build process, but everything you need is available and easier than trying to maintain your own toolchains. As soon as Workbench is updated with a new version of DeviceOS, it’s a simple change to my Makefile to use it (after installing the toolchain through Workbench). If I played a little bit more with it, I’m sure I could use other DeviceOS versions not yet available to Workbench, or my own custom builds. Once I figured out the structure of the ~/.particle directory it was easy.


#7

SOLVED

Thanks @picsil

I started to follow what you had done but it just didn’t feel right needing to install an IDE to perform unattended builds. Over the past couple of weeks I continued to investigate the problem and finally I have found what I believe to be the issue: Under Cygwin at least, the Particle SDK and the source must be on the same drive or the ‘No sources’ error occurs. There was nothing wrong with my build scripts just the fact that the Particle SDK was on my C drive and my source code on my D drive. When I moved both to the same drive (C: as it happens), the build worked fine.

I have posted the answer here in case it helps anyone else with a similar problem.

Thanks all for all of your suggestions - appreciate it! :slight_smile: