Skip to content

shell_commands: provide command to print version#13152

Merged
miri64 merged 2 commits intoRIOT-OS:masterfrom
miri64:shell_commands/enh/version
Mar 11, 2020
Merged

shell_commands: provide command to print version#13152
miri64 merged 2 commits intoRIOT-OS:masterfrom
miri64:shell_commands/enh/version

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Jan 17, 2020

Contribution description

I sometimes come in the situation that I'm not sure, if the version of RIOT I'm currently running is really the one I wanted to run or it is running for longer and I want to have another look to be sure. Currently, the only for me way to do that is either rebooting the node or using a debugger. This provides a shell command version to print the string stored at RIOT_VERSION to determine the RIOT version (if provided) at run-time.

Testing procedure

Run any application using the shell_commands module. E.g.

make -C examples/default flash term

and type version

> version
version
2020.04-devel-22-g5fd88-shell_commands/enh/version

Depending on your checkout and your build configuration (e.g. with RIOT_CI_BUILD) this string may differ of course.

Issues/PRs references

None

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: sys Area: System labels Jan 17, 2020
@miri64 miri64 requested a review from kaspar030 January 17, 2020 10:28
Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

Useful, straight-forward, simple addition. ACK.

@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 17, 2020
@kaspar030
Copy link
Copy Markdown
Contributor

Let some future us add this to some test. 😉

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jan 17, 2020

I actually wanted to extend tests/shell. Turns out RIOT_VERSION is not exported to the test runner and I did not want to mess around with that atm ^^".

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 17, 2020

Turns out RIOT_VERSION is not exported to the test runner and I did not want to mess around with that atm

Adding export RIOT_VERSION after include $(RIOTBASE)/Makefile.include in the application Makefile should be enough to be able to retrieve it from the python script.

@kaspar030
Copy link
Copy Markdown
Contributor

Adding export RIOT_VERSION after include $(RIOTBASE)/Makefile.include in the application Makefile should be enough to be able to retrieve it from the python script.

That test should only fail if the git commit is not dirty. Otherwise the (soon to be available) make test-murdock fails unless the local changes are all commited.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jan 17, 2020

Sooo should I add a test or not?

@kaspar030
Copy link
Copy Markdown
Contributor

Sooo should I add a test or not?

Feel free. I ACK this without.

(unfortunately this PR seems to push some boards into insufficient memory...)

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jan 17, 2020

There is also the issue, that the tests/periph_wdt test now does not fit our atmega328p platforms anymore. This test previously had no blacklisting. Since it is the RAM that is running out a simple solution could be to set RIOT_VERSION="" for this particular test.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jan 17, 2020

On the other hand, I'm wondering what the shell_commands module is needed for in this PR.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 17, 2020

The RAM problem is related to some work @fjmolinas made for AVR. Related issues/PR: #13016, #12940

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jan 17, 2020

In this case however the app developer did not seem to have been as frugal as they could have been. I propose to remove the USEMODULE += shell_commands line from that application in a separate PR.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jan 17, 2020

In this case however the app developer did not seem to have been as frugal as they could have been. I propose to remove the USEMODULE += shell_commands line from that application in a separate PR.

Mh, when I remove that module, the test fails on the second iteration. I don't really understand why

BOARD=samr21-xpro make -C tests/periph_wdt/ test
make: Entering directory '/home/mlenders/Repositories/RIOT-OS/RIOT/tests/periph_wdt'
PASSED target time: 128[ms], actual_time: 127.648[ms]
FAILED target time: 512[ms], actual_time: 9986.882[ms]

make: *** [/home/mlenders/Repositories/RIOT-OS/RIOT/tests/periph_wdt/../../Makefile.include:735: test] Error 1
make: Leaving directory '/home/mlenders/Repositories/RIOT-OS/RIOT/tests/periph_wdt'

@fjmolinas any idea?

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Jan 17, 2020

I'm suspecting there is something hidden happening around the test_utils_interactive_sync module which I don't expect, but I tried to add that function to main() and it still did not work :-/.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 11, 2020

Ping @fjmolinas??!?

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 11, 2020
@fjmolinas
Copy link
Copy Markdown
Contributor

Ping @fjmolinas??!?

Not sure why its failing, I'll take a look. I have an idea on how to remove the need for interactive_sync when using the shell, I'll test it out.

I had added shell_commands to the test in 416c048, the commit describes why.

@fjmolinas
Copy link
Copy Markdown
Contributor

@miri64 I propose you just add a Makefile.ci in this PR, and I'll remove it in #13613, #13195 is running into the same issue, and #13613 needs more extensive testing and its going to take me a little bit.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 11, 2020

If you promise to remove the file in Makefile.ci in #13613 again, I'll do it ;-).

@miri64 miri64 requested a review from MrKevinWeiss as a code owner March 11, 2020 14:30
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 11, 2020

Done.

@MrKevinWeiss
Copy link
Copy Markdown
Contributor

just FYI the app_metadata has this information among other things. Though I am fine with this as well if you don't want the other noise.

@MrKevinWeiss
Copy link
Copy Markdown
Contributor

make all -C test/shell

> app_metadata
{"cmd": "app_metadata_print_json()"}
{"data": {"APP_NAME": "tests_shell"}}
{"data": {"BOARD": "native"}}
{"data": {"CPU": "native"}}
{"data": {"APP_SHELL_FMT": "NONE"}}
{"data": {"MCU": "native"}}
{"data": {"OS_VERSION": "2020.04-devel-1105-g1b5f2"}}
{"result": "SUCCESS"}

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 11, 2020

I don't want to rely on an optional module, but rather have it be always compiled in most of the time automatically ;-).

@miri64 miri64 merged commit 086d0ac into RIOT-OS:master Mar 11, 2020
@miri64 miri64 deleted the shell_commands/enh/version branch March 11, 2020 17:36
@leandrolanzieri leandrolanzieri added the Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer label Mar 13, 2020
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer 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.

6 participants