Giter Site home page Giter Site logo

Comments (11)

mchughj avatar mchughj commented on August 18, 2024

I'm unable to reproduce the problem that you are describing. Are you calling "ino init" after you change into the 'inotest' directory that you describe above? For me

mkdir inotest
cd inotest
ino init
ino build

Works fine.

from ino.

TLINDEN avatar TLINDEN commented on August 18, 2024

Of course I did. Just in case, I made a record of the session: http://ascii.io/a/2124

from ino.

TLINDEN avatar TLINDEN commented on August 18, 2024

One more thing: The problem is, that preproc is being called without the -d parameter. I just added the following line to make/Makefile.sketch.jinja:

@echo "ARDUINO DIST DIR: {{ e['arduino_dist_dir'] }}"

The output during "ino build" is:

$ ino build
Searching for Board description file (boards.txt) ... /usr/local/share/arduino/hardware/arduino/boards.txt
Searching for Arduino lib version file (version.txt) ... /usr/local/share/arduino/lib/version.txt
Detecting Arduino software version ... 1.0 (1.0.3)
Searching for Arduino core library ... /usr/local/share/arduino/hardware/arduino/cores/arduino
Searching for Arduino standard libraries ... /usr/local/share/arduino/libraries
Searching for Arduino variants directory ... /usr/local/share/arduino/hardware/arduino/variants
Searching for avr-gcc ... /usr/local/share/arduino/hardware/tools/avr/bin/avr-gcc
Searching for avr-g++ ... /usr/local/share/arduino/hardware/tools/avr/bin/avr-g++
Searching for avr-ar ... /usr/local/share/arduino/hardware/tools/avr/bin/avr-ar
Searching for avr-objcopy ... /usr/local/share/arduino/hardware/tools/avr/bin/avr-objcopy
src/sketch.ino
ARDUINO DIST DIR: None
usage: ino preproc [-h] [-d PATH] [-o OUTPUT] sketch
ino preproc: error: too few arguments
*** Error code 2

So, there's something fishy...

btw, the generated file .build/environment.pickle doesn't contain this variable as well.

from ino.

TLINDEN avatar TLINDEN commented on August 18, 2024

Now I just edited the Makefile something more and added the path manually:

{{v}}{{ e.ino }} preproc -d /usr/local/share/arduino -o $@ $^

Still the same error. Then I stumbled upon this {{v}} sentence and tried to add -v, and there it is, verbose output. Didn't I mention this earlier? Why didn't you tell me about this?

However, the output if I run "ino build" with this is:

$ ino build -v
src/sketch.ino
/usr/local/bin/ino preproc -d /usr/local/share/arduino -o .build/uno/src/sketch.cpp
usage: ino preproc [-h] [-d PATH] [-o OUTPUT] sketch
ino preproc: error: too few arguments
*** Error code 2

Stop in /usr/home/scip/devel/inotest.
Make failed with code 1

Obviously the last parameter is missing, in the Makefile this is $^, which either is not a valid make variable or is not fed into the pipeline. So, while I was at it, I just appended the sketch file:

{{v}}{{ e.ino }} preproc -d /usr/local/share/arduino -o $@ sketch.ino

The output with this is now:
$ ino build -v
/usr/local/share/arduino/hardware/tools/avr/bin/avr-gcc -mmcu=atmega328p -ffunction-sections -fdata-sections -g -Os -w -DF_CPU=16000000L -DARDUINO=100 -I/usr/local/share/arduino/hardware/arduino/cores/arduino -I/usr/local/share/arduino/hardware/arduino/variants/standard -I/usr/local/share/arduino/hardware/arduino/cores/arduino -I/usr/local/share/arduino/libraries/LiquidCrystal -I/usr/local/share/arduino/libraries/Wire -I/usr/local/share/arduino/libraries/Wire/utility -I/usr/local/share/arduino/libraries/Stepper -I/usr/local/share/arduino/libraries/WiFi -I/usr/local/share/arduino/libraries/WiFi/utility -I/usr/local/share/arduino/libraries/Ethernet -I/usr/local/share/arduino/libraries/Ethernet/utility -I/usr/local/share/arduino/libraries/SoftwareSerial -I/usr/local/share/arduino/libraries/Firmata -I/usr/local/share/arduino/libraries/Servo -I/usr/local/share/arduino/libraries/Esplora -I/usr/local/share/arduino/libraries/SPI -I/usr/local/share/arduino/libraries/SD -I/usr/local/share/arduino/libraries/SD/utility -I/usr/local/share/arduino/libraries/EEPROM -iquote src -MM > .build/uno/src/sketch.d
avr-gcc: no input files
*** Error code 1

Stop in /usr/home/scip/devel/inotest.
Make failed with code 1

I also tried src/sketch.ino - same output.

So I'm not sure what to say about this, but it looks like either incomplete software or untested at all, which is a pity as the idea sounds really great and there is a lot of code written for the tool.

from ino.

mchughj avatar mchughj commented on August 18, 2024

I don't think I would characterize the software the same way. It worked flawlessly for me - and apparently others - out of the gate. I don't doubt that you are having a problem - clearly there is something different with your experience.

Things you could consider checking:

1/ Do you have the latest version? Checked in at

https://github.com/amperka/ino/blob/master/ino/make/Makefile.sketch.jinjahttps://github.com/amperka/ino/blob/master/ino/make/Makefile.sketch.jinja

line 9 reads:
{{v}}{{ e.ino }} preproc {% if 'arduino_dist_dir' in e %}-d {{ e['arduino_dist_dir'] }}{% endif %} -o $@ $^

Does your file look the same?

This line contains the arduino distribution directory so there should be no need to manually add in "-d /usr/local/share/arduino".

2/ If the code is the same then confirm that during the initial 'ino build' step that all of the requirements that are searched for are found appropriately. http://inotool.org/quickstart has a great little walkthrough.

I hope this helps.

Jason

from ino.

TLINDEN avatar TLINDEN commented on August 18, 2024
  1. yes the file looks exactly like this. But the variable arduino_dist_dir is not set internally, which leads to the error (the first one of them).

  2. of course I followed the quickstart. Doesn't work anyway. If I set the variable arduino-dist in my .inorc, then at least the first error of the preproc call without -d being set vanishes, but the second one remains, $^ is still not set:

$ ino build -v
src/sketch.ino
/usr/local/bin/ino preproc -d /usr/local/share/arduino -o .build/uno-5a7bf3ac/src/sketch.cpp
usage: ino preproc [-h] [-d PATH] [-o OUTPUT] sketch
ino preproc: error: too few arguments
*** Error code 2

Stop in /usr/home/scip/tmp/inotest.
Make failed with code 1

However, after another time digging though the code, I found the problem with $^, it's in line 138 in commands/build.py:

ret = subprocess.call(['make', '-f', makefile, 'all'])

But according that variable and the way you're calling it, the script assumes GNU Make. But as I already said, I'm using FreeBSD, which has its own make command (BSD Make), which is mostly incompatible to the GNU flavour. If I want to use the GNU version, I'll have to use "gmake" instead of "make". So, I just changed line 138 to call gmake and now it works.

You should add a config file variable for this, so the user can specify which command to call for GNU Make.

Oh, and the -d preproc issue is also resolved this way.

from ino.

TLINDEN avatar TLINDEN commented on August 18, 2024

PS: so, sorry for the harsh comment earlier, it was unfair. Now that I've got ino running, I've got to admit, that I love it.

from ino.

Kernald avatar Kernald commented on August 18, 2024

I'll try to write a patch to make the make command configurable. I'll tell here if I get something working or not, never really digged into ino code, and rarely code in Python. But I'll try :-)

from ino.

Kernald avatar Kernald commented on August 18, 2024

@TLINDEN: can you try with the branch I commited within (https://github.com/Kernald/ino/tree/make-command-option)? You'll have two ways to fix your issue: use the -c gmake switch, or in your inorc, make-command = gmake.

from ino.

TLINDEN avatar TLINDEN commented on August 18, 2024

@Kernald: works like a charm.

from ino.

mchughj avatar mchughj commented on August 18, 2024

Very cool. @TLINDEN - glad it is working well for you now! I'm a huge fan of the command line build and the overall approach that the author has taken with Ino. Good stuff! :)

from ino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.