Local build problem: No sources found in

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:

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

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!

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
2 Likes

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:

@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.

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:

1 Like

@picsil, this is slightly broken now. It seems that at some point it started being necessary to update the PATH. Below is my slight modification which allows me to build from a makefile.

Please note that this is very brittle because it hardcodes so many directories. In a perfect world Workbench wouldn’t hide these things from the command line call, so that it would be easy to update by just running a local compile in Workbench and then copy/pasta. But I’m not going to complain, in the end it didn’t take too long to figure it all out.

HOME_DIR=/Users/kenz

# Update to point to any new buildscripts
include ~/.particle/toolchains/buildscripts/1.8.0/Makefile

APPDIR=$(HOME_DIR)/Documents/ParticleWorkbench/ExampleProject

BUILD_NUMBER_FILE=build_number

#Update to point to any new OS
DEVICE_OS_PATH=$(HOME_DIR)/.particle/toolchains/deviceOS/1.4.4/firmware-1.4.4/

PLATFORM ?= xenon
PORT ?= /dev/cu.usbmodem142301

#Update to point to new Particle toolchains
export PATH := $(HOME_DIR)/.vscode/extensions/particle.particle-vscode-core-1.8.1/src/cli/bin/darwin/amd64:$(HOME_DIR)/.particle/toolchains/gcc-arm/5.3.1/bin:$(HOME_DIR)/.particle/toolchains/buildtools/1.1.1:$(HOME_DIR)/.particle/toolchains/openocd/0.11.2-adhoc6ea4372.0/bin:$(PATH)

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

Hi @kubark42,

Do/did you get that error:

phil@Delphi rtu % make -d
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0
Reading makefiles...
Reading makefile `Makefile'...
Reading makefile `/Users/phil/.particle/toolchains/buildscripts/1.9.2/Makefile' (search path) (no ~ expansion)...
Makefile:77: *** missing separator.  Stop.

I can't get past it, and haven't found any reference to ~ anywhere...

Update: nevermind, I think it's just a "tab" issue...

On Windows, what solved this problem for me is passing the absolute path instead of the relative path to the make command options.

From

make compile-all APPDIR=tracker-edge DEVICE_OS_PATH=device-os PLATFORM_ID=26

to

make compile-all APPDIR=C:/particle/tracker-edge DEVICE_OS_PATH=C:/particle/device-os PLATFORM_ID=26