Skip to content

examples/lua*: adapt to the blob mechanism#14332

Merged
fjmolinas merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/examples/lua_blobs
Jun 23, 2020
Merged

examples/lua*: adapt to the blob mechanism#14332
fjmolinas merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/examples/lua_blobs

Conversation

@aabadie
Copy link
Contributor

@aabadie aabadie commented Jun 23, 2020

Contribution description

This PR adapts the lua examples so that they now use the blob mechanism available in the build system instead of manually generating the header files containing the lua code.
The approach is already done with micropython and javascript examples.

Testing procedure

lua examples are still functional.

Examples on native:

`examples/lua_basic`
make -C examples/lua_basic/ all term
make: Entering directory '/work/riot/RIOT/examples/lua_basic'
Building application "lua_basic" for "native" with MCU "native".

make[1]: Nothing to be done for 'prepare'.
make[1]: Nothing to be done for 'prepare'.
"make" -C /work/riot/RIOT/pkg/lua
"make" -C /work/riot/RIOT/examples/lua_basic/bin/pkg/native/lua -f /work/riot/RIOT/pkg/lua/Makefile.lua
"make" -C /work/riot/RIOT/pkg/tlsf
"make" -C /work/riot/RIOT/examples/lua_basic/bin/pkg/native/tlsf -f /work/riot/RIOT/Makefile.base
"make" -C /work/riot/RIOT/boards/native
"make" -C /work/riot/RIOT/boards/native/drivers
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/native
"make" -C /work/riot/RIOT/cpu/native/periph
"make" -C /work/riot/RIOT/cpu/native/stdio_native
"make" -C /work/riot/RIOT/cpu/native/vfs
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/pkg/lua/contrib
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
   text	   data	    bss	    dec	    hex	filename
 290708	   2724	  58736	 352168	  55fa8	/work/riot/RIOT/examples/lua_basic/bin/native/lua_basic.elf
/work/riot/RIOT/examples/lua_basic/bin/native/lua_basic.elf  
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2020.07-devel-1406-gd191b)
Lua RIOT build
Hello world, this is lua!
Lua interpreter exited
^C
native: exiting
`examples/lua_REPL`
make -C examples/lua_REPL/ all term
make: Entering directory '/work/riot/RIOT/examples/lua_REPL'
Building application "lua_repl" for "native" with MCU "native".

[INFO] cloning lua
git-cache: cloning from cache. tag=commite354c6355e7f48e087678ec49e340ca0696725b1-443128
[INFO] updating lua /work/riot/RIOT/examples/lua_REPL/bin/pkg/native/lua/.pkg-state.git-downloaded
echo e354c6355e7f48e087678ec49e340ca0696725b1 > /work/riot/RIOT/examples/lua_REPL/bin/pkg/native/lua/.pkg-state.git-downloaded
[INFO] patch lua
[INFO] cloning tlsf
git-cache: cloning from cache. tag=commita1f743ffac0305408b39e791e0ffb45f6d9bc777-443185
[INFO] updating tlsf /work/riot/RIOT/examples/lua_REPL/bin/pkg/native/tlsf/.pkg-state.git-downloaded
echo a1f743ffac0305408b39e791e0ffb45f6d9bc777 > /work/riot/RIOT/examples/lua_REPL/bin/pkg/native/tlsf/.pkg-state.git-downloaded
[INFO] patch tlsf
"make" -C /work/riot/RIOT/pkg/lua
"make" -C /work/riot/RIOT/examples/lua_REPL/bin/pkg/native/lua -f /work/riot/RIOT/pkg/lua/Makefile.lua
"make" -C /work/riot/RIOT/pkg/tlsf
"make" -C /work/riot/RIOT/examples/lua_REPL/bin/pkg/native/tlsf -f /work/riot/RIOT/Makefile.base
"make" -C /work/riot/RIOT/boards/native
"make" -C /work/riot/RIOT/boards/native/drivers
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/native
"make" -C /work/riot/RIOT/cpu/native/periph
"make" -C /work/riot/RIOT/cpu/native/stdio_native
"make" -C /work/riot/RIOT/cpu/native/vfs
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/pkg/lua/contrib
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
   text	   data	    bss	    dec	    hex	filename
 294541	   2780	  90640	 387961	  5eb79	/work/riot/RIOT/examples/lua_REPL/bin/native/lua_repl.elf
/work/riot/RIOT/examples/lua_REPL/bin/native/lua_repl.elf  
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2020.07-devel-1406-gd191b)
Using memory range for Lua heap: 0x565b5090 - 0x565becd0, 4 bytes
This is Lua: starting interactive session

Welcome to the interactive interpreter
L> help
L> h
L> 1 + 2
3
L> ^C
native: exiting

Issues/PRs references

closes #11497 (blobs mechanism already available and lua examples are adapted)

@aabadie aabadie added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: examples Area: Example Applications labels Jun 23, 2020
@fjmolinas fjmolinas self-assigned this Jun 23, 2020
Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, tested both examples on native:

LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2020.07-devel-1407-gead8b8-pr-14332)
Using memory range for Lua heap: 0x5663f090 - 0x56648cd0, 4 bytes
This is Lua: starting interactive session

Welcome to the interactive interpreter
L> help
L> a
L> 1
1
L> help
L> 1 + 2
3
L> 
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2020.07-devel-1407-gead8b8-pr-14332)
Lua RIOT build
Hello world, this is lua!
Lua interpreter exited
hlep

@fjmolinas fjmolinas merged commit 2b48754 into RIOT-OS:master Jun 23, 2020
@aabadie aabadie deleted the pr/examples/lua_blobs branch June 23, 2020 14:19
@miri64 miri64 added this to the Release 2020.07 milestone Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: examples Area: Example Applications CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants