Bug 200177 - devel/arduino - Command line sketch is not loaded
Summary: devel/arduino - Command line sketch is not loaded
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Carlos J. Puga Medina
URL:
Keywords: patch, patch-ready
: 200178 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-05-13 19:40 UTC by James Elstone
Modified: 2017-03-15 09:06 UTC (History)
7 users (show)

See Also:


Attachments
shell wrapper patch for arduino, enabling command line sketches to be passed. (281 bytes, patch)
2015-05-13 20:20 UTC, James Elstone
no flags Details | Diff
Update java wrapper (419 bytes, patch)
2015-05-13 20:24 UTC, James Elstone
no flags Details | Diff
svn diff for devel/arduino port addressing issues below (multiple files changed) (6.12 KB, patch)
2017-01-28 00:49 UTC, James Elstone
no flags Details | Diff
svn diff for devel/arduino port addressing issues below (multiple files changed & epoch bumped) (6.22 KB, patch)
2017-01-28 00:58 UTC, James Elstone
no flags Details | Diff
additional patch file for devel/arduino (./files/patch-arduino) (447 bytes, patch)
2017-01-28 01:05 UTC, James Elstone
no flags Details | Diff
updated patch (7.29 KB, patch)
2017-02-07 15:00 UTC, Steve Wills
no flags Details | Diff
updated patch for the port coutesy of swills@ (7.29 KB, patch)
2017-03-03 17:37 UTC, Warren Block
no flags Details | Diff
updated patch for the port courtesy of swills@ (7.63 KB, patch)
2017-03-07 11:47 UTC, Carlos J. Puga Medina
leres: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Elstone 2015-05-13 19:40:30 UTC
If the arduino IDE is invoked passing a sketch from a shell command line, e.g. "arduino ./sketch/sketch.ino" the IDE returns an error on start up and does not load the sketch.

This is supported in the underlying IDE code base.
Comment 1 James Elstone 2015-05-13 19:45:24 UTC
The arduino IDE returns the same error when invoked without any parameters, e.g. "arduino".

The error message is:

  Bad file selected
  Arduino can only open its own sketches and other files ending in .ino or .pde
Comment 2 James Elstone 2015-05-13 20:20:59 UTC
Created attachment 156757 [details]
shell wrapper patch for arduino, enabling command line sketches to be passed.

to be located with the [devel/arduino] port, in the ./files/ sub folder.

Corrects the passing of sketches defined on the command line in shell wrapper.
Comment 3 James Elstone 2015-05-13 20:24:01 UTC
Created attachment 156758 [details]
Update java wrapper

Enables the echoing of command line args being passed.
Sets Java environmental argument that prevents scanning of lpt ports by RXTX (not used in arduino IDE v1.0.6).
Comment 4 James Elstone 2015-05-13 20:26:28 UTC
Patch files added.

- Points RXTX library links to correct version,

- Allows passing of command line sketches to load,

- Inhibits the scanning (but not the use of) /dev/lpt on FreeBSD
  (dependant on other patches for RXTX being applied).
Comment 5 James Elstone 2017-01-28 00:49:13 UTC
Created attachment 179365 [details]
svn diff for devel/arduino port addressing issues below (multiple files changed)

QA performed; Issues related to port prior to specific bug fix being provided.

portlint -C passes with no warning (when port is clean).

There is a notable compile time warning regarding stripping of elf files, but these are not targeted at FreeBSD, rather the Arduino hardware platform, specifically an add on wifi shield.  This warning is considered erroneous in this context.

Diff file contains updates for:
- Maintainer transfer (Maintainer timeout noted; no maintainer activity on this bug in over a year)
- License information added
- Removes reference to Linux base (Linux Compatibility not required)
- Limited to Architectures know to be able to enumerate serial ports on using RXTX port
- Corrected Desktop Entry (QA Issue)
- Links correct RXTX so library files depending on ARCH
- Removed CHMOD usage in Makefile, and moved to pkg-plist
- Corrected Arduino wrapper to allow loading of sketches from the command line. 
- Updated RXTX enumeration to prevent scanning of LPT ports to increase startup speeds of Arduino IDE
- Corrected format of patch files
- Removed bundled Linux libraries from the port prior to installation.
- Included from bug #200178:
-- Adds support for Uarduno drivers
-- Corrects links for java and lib files installed by port [comms/RXTX].

Testing:
- Poudriere:   OK
- Portlint -C: OK (on clean port)
- Tested with Arduino and Genuino boards available here; port installs, allows code entry, compiles and uploads as expected.
Comment 6 James Elstone 2017-01-28 00:52:07 UTC
*** Bug 200178 has been marked as a duplicate of this bug. ***
Comment 7 James Elstone 2017-01-28 00:58:50 UTC
Created attachment 179366 [details]
svn diff for devel/arduino port addressing issues below (multiple files changed & epoch bumped)

Epoch bumped to version 2
Comment 8 Craig Leres freebsd_committer 2017-01-28 01:00:36 UTC
Comment on attachment 179366 [details]
svn diff for devel/arduino port addressing issues below (multiple files changed & epoch bumped)

Could you please submit a new patchset that doesn't change the maintainer? I'd like to keep this for now.
Comment 9 Craig Leres freebsd_committer 2017-01-28 01:02:20 UTC
Comment on attachment 179366 [details]
svn diff for devel/arduino port addressing issues below (multiple files changed & epoch bumped)

(I don't seem to be able to set the maintainer-approval flag to '-')
Comment 10 James Elstone 2017-01-28 01:05:06 UTC
Created attachment 179367 [details]
additional patch file for devel/arduino (./files/patch-arduino)

Enables skipping of LPT port scanning when Arduino starts up.
Comment 11 James Elstone 2017-01-28 10:53:06 UTC
Hi Craig,

I can understand your desire to "keep" the port, but I want to actively enhance the experience of users of Arduino on FreeBSD for the benefit of the whole community.

I though that the Maintainer had timed out as you had not responded to the QA request or made any comment on the issues and fixes supplied for over a year.  While you want to be the Maintainer for this port, I could not see any recent activity on it from you.

I based my approach on the documentation based in the Porters Handbook:
https://www.freebsd.org/doc/en/books/porters-handbook/book.html#makefile-maintainer
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/contributing/ports-contributing.html#maintain-port

Can you provide some insight as to why the port maintainer cannot be changed to someone actively willing to perform the role?  I am not saying my approach is correct, just want to understand your reasoning to be Maintainer (of which I may have failed to understand).

If acceptable, please feel free to take my work, alter it and resubmit the patch, as I would really like to see the situation improved for all.

Kr,

James
Comment 12 Craig Leres freebsd_committer 2017-01-29 01:38:01 UTC
With regards to 200177 I honestly thought I was waiting for you to do something. Looking in my sent folder I see that I was out of town when the PR was created and I asked you to remind me if I forgot about it. Clearly it was wrong of me to not follow up.

I don't know much about maintainer changes but the ones I've been involved with have been the result of mutual agreement or when the port is up for grabs (i.e. current maintainer is ports@freebsd.org).
Comment 13 Craig Leres freebsd_committer 2017-01-29 21:36:32 UTC
Comment on attachment 179366 [details]
svn diff for devel/arduino port addressing issues below (multiple files changed & epoch bumped)

The Makefile has issues that causes poudriere aborts:

    make: "/usr/ports/devel/arduino/Makefile" line 111: Malformed conditional (${MACHTYPE} == i386)
    make: "/usr/ports/devel/arduino/Makefile" line 115: Malformed conditional (${MACHTYPE} == x86_64)
    make: Fatal errors encountered -- cannot continue[00:00:03] ====>> Cleaning up

I think you want to test ${ARCH} instead of ${MACHTYPE}.

Would it be possible to attach a poudriere build log with a revised patchset?
Comment 14 Craig Leres freebsd_committer 2017-01-29 21:38:39 UTC
Comment on attachment 179367 [details]
additional patch file for devel/arduino (./files/patch-arduino)

It would be better to fold this into the first patchset (perhaps using "diff -u /dev/null files/patch-arduino").
Comment 15 Steve Wills freebsd_committer 2017-02-07 15:00:22 UTC
Created attachment 179713 [details]
updated patch

Here's an updated version of the patch that includes all the changes, fixes a few issues and leaves the maintainer line alone. May not be perfect yet, but better, passes poudriere tests, etc.
Comment 16 James Elstone 2017-02-07 22:33:27 UTC
Hi Steve,

Thanks for that; Is it now waiting on Maintainer approval?

Kr,

James

P.S. Are there any other issues you saw ("May not be perfect yet") that caught your eye, and for my edification does the "needs-qa" flag get removed once QA confirmed by maintainer?
Comment 17 Craig Leres freebsd_committer 2017-02-12 03:46:35 UTC
Comment on attachment 179713 [details]
updated patch

Looks good, builds and installs for me. (And the uarduno option is a nice touch.)

Approved.
Comment 18 Warren Block freebsd_committer 2017-03-03 17:37:45 UTC
Created attachment 180469 [details]
updated patch for the port coutesy of swills@

Improved patch provided by swills@.
Comment 19 Carlos J. Puga Medina freebsd_committer 2017-03-07 11:47:44 UTC
Created attachment 180597 [details]
updated patch for the port courtesy of swills@

Fix pkg-plist
Comment 20 Craig Leres freebsd_committer 2017-03-13 02:36:39 UTC
Comment on attachment 180597 [details]
updated patch for the port courtesy of swills@

I tested this new patchset and it looks ok as well: approved!
Comment 21 commit-hook freebsd_committer 2017-03-15 09:05:14 UTC
A commit references this bug:

Author: cpm
Date: Wed Mar 15 09:04:19 UTC 2017
New revision: 436204
URL: https://svnweb.freebsd.org/changeset/ports/436204

Log:
  - Add LICENSE
  - Remove reference to Linux base (Linux Compatibility not required)
  - Limit to architectures know to be able to enumerate serial ports on using RXTX port
  - Fix desktop entry
  - Links correct RXTX so library files depending on ARCH
  - Remove CHMOD usage in Makefile, and moved to pkg-plist
  - Fix Arduino wrapper to allow loading of sketches from the command line
  - Update RXTX enumeration to prevent scanning of LPT ports to increase startup speeds of Arduino IDE
  - Fix format of patch files
  - Remove bundled Linux libraries from the port prior to installation
  - Add support for Uarduno drivers
  - Fix links for java and lib files installed by port [comms/RXTX]
  - Update pkg-plist
  - Bump PORTREVISION

  PR:		200177
  Submitted by:	James Elstone, Craig Leres, swills
  Reported by:	James Elstone
  Approved by:	Craig Leres <leres@ee.lbl.gov> (maintainer)

Changes:
  head/devel/arduino/Makefile
  head/devel/arduino/distinfo
  head/devel/arduino/files/arduino.in
  head/devel/arduino/files/patch-arduino
  head/devel/arduino/files/patch-hardware-arduino-cores-arduino-HardwareSerial.cpp
  head/devel/arduino/pkg-plist
Comment 22 Carlos J. Puga Medina freebsd_committer 2017-03-15 09:06:06 UTC
Committed!

Thanks