Code Monkey home page Code Monkey logo

rebar3_grisp's Introduction

GRiSP Erlang Runtime

continous integration hex.pm version hex.pm license erlang versions

Website · Wiki · Forums


GRiSP 2 board on wood

Create amazing Internet of Things designs without soldering or dropping down to C. The GRiSP project makes building internet-connected hardware devices easier with Erlang!

  • Real bare-metal Erlang virtual machine (no operating system!)
  • Hard real-time event handling, using open source code
  • Digilent Pmod™ compatible connectors for sensors and actuators

This repository contains the Erlang runtime and support code for the GRiSP hardware platform.

Getting Started

The easiest way to get started is to use the Rebar 3 or Mix plug-ins for GRiSP.

Erlang

Install the GRiSP Rebar 3 plug-in globally by adding {plugins, [rebar3_grisp]}. to ~/.config/rebar3/rebar.config.

Create a new project:

# Create a new GRiSP application (use the real mount path of your SD card)
rebar3 new grispapp name=demo dest=/path/to/SD-card
cd demo

# Deploy the application to your SD-card
rebar3 grisp deploy

Hardware

GRiSP hardware supports many different connection standards:

  • GPIO
  • SPI
  • UART
  • I2C
  • 1-Wire

Peripherals can be connected to either PMOD ports or I/O pins directly.

GRiSP 2 (grisp2)

GRiSP 2 hardware

GRiSP 2 ships with the following features:

  • 1 × 100 Mbit/s Ethernet port
  • 1 × Wi-Fi 802.11b/g/n WLAN
  • 1 × GPIO PMOD Type 1A (12-pin)
  • 2 × GPIO pins (14-pin & 6-pin)
  • 1 × SPI1 PMOD Type 2 (6-pin)
  • 1 × SPI2 PMOD Type 2A (12-pin)
  • 1 × UART PMOD Type 3A (12-pin)
  • 1 × I2C PMOD Type 6 (6-pin)
  • 1 × I2C Bus (8-pin)
  • 1 × 1-Wire Bus (3-pin)
  • 1 × USB Bus (5-pin)
  • 5 × mode DIP switches
  • 1 × JTAG connector

GRiSP 1 (grisp_base)

GRiSP 1 hardware

GRiSP 1 ships with the following features:

  • 1 × Wi-Fi 802.11b/g/n WLAN
  • 2 × GPIO PMOD Type 1 (6-pin)
  • 1 × UART PMOD Type 3 (6-pin)
  • 1 × SPI1 PMOD Type 2A (12-pin)
  • 1 × SPI2 PMOD Type 2 (6-pin)
  • 1 × I2C Bus (8-pin)
  • 1 × 1-Wire Bus (3-pin)
  • 5 × mode DIP switches
  • 1 × JTAG connector

Testing

The project has a hardware emulation layer in software that allows you to use the runtime locally on a normal computer. To start a local shell for the runtime use:

$ rebar3 as test shell

Glossary

1-Wire
Long-distance serial communication bus.
GPIO
General Purpose Input/Output. Digital signal pin interface used to interface with single pins.
I2C
Inter-Intergrated Circuit. Short-distance synchronous serial computer bus.
JTAG
On-chip instrumentation and debugging interface.
PMOD
A peripheral device that implements the [Digilent Pmod™ connection form factor and interface][PMOD].
Slot
A physical slot where a component can be connected. E.g. `SPI1` where an SPI PMOD can be connected.
SPI
Serial Peripheral Interface. Synchronous serial communication interface.
UART
Universal Asynchronous Receiver-Transmitter. Asynchronous serial communication interface.

rebar3_grisp's People

Contributors

crowdhailer avatar dischoen avatar eproxus avatar galaxygorilla avatar gwendallaurent avatar holzingk avatar lwehmeier avatar maehjam avatar peerst avatar sylane avatar ziopio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rebar3_grisp's Issues

Freshly generated grispapp fails to deploy the first time its run

On the latest 1.1.0 plugin globally installed (on a pristine computer with only Erlang 20.3
and the latest rebar3 version 3.5.3 on it). A new app created from template with rebar3 new grispapp doesn't deploy on the first call to rebar3 grisp deploy but works fine on the second identical call.

Steps to reproduce reproduce.log

Unrepeatable fetching of pre-built OTP package

Following the grisp guide...
Running rebar3 grisp deploy the first time generates "_grisp" directory with a selected binary package.
For example "_grisp/grisp2/otp/23.3.4.11"

The problem is that this unpacking event is cached somewhere globally in the system.

Generating a new project and running a deploy will fail by giving this output.

rebar3 grisp deploy
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling grisp_demo
* Resolving OTP version
23.3.4.11 (requirement was "23")
* Downloading pre-built OTP package (a80bccc4)
(file cached)
* Extracting package
(already extracted)
===> Config value for system_libs must be a boolean or directory but found: "c:/Users/Luca Succi/Desktop/grisp_demo/_grisp/grisp/otp/23.3.4.11/install/lib"

The project is missing the searched directory. Currently the workaround is to copy the "_grisp" directory from the first project which succeeded to the one i want to deploy. This issue has been reported both for Windows and Linux systems.

Document rebar3 grisp build

rebar3 grisp build is not mentioned in the README

Especially useful advanced features like

rebar3 grisp build --configure false

Default GRiSP sources overwrite custom sources

Driver source code defined in the GRiSP runtime app grisp is always copied over last on top of any custom sources defined in a project. It should be the other way around, default sources should be used, but overwritten by custom sources.

`rebar3 help` informations are not complete for the `package` task

The informations displayed for the grisp plugin for the package task suggest that rebar3 grisp task should produce an output.

Output from rebar3 help for the GRISP plugin:

grisp <task>:
  build          Build a custom Erlang/OTP system for GRiSP
  deploy         Deploy a GRiSP release to a destination
  package        Pre-built package tasks
  report         Bug Report Utility
  version        Print version of plug-in

However, using rebar3 grisp task produce the following error:
===> package: unknown task: undefined

The correct command that needs to be used is rebar3 grisp task list

Wrong warning about Erlang version mismatch

During rebar3 grisp deploy it will warn about current version beeing not correct although it is:

===> Current Erlang version ("20") does not match target Erlang version ("20.2"). It is not guaranteed that the deployed release will work!

From Erlang documentation:

As from Erlang/OTP 17, the OTP release number corresponds to the major OTP version number. No erlang:system_info() argument gives the exact OTP version

Invalid release name on deploy results in crash

When deploying and using the wrong package name, the following crash occurs (with a release named foo):

$ rebar3 grisp deploy -n robot -v 0.1.0
===> Compiling foo
* Downloading pre-built OTP package (a80bccc4)
    (file cached)
* Extracting package
    (already extracted)
===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badkey,{robot,"0.1.0"}}
===> Stack trace to the error location:
[{maps,get,
       [{robot,"0.1.0"},
        #{{foo,"0.1.0"} =>
              {release_t,foo,"0.1.0",undefined,
                         [{foo,#{included_applications => undefined,
                                 name => foo,type => undefined,
                                 vsn => undefined}}],
                         false,[],[],undefined,[]}}],
       []},
 {rlx_state,get_configured_release,3,
            [{file,"/home/runner/work/rebar3/rebar3/_build/default/lib/relx/src/rlx_state.erl"},
             {line,281}]},
 {relx,build_release_,3,
       [{file,"/home/runner/work/rebar3/rebar3/_build/default/lib/relx/src/relx.erl"},
        {line,168}]},
 {relx,build_release,3,
       [{file,"/home/runner/work/rebar3/rebar3/_build/default/lib/relx/src/relx.erl"},
        {line,83}]},
 {rebar_relx,do,2,
             [{file,"/home/runner/work/rebar3/rebar3/src/rebar_relx.erl"},
              {line,75}]},
 {rebar3_grisp_deploy,release_handler,2,
                      [{file,"/private/tmp/foo/_build/default/plugins/rebar3_grisp/src/rebar3_grisp_deploy.erl"},
                       {line,231}]},
 {grisp_tools_handler,run,3,
                      [{file,"/private/tmp/foo/_build/default/plugins/grisp_tools/src/grisp_tools_handler.erl"},
                       {line,14}]},
 {grisp_tools_util,exec,3,
                   [{file,"/private/tmp/foo/_build/default/plugins/grisp_tools/src/grisp_tools_util.erl"},
                    {line,78}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`

We should return an error when a release could not be found.

Handle duplicate C source files from different apps

When merging C code from different apps and dependencies, we should handle duplicate file names since we can only have one file with the same name in the target OTP build directory tree. This should either be handled with warnings or errors, or a sensible policy.

[QUESTION] Possible bug in rebar3 grisp deploy

Hello :)

I am currently trying to deploy a freshly created grispapp on my board,
but an error keeps occurring when I try to call rebar3 grisp deploy -n myapp -v 0.1.0

The OTP version is set to 22.0 and the DEBUG stacktrace is the following :

DEBUG=1 rebar3 grisp deploy -n okbeamer -v 0.1.0
===> Load global config file /Users/laymer/.config/rebar3/rebar.config
===> Rebar3 detected a lock file from a newer version. It will be loaded in compatibility mode, but important information may be missing or lost. It is recommended to upgrade Rebar3.
===> 22.0.4 satisfies the requirement for minimum OTP version 18
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {default,install_deps},
                                                  {default,lock},
                                                  {default,compile},
                                                  {grisp,deploy}]
===> Provider: {default,app_discovery}
===> Evaluating config script "/Users/laymer/Dev/OTP22-0-4/okbeamer/_build/default/lib/grisp/rebar.config.script"
===> Provider: {default,install_deps}
===> Verifying dependencies...
===> sh info:
	cwd: "/Users/laymer/Dev/OTP22-0-4/okbeamer"
	cmd: git --version

===> 	opts: [{return_on_error,true},{use_stdout,false}]

===> Port Cmd: git --version
Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof]

===> sh info:
	cwd: "/Users/laymer/Dev/OTP22-0-4/okbeamer"
	cmd: git rev-parse --short=7 -q HEAD

===> 	opts: [{cd,"/Users/laymer/Dev/OTP22-0-4/okbeamer/_build/default/lib/epmd"}]

===> Port Cmd: git rev-parse --short=7 -q HEAD
Port Opts: [{cd,"/Users/laymer/Dev/OTP22-0-4/okbeamer/_build/default/lib/epmd"},
            exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof]

===> Comparing git ref 4d1a595 with 4d1a595
===> Provider: {default,lock}
===> Provider: {default,compile}
===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", pre_hooks, compile) -> no hooks defined

===> Compiling okbeamer
===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", pre_hooks, compile) -> no hooks defined

===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/Users/laymer/Dev/OTP22-0-4/okbeamer/src/okbeamer_server.erl",
                              "/Users/laymer/Dev/OTP22-0-4/okbeamer/src/okbeamer.erl",
                              "/Users/laymer/Dev/OTP22-0-4/okbeamer/src/okbeamer_sup.erl",
                              "/Users/laymer/Dev/OTP22-0-4/okbeamer/src/okbeamer_app.erl"]
===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", post_hooks, erlc_compile) -> no hooks defined

===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", pre_hooks, app_compile) -> no hooks defined

===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", post_hooks, app_compile) -> no hooks defined

===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", post_hooks, compile) -> no hooks defined

===> run_hooks("/Users/laymer/Dev/OTP22-0-4/okbeamer", post_hooks, compile) -> no hooks defined

===> Provider: {grisp,deploy}
===> [rebar3_grisp] {otp_type,"bb415d583ab2fc47d41963909914d7b3e2b664d49e4587342a2d5cf1957da018",
                                     package}
* Downloading pre-built OTP package (bb415d58)
===> [rebar3_grisp] {package,
                               {current_etag,
                                   "\"e467c5698efcd5b01c09fe64f50fb735-5\""}}
===> [rebar3_grisp] {package,
                               {deleting_tmp_file,
                                   "/Users/laymer/Library/Caches/grisp/packages/otp/grisp_base/grisp_otp_build_22.0_bb415d583ab2fc47d41963909914d7b3e2b664d49e4587342a2d5cf1957da018/grisp_otp_build_22.0_bb415d583ab2fc47d41963909914d7b3e2b664d49e4587342a2d5cf1957da018.temp"}}
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: badarg
===> Stack trace to the error location:
[{erlang,'++',
         [[47|grisp_base],
          "/otp/grisp_otp_build_22.0_bb415d583ab2fc47d41963909914d7b3e2b664d49e4587342a2d5cf1957da018.tar.gz"],
         []},
 {lists,append,1,[{file,"lists.erl"},{line,127}]},
 {lists,append,1,[{file,"lists.erl"},{line,127}]},
 {string,join,2,[{file,"string.erl"},{line,2244}]},
 {grisp_tools_deploy,package_download,1,
                     [{file,"/Users/laymer/.cache/rebar3/plugins/grisp_tools/src/grisp_tools_deploy.erl"},
                      {line,88}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
 {rebar3_grisp_deploy,do,1,
                      [{file,"/Users/laymer/.cache/rebar3/plugins/rebar3_grisp/src/rebar3_grisp_deploy.erl"},
                       {line,69}]},
 {rebar_core,do,2,
             [{file,"/tmp/cirrus-ci-build/src/rebar_core.erl"},{line,154}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`

The rebar3 report outputs the following :

rebar3 report "rebar3 grisp deploy -n okbeamer -v 0.1.0"
===> Rebar3 detected a lock file from a newer version. It will be loaded in 
compatibility mode, but important information may be missing or lost. It is recommended 
to upgrade Rebar3.
Rebar3 report
 version 3.13.2
 generated at 2020-09-19T17:41:38+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (
	and feel free to edit out private information, if any)
-----------------
Task: rebar3
Entered as:
  rebar3 grisp deploy -n okbeamer -v 0.1.0
-----------------
Operating System: x86_64-apple-darwin19.5.0
ERTS: Erlang/OTP 22 [erts-10.4.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [
async-threads:1] [hipe]
Root Directory: /Users/laymer/.asdf/installs/erlang/22.0.4
Library directory: /Users/laymer/.asdf/installs/erlang/22.0.4/lib
-----------------
Loaded Applications:
bbmustache: 1.6.1
certifi: 2.5.1
cf: 0.2.2
common_test: 1.17.3
compiler: 7.4.2
crypto: 4.5.1
cth_readable: 1.4.6
dialyzer: 4.0.1
edoc: 0.11
erlware_commons: 1.3.1
eunit: 2.3.7
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 3.19
inets: 7.0.8
kernel: 6.4.1
providers: 1.8.1
public_key: 1.6.7
relx: 3.33.0
sasl: 3.4
snmp: 5.3
ssl_verify_fun: 1.1.5
stdlib: 3.9.2
syntax_tools: 2.2
tools: 3.2

-----------------
Escript path: undefined
Providers:
  app_discovery as build clean compile compile cover ct cut deploy deps dialyzer do 
  docs edoc escriptize eunit get-deps help install install_deps key list lock new owner 
  path pkgs publish release relup repo report repos retire revert search shell state 
  tar tree unlock update upgrade upgrade upgrade user version version xref

I have narrowed down the origin of the badarg error to be (on my computer at least) caused by the "++" append, that fails when arguments are of type [H|T] ++ "/otp/..." :

===> Uncaught error: badarg
===> Stack trace to the error location:
[{erlang,'++',
         [[47|grisp_base],
          "/otp/grisp_otp_build_22.0.4_bb415d583ab2fc47d41963909914d7b3e2b664d49e4587342a2d5cf1957da018.tar.gz"],
         []},

But I know that there were no issues at all when I previously tried to deploy with OTP 22.0 / 22.0.4 and I am wondering if there were some changes that I am maybe missing or if I may have done something wrong with my development environment ?

Thanks in advance,

Best,
Igor

Start Erlang runtime when source dependencies are included

At the moment I am trying to add a specific dependency called Lasp into a Grisp project by declaring it in the rebar.config deps as follows :

{deps, [
  grisp,
  {epmd, {git, "https://github.com/erlang/epmd", {ref, "4d1a59"}}},
  lasp
]}.

Unfortunately, this is not enough to make the Lasp library available at runtime. But if the Lasp dependency is declared to be loaded inside the release according to the Relx specifications by adding :

{relx, [
    {release, {node , "0.1.0"}, [{epmd, none}, {lasp, load}, node]}
]}.

The Erlang runtime is unable to start once deployed to the Grisp board and remains stuck on :

starting erlang runtime

Forever. The same goes if load is replaced by node or if Lasp is added in the applications section inside the .app.src file. Currently, the only workaround that has been found is to redeploy the project a second time to the same SD card, but only after removing the source dependency and leaving Lasp only in the deps section in the rebar.config file. By doing so the previously added sources are still included but the startup procedure does not get blocked anymore and the Lasp library is available in the shell/application.

Although this workaround is enough to make it possible to use Lasp on Grisp boards, it prevents us from building releases without manually redeploying twice. I'm quite unsure if this is an actual issue or just not the right way to do it, but the confusing part is that when the same project is run using rebar3 as test shell command, everything goes just fine, the Erlang runtime remains stuck only when deploying it to a board.

Any suggestions are welcome :)

Put build configuration in seperate gitignored file

The path to the toolchain depends on the host. Therefore it should not be part of version controlled files.

The toolchain could either be specified in a seperate file in the repository or globally somewhere in the ~/.config/grisp/ directory.

Confusing error message, when no toolchain root is set

When no toolchain root in rebar.config is set you get:
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump

When running with DEBUG=1 you get some more hints, but a more verbose output would be helpful.

Detect when drivers were added or removed

At the moment you have to manually delete _grisp when there is a new or a deleted driver, otherwise you get an abscure build failure.

Perhaps we shoud automate that task, or at least give a better warning.

Already Patched OTP is not detected anymore

Steps to reproduce:

  • Build OTP with some custom Drivers.
  • Rebuild.
===> sh(git apply --ignore-whitespace otp.patch)
failed with return code 1 and the following output:
error: Anwendung des Patches fehlgeschlagen: erts/emulator/Makefile.in:889
error: erts/emulator/Makefile.in: Patch konnte nicht angewendet werden

Implement `rebar3 grisp deploy` without the need for -n and -v arguments

Starting with rebar 3.14 the functionality to figure out what releases are to build is hoisted from relx into rebar3:

https://github.com/erlang/rebar3/blob/master/src/rebar_relx.erl#L114-L153

Saving this from Slack so it doesn't get lost until this is tackled:

MononcQC on #rebar3 slack:

If you want to experiment a bit with it and open up the sort of scope you need I don't think we'd oppose it. Would have to check with Tristan for the sort of durability we'd like on that call but I'm assuming this is nicer now than before anyway.

If the module/call doesn't exist, then you know you're stuck on an old rebar3

clarification on using prebuilt cross-compiled OTP needed

I'm assuming a great deal from this blog post1 that if I have e.g. OTP20.x from
my system package manager, then I should be able to produce a grisp release
without needing to build RTEMS from scratch, if:

  • there is no C dependency
  • my OTP release matches whatever you have in "the CDN"

I've tried with the 2 latest OTP releases (OTP 21, OTP 20) and haven't had
great success, using the robot example with included wifi support:

$ erl +V
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 9.3.3.3
$ rebar3 do compile, grisp deploy -n robot -v 0.1.0
===> Verifying dependencies...
===> Compiling robot
===> [{relname,"robot"},{relvsn,"0.1.0"},{force,false}]
===> Current Erlang version ("20") does not match target Erlang version (undefined). It is not guaranteed that the deployed release will work!
===> Verifying dependencies...
===> Compiling robot
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
          /repos/grisp/sdcard/app/_build/grisp/lib
          /repos/grisp/sdcard/app/_grisp/otp/21.0/install
===> Failed to solve release:
 Dependency kernel is specified as a dependency but is not reachable by the system.

some questions:

  • what supported versions do you have in "the CDN"? is there a way to see it?
  • how can I include my own matching version from my RTEMS source build so it matches whatever my desktop package manager is currently using?
> uname -a
FreeBSD akai.skunkwerks.at 12.0-ALPHA9 FreeBSD 12.0-ALPHA9 r339356+891833d897fd(master) GENERIC  amd64
> pkg info erlang-runtime20
erlang-runtime20-20.3.8.9
Name           : erlang-runtime20
Version        : 20.3.8.9
Installed on   : Thu Oct  4 14:07:43 2018 UTC
Origin         : lang/erlang-runtime20
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : java lang parallel
Licenses       : APACHE20
Maintainer     : [email protected]
WWW            : http://www.erlang.org/
Comment        : Functional programming language from Ericsson
Options        :
	DIRTY          : on
	DTRACE         : on
	GS             : off
	HIPE           : on
	JAVA           : off
	KQUEUE         : on
	NATIVE         : off
	ODBC           : off
	OPENSSL        : on
	SCTP           : on
	THREADS        : on
	WX             : off
Annotations    :
	FreeBSD_version: 1200084
	repo_type      : binary
	repository     : FreeBSD
Flat size      : 103MiB
Description    :
Erlang is a programming language used to build massively scalable soft
real-time systems with requirements on high availability. Some of its
uses are in telecoms, banking, e-commerce, computer telephony and
instant messaging. Erlang's runtime system has built-in support for
concurrency, distribution and fault tolerance.

This port contains a standalone runtime environment of Erlang 20
to be used during the development of OTP applications.

WWW: http://www.erlang.org/

Weird directory with name " created during deploy

With the latest 1.1.4 plugin during deploy a directory path like e.g.

/home/students/p/a/paciorek/GRiSP/robot/"/home/students/p/a/paciorek/GRiSP/sd_card

Is created, note the directory with name just on quote character in the path.

This is happening on a Linux Fedora 27 system during the workshop in Krakow.

Config file attached.

rebar.config.txt

Rebar3 grisp build with nonexisting _grisp dir fails

 $ rm -rf _grisp _build
 $ rebar3 grisp build
===> Fetching rebar3_grisp ({pkg,<<"rebar3_grisp">>,<<"0.1.0">>})
===> Downloaded package, caching at /Users/peer/.cache/rebar3/hex/default/packages/rebar3_grisp-0.1.0.tar
===> Compiling rebar3_grisp
===> Verifying dependencies...
===> Fetching grisp ({pkg,<<"grisp">>,<<"0.1.1">>})
===> Downloaded package, caching at /Users/peer/.cache/rebar3/hex/default/packages/grisp-0.1.1.tar
===> Fetching rebar3_eqc ({pkg,<<"rebar3_eqc">>,<<"0.0.10">>})
===> Downloaded package, caching at /Users/peer/.cache/rebar3/hex/default/packages/rebar3_eqc-0.0.10.tar
===> Fetching cf ({pkg,<<"cf">>,<<"0.1.2">>})
===> Downloaded package, caching at /Users/peer/.cache/rebar3/hex/default/packages/cf-0.1.2.tar
===> Compiling cf
===> Compiling rebar3_eqc
===> Fetching mapz ({pkg,<<"mapz">>,<<"0.3.0">>})
===> Downloaded package, caching at /Users/peer/.cache/rebar3/hex/default/packages/mapz-0.3.0.tar
===> Checking out Erlang/OTP 19.3.6
* Cloning...  (this may take a while)
===> Preparing GRiSP code
* Copying C code...
* Patching OTP...
===> Building
* Running autoconf...
* Running configure...  (this may take a while)
* Building...  (this may take a while)
* Installing...
spawn: Could not cd to /Users/peer/projects/grisp/grisp_sd/_grisp/otp/19.3.6/install
===> sh(rm -rf /Users/peer/projects/grisp/grisp_sd/_grisp/otp/19.3.6/install/*)
failed with return code 2 and the following output:

The directory install doesn't exist.

Workaraound: after it failed create the missing dir and retry

$ mkdir _grisp/otp/19.3.6/install
$ rebar3 grisp build
===> Verifying dependencies...
===> Checking out Erlang/OTP 19.3.6
* Using existing checkout
===> Preparing GRiSP code
* Copying C code...
* Patching OTP...
===> Building
* Running autoconf...
* Running configure...  (this may take a while)
* Building...  (this may take a while)
* Installing...
===> Done

Erlang VM exited when using -internal_epmd and rebar 3.14

When deploying a GRiSP application with rebar 3.14 the OTP patch to add the -internal_epmd flag (i.e. grisp/otp@5ebbd6a) gets lost in the build process.

When starting GRiSP using internal epmd (e.g. when having wifi configurations as described in the wiki) it results in

Protocol 'inet_tcp': register/listen error: econnrefused
Erlang VM exited

Trouble with GRiSP’s robot demo (rebar3 fails)

Hi all, I have some problems when I try to deploy the robot example.

rebar3 grisp deploy fails with this error Config value for system_libs must be a boolean or directory but found: "/home/dagyu95/Documents/uni/tesi/robot/_grisp/grisp2/otp/23.3.4.11/install/lib".

I just followed the wiki and I don't know how to figure out the problem, can you give me some help?

Verbose output

$ DIAGNOSTIC=1 rebar3 grisp deploy                    
===> Load global config file /home/dagyu95/.config/rebar3/rebar.config
===> 23.3.4.11 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/home/dagyu95/.cache/rebar3/plugins/hex_core/rebar.config.script"
===> 23.3.4.11 satisfies the requirement for minimum OTP version 19.3
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider grisp deploy from module rebar3_grisp_deploy because it already exists from module rebar3_grisp_deploy
===> Not adding provider grisp build from module rebar3_grisp_build because it already exists from module rebar3_grisp_build
===> Not adding provider grisp package from module rebar3_grisp_package because it already exists from module rebar3_grisp_package
===> Not adding provider grisp version from module rebar3_grisp_version because it already exists from module rebar3_grisp_version
===> Expanded command sequence to be run: []
===> Running provider: do
===> Expanded command sequence to be run: [app_discovery,install_deps,lock,compile,{grisp,deploy}]
===> Running provider: app_discovery
===> Found top-level apps: [robot]
	using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===> Evaluating config script "/home/dagyu95/Documents/uni/tesi/robot/_build/default/lib/grisp/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider grisp deploy from module rebar3_grisp_deploy because it already exists from module rebar3_grisp_deploy
===> Not adding provider grisp build from module rebar3_grisp_build because it already exists from module rebar3_grisp_build
===> Not adding provider grisp package from module rebar3_grisp_package because it already exists from module rebar3_grisp_package
===> Not adding provider grisp version from module rebar3_grisp_version because it already exists from module rebar3_grisp_version
===> Running provider: install_deps
===> Verifying dependencies...
===> Running provider: lock
===> Running provider: compile
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Running hooks for compile with configuration:
===> 	{pre_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", pre_hooks, compile) -> no hooks defined

===> Compile (project_apps)
===> Running hooks for compile in app robot (/home/dagyu95/Documents/uni/tesi/robot) with configuration:
===> 	{pre_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", pre_hooks, compile) -> no hooks defined

===> Running hooks for erlc_compile in app robot (/home/dagyu95/Documents/uni/tesi/robot) with configuration:
===> 	{pre_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", pre_hooks, erlc_compile) -> no hooks defined

===> Setting paths to [deps]
===> Analyzing applications...
===> Compiling robot
===> compile options: {erl_opts, [debug_info]}.
===> files to analyze ["/home/dagyu95/Documents/uni/tesi/robot/src/robot_sup.erl",
                              "/home/dagyu95/Documents/uni/tesi/robot/src/robot.erl"]
===> Starting 0 worker(s)
===> Running hooks for erlc_compile in app robot (/home/dagyu95/Documents/uni/tesi/robot) with configuration:
===> 	{post_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", post_hooks, erlc_compile) -> no hooks defined

===> Running hooks for app_compile in app robot (/home/dagyu95/Documents/uni/tesi/robot) with configuration:
===> 	{pre_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", pre_hooks, app_compile) -> no hooks defined

===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Running hooks for app_compile in app robot (/home/dagyu95/Documents/uni/tesi/robot) with configuration:
===> 	{post_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", post_hooks, app_compile) -> no hooks defined

===> Running hooks for compile in app robot (/home/dagyu95/Documents/uni/tesi/robot) with configuration:
===> 	{post_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", post_hooks, compile) -> no hooks defined

===> Running hooks for compile with configuration:
===> 	{post_hooks, []}.
===> run_hooks("/home/dagyu95/Documents/uni/tesi/robot", post_hooks, compile) -> no hooks defined

===> Setting paths to [plugins]
===> Running provider: {grisp,deploy}
===> [rebar3_grisp] [config]
===> [rebar3_grisp] [deploy]
===> [rebar3_grisp] [deploy,validate]
===> [rebar3_grisp] [deploy,validate,apps]
* Resolving OTP version
    23.3.4.11 (requirement was "23.3.4.11")
===> [rebar3_grisp] [deploy,collect]
===> GRiSP hash:
a80bccc41bebe9f21b8623d29b0c801277928295ab1f81531e37b2eb5353521e

[{<<"00100-rtems.patch">>,
  <<"987cab9e857a1ae86bfc6d12f17e1a50d6f1633a8f77d3da4cf99aa8c5badc28">>},
 {<<"00300-drivers-nifs.patch">>,
  <<"d3e469631ef8d253368f67d5c5d2b47ddf8290e48e7331362ca84863ec97b66">>},
 {<<"erts/emulator/drivers/unix/grisp_termios_drv.c">>,
  <<"7681801fca2aa5639e32365e9fad1626e3226f205bd3a7f4944e6e57ea29a3d0">>},
 {<<"erts/emulator/nifs/common/grisp_gpio_nif.c">>,
  <<"6d88dab1b11f41b7ca34791b67bb3dcdc288262db0c4c0ac01707248ed75194e">>},
 {<<"erts/emulator/nifs/common/grisp_hw_nif.c">>,
  <<"7be1ac99d35234c7370728d1bc3a1bdf6a31f3bca2c181406336959567e6c528">>},
 {<<"erts/emulator/nifs/common/grisp_i2c_nif.c">>,
  <<"eb989c69d1455eb84a9e3f0ff5646e4b9696cd8910a8f9f57d183925417c2cd7">>},
 {<<"erts/emulator/nifs/common/grisp_rtems_nif.c">>,
  <<"86840705643b73bda6edafaa6a65653346eede3f6be47c160842c192b6e98646">>},
 {<<"erts/emulator/nifs/common/grisp_spi_nif.c">>,
  <<"71af657167e7fe8b94463a589f0ee1a72e6572d5f41b28f685481cfcef0949d7">>},
 {<<"erts/emulator/sys/unix/erl_main.c">>,
  <<"bc5adb4b1518b6f29ea41cd3f6cf1e69919f5448cafe7f4db8c2866fad2bba4e">>},
 {<<"post-install-00500-clean.sh">>,
  <<"8257667f99ce2814c6f15f3b9b1c35765f986e9da1661736402dc91f78ad52a">>},
 {<<"xcomp/erl-xcomp-arm-rtems5.conf">>,
  <<"64db9be368d2598210da2d8eae558fde078e3b3814feb06eaed5c8981d4f392c">>}]
===> [rebar3_grisp] [deploy,package]
* Downloading pre-built OTP package (a80bccc4)
===> [rebar3_grisp] [deploy,package,meta]
===> [rebar3_grisp] [deploy,package,meta,package,
                            {meta,#{etag =>
                                        "\"96882f21787f2c89e3cc9fc6ddb4329e-4\""}}]
===> [rebar3_grisp] [deploy,package,init]
===> [rebar3_grisp] [deploy,package,init,
                            {deleting_tmp_file,
                                <<"/home/dagyu95/.cache/grisp/packages/otp/grisp_otp_build_23.3.4.11_a80bccc41bebe9f21b8623d29b0c801277928295ab1f81531e37b2eb5353521e.tar.gz.temp">>}]
===> [rebar3_grisp] [deploy,package,download]
===> [rebar3_grisp] [deploy,package,download,
                            {uri,"https://s3.amazonaws.com/grisp/platforms/grisp2/otp/grisp_otp_build_23.3.4.11_a80bccc41bebe9f21b8623d29b0c801277928295ab1f81531e37b2eb5353521e.tar.gz"}]
    (file cached)
* Extracting package
    (already extracted)
===> [rebar3_grisp] [deploy,release]
===> [rebar3_grisp] [deploy,release,
                            {start,#{erts =>
                                         <<"/home/dagyu95/Documents/uni/tesi/robot/_grisp/grisp2/otp/23.3.4.11/install">>,
                                     name => "robot",version => "0.1.0"}}]
===> ARGS: ["-n","robot","-v","0.1.0"]
===> ROOT: <<"/home/dagyu95/Documents/uni/tesi/robot/_grisp/grisp2/otp/23.3.4.11/install">>
===> Configuring releases the {relx, ...} entry from rebar.config
===> Config value for system_libs must be a boolean or directory but found: "/home/dagyu95/Documents/uni/tesi/robot/_grisp/grisp2/otp/23.3.4.11/install/lib"

Versions

OTP: 23.3.4.11
rebar 3.18.0 on Erlang/OTP 23 Erts 11.2.2.10
rebar3_grisp (2.2.1)

With default profile section ERTS does not get included

With Default rebar.conf from Template

rebar.config:

{deps, [grisp]}.

{plugins, [rebar3_grisp]}.

{erl_opts, [debug_info]}.

{grisp, [
    {otp_release, "19"},
    {deploy, [
        {destination, "/run/media/kilian/04CE-D7FB"}
    ]},
    {toolchain, [{root,"/home/kilian/Stritzinger/grisp-software/rtems-install/rtems-4.12"}]}
]}.

{relx, [
    {release, {testp2, "0.1.0"}, [testp2]}
]}.

{profiles, [
    {grisp, [
        {relx, [
            {include_erts, false},
            {extended_start_script, false},
            {dev_mode, false}
        ]}
    ]}
]}.

you get:

 rebar3 grisp deploy --relname testp2 --relvsn 0.1.0
===> [{relname,"testp2"},{relvsn,"0.1.0"},{force,false}]
===> Verifying dependencies...
===> Compiling testp2
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
          /home/kilian/Stritzinger/testp2/_build/grisp/lib
          /home/kilian/Stritzinger/testp2/_grisp/otp/19.3.6/install
          /home/kilian/Stritzinger/testp2/_build/grisp/rel
===> Resolved testp2-0.1.0
===> release successfully created!
===> Deploying testp2-0.1.0 to /run/media/kilian/04CE-D7FB
* Copying files...
* Copying release...

and

$ls 04CE-D7FB/testp2/
bin  lib  releases
$rm -r ./04CE-D7FB/*

Without

rebar.config:

{deps, [grisp]}.

{plugins, [rebar3_grisp]}.

{erl_opts, [debug_info]}.

{grisp, [
    {otp_release, "19"},
    {deploy, [
        {destination, "/run/media/kilian/04CE-D7FB"}
    ]},
    {toolchain, [{root,"/home/kilian/Stritzinger/grisp-software/rtems-install/rtems-4.12"}]}
]}.

{relx, [
    {release, {testp2, "0.1.0"}, [testp2]}
]}.

%{profiles, [
%    {grisp, [
%        {relx, [
%            {include_erts, false},
%            {extended_start_script, false},
%            {dev_mode, false}
%        ]}
%    ]}
%]}.
rebar3 grisp deploy --relname testp2 --relvsn 0.1.0
===> [{relname,"testp2"},{relvsn,"0.1.0"},{force,false}]
===> Verifying dependencies...
===> Compiling testp2
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
          /home/kilian/Stritzinger/testp2/_build/grisp/lib
          /home/kilian/Stritzinger/testp2/_grisp/otp/19.3.6/install
          /home/kilian/Stritzinger/testp2/_build/grisp/rel
===> Resolved testp2-0.1.0
===> Including Erts from /home/kilian/Stritzinger/testp2/_grisp/otp/19.3.6/install
===> release successfully created!
===> Deploying testp2-0.1.0 to /run/media/kilian/04CE-D7FB
* Copying files...
* Copying release...
$ ls 04CE-D7FB/testp2/
bin  erts-8.3.5  lib  releases

Implement `rebar3 grisp clean`

A task rebar3 grisp clean should be implemented that works in the following way:

  • Called as is, it should delete
    • _build/grisp
    • _grisp
    • ~/.cache/grisp/packages/*.temp
  • Called with --full it should also delete:
    • ~/.cache/grisp
    • ~/.cache/rebar3/plugins/rebar3_grisp

It should ask for confirmation for either each individual folder/file or for some logical groups of folders and files.

Error in build phase No.2

Hi grisp team,
I made some progress on building OTP for grisp, there's new error,
here's my build environment:

  1. I'm using Freebsd with grisp-software build successfully.
  2. I've upgraded the rebar3_grisp to the newest 1.2.6
  3. created a new repo with rebar3 new grispapp name=foo dest=/dev/sd1
  4. rebar.conf
{deps, [grisp]}.
  
{erl_opts, [debug_info]}.

{grisp, [
    {otp, [
        {version, "22.0.4"}
    ]},
    {build, [
        {toolchain, [
            {directory, "/usr/home/mko_io/mcu/grisp-software/rtems-install/rtems/5"}
        ]}
    ]},
    {deploy, [
        {destination, "foo_disk"}
    ]}
]}.

{shell, [{apps, []}]}.

{relx, [
    {release, {foo, "0.1.0"}, [foo]}
]}.

here 's the long error log

$ rebar3 grisp build 
===> Compiling grisp_tools
===> Compiling rebar3_grisp
===> Verifying dependencies...
===> Checking out Erlang/OTP 22.0
* Using existing checkout
* Copying C code...
* Patching OTP to include sys, driver and NIF files
  (skipped, already patched)
===> Building
* Running autoconf...
* Running configure...  (this may take a while)
* Compiling...  (this may take a while)
===> sh(./otp_build boot -a)
failed with return code 1 and the following output:
 MAKE	depend
gmake[1]: Entering directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator'
 MAKE	generate
gmake[2]: Entering directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator'
 GEN	x86_64-unknown-freebsd12.0/gen_git_version.mk
 GEN	x86_64-unknown-freebsd12.0/opt/smp/OPCODES-GENERATED
 GEN	x86_64-unknown-freebsd12.0/opt/smp/TABLES-GENERATED
 GEN	x86_64-unknown-freebsd12.0/opt/smp/erl_alloc_types.h
 GEN	x86_64-unknown-freebsd12.0/erl_version.h
 GEN	x86_64-unknown-freebsd12.0/opt/smp/driver_tab.c
 GEN	x86_64-unknown-freebsd12.0/opt/smp/GENERATED
 GEN	x86_64-unknown-freebsd12.0/preload.c
gmake[2]: Leaving directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator'
gmake[1]: Leaving directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator'
gmake[1]: Entering directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator'
 MAKE	depend
gmake[2]: Entering directory '/usr/home/mko

omit many waring lines

legacy/erl_marshal.c:472:6: note: in expansion of macro 'put32be'
      put32be(*ext, i);
      ^~~~~~~
misc/putget.h:53:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[2] = ((n) >>  8) & 0xff;  \
            ^
legacy/erl_marshal.c:472:6: note: in expansion of macro 'put32be'
      put32be(*ext, i);
      ^~~~~~~
misc/putget.h:54:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[3] = (n) & 0xff; \
            ^
legacy/erl_marshal.c:472:6: note: in expansion of macro 'put32be'
      put32be(*ext, i);
      ^~~~~~~
misc/putget.h:51:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[0] = ((n) >>  24) & 0xff; \
            ^
legacy/erl_marshal.c:474:6: note: in expansion of macro 'put32be'
      put32be(*ext, i);
      ^~~~~~~
misc/putget.h:52:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[1] = ((n) >>  16) & 0xff; \
            ^
legacy/erl_marshal.c:474:6: note: in expansion of macro 'put32be'
      put32be(*ext, i);
      ^~~~~~~
misc/putget.h:53:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[2] = ((n) >>  8) & 0xff;  \
            ^
legacy/erl_marshal.c:474:6: note: in expansion of macro 'put32be'
      put32be(*ext, i);
      ^~~~~~~
misc/putget.h:54:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[3] = (n) & 0xff; \
            ^
legacy/erl_marshal.c:474:6: note: in expansion of macro 'put32be'
      put32be(*ext, i);
      ^~~~~~~
misc/putget.h:51:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[0] = ((n) >>  24) & 0xff; \
            ^
legacy/erl_marshal.c:483:3: note: in expansion of macro 'put32be'
   put32be(size_p, i);
   ^~~~~~~
misc/putget.h:52:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[1] = ((n) >>  16) & 0xff; \
            ^
legacy/erl_marshal.c:483:3: note: in expansion of macro 'put32be'
   put32be(size_p, i);
   ^~~~~~~
misc/putget.h:53:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[2] = ((n) >>  8) & 0xff;  \
            ^
legacy/erl_marshal.c:483:3: note: in expansion of macro 'put32be'
   put32be(size_p, i);
   ^~~~~~~
misc/putget.h:54:12: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   (s)[3] = (n) & 0xff; \
            ^
legacy/erl_marshal.c:483:3: note: in expansion of macro 'put32be'
   put32be(size_p, i);
   ^~~~~~~
legacy/erl_marshal.c:488:18: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
      *(*ext)++ = (i >> 24) & 0xff;
                  ^
legacy/erl_marshal.c:489:18: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
      *(*ext)++ = (i >> 16) & 0xff;
                  ^
legacy/erl_marshal.c:490:18: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
      *(*ext)++ = (i >>  8) & 0xff;
                  ^
legacy/erl_marshal.c:491:18: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
      *(*ext)++ = i  & 0xff;
                  ^
legacy/erl_marshal.c: In function 'erl_decode_it':
legacy/erl_marshal.c:896:18: warning: declaration of 'i' shadows a previous local [-Wshadow]
      size_t cnt, i;
                  ^
legacy/erl_marshal.c:732:9: note: shadowed declaration is here
     int i,j,arity;
         ^
legacy/erl_marshal.c: In function 'cmp_latin1_vs_utf8':
legacy/erl_marshal.c:1526:25: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
     unsigned char* sL = (unsigned char*)strL;
                         ^
legacy/erl_marshal.c:1527:25: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
     unsigned char* sU = (unsigned char*)strU;
                         ^
legacy/erl_marshal.c:1535:10: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion]
   UasL = ((sU[0] & 0x3) << 6) | (sU[1] & 0x3F);
          ^
 CC	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj.mt/arm-unknown-rtems5/erl_resolve.o
 CC	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj.mt/arm-unknown-rtems5/erl_timeout.o
 CC	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj.mt/arm-unknown-rtems5/global_names.o
 CC	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj.mt/arm-unknown-rtems5/global_register.o
 CC	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj.mt/arm-unknown-rtems5/global_unregister.o
 CC	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj.mt/arm-unknown-rtems5/global_whereis.o
 AR	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj/arm-unknown-rtems5/liberl_interface.a
 RANLIB	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj/arm-unknown-rtems5/liberl_interface.a
 LD	/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/bin/arm-unknown-rtems5/erl_call
prog/erl_call.c: In function 'main':
prog/erl_call.c:296:16: warning: conversion to 'int' from 'time_t {aka long long int}' may alter its value [-Wconversion]
     creation = (time(NULL) % 3) + 1; /* "random" */
                ^
prog/erl_call.c:300:11: warning: conversion to 'int' from 'time_t {aka long long int}' may alter its value [-Wconversion]
       i = flags.randomp ? (time(NULL) % 997) : 17;
           ^~~~~
prog/erl_call.c:316:13: warning: declaration of 'ct' shadows a previous local [-Wshadow]
       char* ct;
             ^~
prog/erl_call.c:147:11: note: shadowed declaration is here
     char *ct = NULL; /* temporary used when truncating nodename */
           ^~
prog/erl_call.c:397:6: warning: declaration of 'i' shadows a previous local [-Wshadow]
  int i = 0;
      ^
prog/erl_call.c:142:9: note: shadowed declaration is here
     int i = 1,fd,creation;
         ^
prog/erl_call.c:398:8: warning: declaration of 'p' shadows a previous local [-Wshadow]
  char *p;
        ^
prog/erl_call.c:146:11: note: shadowed declaration is here
     char *p = NULL;
           ^
prog/erl_call.c:440:8: warning: declaration of 'i' shadows a previous local [-Wshadow]
    int i = 0;
        ^
prog/erl_call.c:142:9: note: shadowed declaration is here
     int i = 1,fd,creation;
         ^
prog/erl_call.c:441:10: warning: declaration of 'p' shadows a previous local [-Wshadow]
    char *p;
          ^
prog/erl_call.c:146:11: note: shadowed declaration is here
     char *p = NULL;
           ^
prog/erl_call.c:473:8: warning: declaration of 'i' shadows a previous local [-Wshadow]
    int i = 0;
        ^
prog/erl_call.c:142:9: note: shadowed declaration is here
     int i = 1,fd,creation;
         ^
prog/erl_call.c:474:10: warning: declaration of 'p' shadows a previous local [-Wshadow]
    char *p;
          ^
prog/erl_call.c:146:11: note: shadowed declaration is here
     char *p = NULL;
           ^
prog/erl_call.c:528:8: warning: declaration of 'i' shadows a previous local [-Wshadow]
    int i = 0;
        ^
prog/erl_call.c:142:9: note: shadowed declaration is here
     int i = 1,fd,creation;
         ^
prog/erl_call.c:529:10: warning: declaration of 'p' shadows a previous local [-Wshadow]
    char *p;
          ^
prog/erl_call.c:146:11: note: shadowed declaration is here
     char *p = NULL;
           ^
prog/erl_call.c:590:8: warning: declaration of 'i' shadows a previous local [-Wshadow]
    int i = 0;
        ^
prog/erl_call.c:142:9: note: shadowed declaration is here
     int i = 1,fd,creation;
         ^
prog/erl_call.c: In function 'do_connect':
prog/erl_call.c:650:32: warning: cast increases required alignment of target type [-Wcast-align]
  if ((r=erl_start_sys(ec,alive,(Erl_IpAddr)(h->h_addr_list[0]),
                                ^
prog/erl_call.c: In function 'main':
prog/erl_call.c:245:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
   usage(progname);
   ^~~~~~~~~~~~~~~
prog/erl_call.c:246:6: note: here
      default:
      ^~~~~~~
/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/obj/arm-unknown-rtems5/libei.a(ei_connect.o): In function `gen_challenge':
/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/src/connect/ei_connect.c:1659: undefined reference to `gethostid'
/usr/home/mko_io/mcu/grisp-software/rtems-install/rtems/5/arm-rtems5/atsamv/lib/librtemscpu.a(bdbuf.o): In function `rtems_mutex_lock':
/usr/home/mko_io/mcu/grisp-software/rtems/cpukit/include/rtems/thread.h:54: undefined reference to `rtems_bdbuf_configuration'
/usr/home/mko_io/mcu/grisp-software/rtems-install/rtems/5/arm-rtems5/atsamv/lib/librtemscpu.a(bdbuf.o): In function `rtems_bdbuf_set_block_size':
/usr/home/mko_io/mcu/grisp-software/build/..//rtems/c/src/../../cpukit/libblock/src/bdbuf.c:2880: undefined reference to `rtems_bdbuf_configuration'
collect2: error: ld returned 1 exit status
gmake[4]: *** [arm-unknown-rtems5/Makefile:669: /usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/bin/arm-unknown-rtems5/erl_call] Error 1
gmake[4]: Leaving directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/src'
gmake[3]: *** [Makefile:31: opt] Error 2
gmake[3]: Leaving directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface/src'
gmake[2]: *** [/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/make/otp_subdir.mk:29: opt] Error 2
gmake[2]: Leaving directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib/erl_interface'
gmake[1]: *** [/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/make/otp_subdir.mk:29: opt] Error 2
gmake[1]: Leaving directory '/usr/home/mko_io/mcu/foo/_grisp/otp/22.0.4/build/lib'
gmake: *** [Makefile:490: libs] Error 2

Error in build phase

Hi, I'm following the guide and found the following error

$ DEBUG=1 rebar3 grisp build
===> Load global config file /home/mko_io/.config/rebar3/rebar.config
===> 22.0.7 satisfies the requirement for minimum OTP version 18
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {default,install_deps},
                                                  {grisp,build}]
===> Provider: {default,app_discovery}
===> Evaluating config script "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/rebar.config.script"
===> Provider: {default,install_deps}
===> Verifying dependencies...
===> Provider: {grisp,build}
===> Checking out Erlang/OTP 22.0
* Using existing checkout
===> sh info:
	cwd: "/usr/home/mko_io/beam/grisp_simple"
	cmd: git checkout grisp/OTP-22.0

===> 	opts: [{cd,"/usr/home/mko_io/beam/grisp_simple/_grisp/otp/22.0/build"},
                       abort_on_error]

===> Port Cmd: git checkout grisp/OTP-22.0
Port Opts: [{cd,"/usr/home/mko_io/beam/grisp_simple/_grisp/otp/22.0/build"},
            exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof]

* Copying C code...
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,{#{"erts/emulator/sys/unix/erl_main.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/sys/erl_main.c"},
                                       #{"erts/emulator/drivers/unix/grisp_gpio_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_gpio_drv.c",
                                         "erts/emulator/drivers/unix/grisp_i2c_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_i2c_drv.c",
                                         "erts/emulator/drivers/unix/grisp_spi_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_spi_drv.c",
                                         "erts/emulator/drivers/unix/grisp_termios_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_termios_drv.c"}}}
===> Stack trace to the error location:
[{rebar3_grisp_build,copy_files,3,
                     [{file,"/home/mko_io/.cache/rebar3/plugins/rebar3_grisp/src/rebar3_grisp_build.erl"},
                      {line,110}]},
 {rebar3_grisp_build,do,1,
                     [{file,"/home/mko_io/.cache/rebar3/plugins/rebar3_grisp/src/rebar3_grisp_build.erl"},
                      {line,65}]},
 {rebar_core,do,2,
             [{file,"/usr/home/mko_io/beam/rebar3/src/rebar_core.erl"},
              {line,154}]},
 {rebar_prv_do,do_task,5,
               [{file,"/usr/home/mko_io/beam/rebar3/src/rebar_prv_do.erl"},
                {line,87}]},
 {rebar_core,do,2,
             [{file,"/usr/home/mko_io/beam/rebar3/src/rebar_core.erl"},
              {line,154}]},
 {rebar3,run_aux,2,
         [{file,"/usr/home/mko_io/beam/rebar3/src/rebar3.erl"},{line,182}]},
 {rebar3,main,1,
         [{file,"/usr/home/mko_io/beam/rebar3/src/rebar3.erl"},{line,66}]},
 {escript,run,2,[{file,"escript.erl"},{line,758}]}]

and there my rebar report

$ rebar3 report
Rebar3 report
 version 3.12.0+build.4448.refe2ac3217
 generated at 2019-09-15T17:55:19+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: 
Entered as:
  
-----------------
Operating System: amd64-portbld-freebsd12.0
ERTS: Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1] [dtrace]
Root Directory: /home/mko_io/beam/otp
Library directory: /home/mko_io/beam/otp/lib
-----------------
Loaded Applications:
bbmustache: 1.6.1
certifi: 2.5.1
cf: 0.2.2
common_test: 1.17.3
compiler: 7.4.4
crypto: 4.5.1
cth_readable: 1.4.5
dialyzer: 4.0.3
edoc: 0.11
erlware_commons: 1.3.1
eunit: 2.3.7
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 3.19.1
inets: 7.0.9
kernel: 6.4.1
providers: 1.8.1
public_key: 1.6.7
relx: 3.33.0
sasl: 3.4
snmp: 5.3
ssl_verify_fun: 1.1.5
stdlib: 3.9.2
syntax_tools: 2.2
tools: 3.2

-----------------
Escript path: /home/mko_io/beam/bin/rebar3
Providers:
  app_discovery as build clean compile compile cover ct cut deploy deps dialyzer do docs edoc escriptize eunit get-deps help install install_deps key list lock new owner path pkgs publish release relup repo report repos retire revert search shell state tar tree unlock update upgrade upgrade upgrade user version version xref 

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.