The timezone branch of Motobuddy does not build – the complaint is a missing Time.h when building the Timezone library (library ID 76).
The failing branch is here:
The failing Travis CI build is here:
The failure text is as follows:
Compiling .pioenvs/adafruit_feather_m0_usb/src/main.o
In file included from src/main.cpp:11:0:
.piolibdeps/Timezone_ID76/Timezone.h:19:76: fatal error: Time.h: No such file or directory
#include <Time.h> //http://www.arduino.cc/playground/Code/Time
^
compilation terminated.
I manually added library 44 (Time) before library 76 (Timezone) and it works now. I think that the Timezone library needs a dependency on the Time library.
So the bottom line at this point is that I am unable to add a dependency for the existing Time library (library 44) to the library.json for the existing Timezone library (library 76).
This is a service folder. Please don’t modify it. PlatformIO handles dependecies and install them on “install” stage. If you add this manfiest to a library and install it using PlatformIO Library Manager, all will work.
OK, I have made a repository that demonstrates the current issue. I did the following:
bcr blake$ mkdir libtest
bcr blake$ cd libtest/
libtest blake$ platformio init --board uno
The current working directory /Users/blake/Source/bcr/libtest will be used for project.
You can specify another project directory via
`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
The next files/directories have been created in /Users/blake/Source/bcr/libtest
platformio.ini - Project Configuration File
src - Put your source files here
lib - Put here project specific (private) libraries
Project has been successfully initialized!
Useful commands:
`platformio run` - process/build project from the current directory
`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board
`platformio run --target clean` - clean project (remove compiled files)
`platformio run --help` - additional information
libtest blake$ echo 'lib_deps=https://github.com/bcr/Timezone.git#bcr-time-dependency' >> platformio.ini
libtest blake$ echo "#include <Timezone.h>" > src/main.cpp
libtest blake$ platformio run
[Wed Nov 16 14:05:15 2016] Processing uno (platform: atmelavr, lib_deps: https://github.com/bcr/Timezone.git#bcr-time-dependency, board: uno, framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------
LibraryManager: Installing Timezone
git version 2.8.4 (Apple Git-73)
Cloning into '/Users/blake/Source/bcr/libtest/.piolibdeps/installing-dhIL0q-package'...
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 18 (delta 1), reused 11 (delta 0), pack-reused 0
Unpacking objects: 100% (18/18), done.
Checking connectivity... done.
Timezone @ a3dd6de has been successfully installed!
Verbose mode can be enabled via `-v, --verbose` option
Collected 26 compatible libraries
Looking for dependencies...
Error: Could not find `Time` dependency for `Timezone` library
============================================================= [ERROR] Took 2.25 seconds =============================================================
libtest blake$
I forked your repo from when you did the work to create the package.json initially, and I modified it to add the Time library dependency. If you follow this set of steps to make a project and use the new library, it will fail to find the Time library dependency.
Thanks for the help so far, I’ll see if there’s an easy way to fix the dependency, and then I will submit a pull request for you to integrate the changes.
I don’t understand why my fork of your fork of the Timezone library with the same modification to add the dependency for the Time library didn’t work. I forked your repo, then made this changeset:
PIO handles dependencies from library that is located in PIO Registry. In previous post, you used library from GIT. PIO doesn’t look for dependencies in this case.