-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend node.info #2830
Extend node.info #2830
Conversation
OK messed it up. Sorry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if a build tool (cloud builder, Docker) could add its vanity token into the build info. Actual tokens would include something along the lines of "built by my super build tool".
Forgot to mention that the environment variable USER_PROLOG can be set to add a vanity token. |
|
Build is broken. Will have a lock. |
Yup, I left a comment but that one got somehow lost: |
Also deliberately broke replacement of NODE_VERSION by the docker script by inserting a space after the # in that line. |
That is caused by an old Git version. My Mac: git version 2.20.1 (Apple Git-117) The |
So what do we do about the DTS and old git version. |
I started with the image update over at marcelstoer/docker-nodemcu-build#69. Feel free to work with this. ESP8266 seems fine but ESP32 still fails. Not sure when I can work on that next time. |
Sorry to chime in late, but the list of returns seems like it's... lengthy. Would it make sense to group some or all of them into (a) table(s)? |
To have a consistent interface I would not like to touch the existing interface. I can think of these ways to go:
So I tend to use 1. or 4. unless a breaking change would be OK. Then 3. clearly would be best. |
I think 3 violates the standards we try to hold ourselves to, of giving a deprecation warning and all that. How about this:
Whether those results should be direct results or entries in a table, I leave to you. Given such a "topic"-ized form of |
Just now read your comment. |
@TerryE Terry would you please care to have a close look at the last commit here? Would like to know if the c part is ok like that. |
@nwf I like your proposal, makes a lot of sense to me. How about support for |
Cutting across a number of PRs and issues is this whole discussion of best practice for writing NodeMCU libraries, e.g. Jonhy and I were discussing the whole issue of Lua stack balancing for CBs and we've talked about other helper wrappers around the luaL_ref / unref stuff. I think that we should take this as a separate standalone issue. |
551bf5c
to
5393e37
Compare
NOTE: DTS calculation requires git version 2. something. Currently the docker image has Version 1.9. |
You know, I hate to do this to you again (thank you for the rewrite after my last suggestion), but... thinking about your @TerryE, is such a thing reasonable from the Lua side? |
I didn't like all those char* and creating Lua objects all the time. |
Nathaniel, I suggest that we are pragmatic here. Returning the array keeps the implementation simple. In practice the caller will cherry pick the fields that are wanted then ditch the array. |
@@ -6,6 +6,7 @@ local/ | |||
user_config.h | |||
server-ca.crt | |||
luac.cross | |||
luac.cross.int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might belong in a separate PR, but I'm not going to complain too much.
Fair enough. In that case, I think I am happy with the topic-ized version of |
0788080
to
0ff3084
Compare
I'm really happy how this turned out. Very nice improvement Gregor. Thanks! |
This seems to be the last PR open for the next release milestone. Is there anything left blocking this landing? |
Not that I know of. |
#ifndef BUILD_DATE | ||
#define BUILD_DATE "YYYYMMDD" | ||
#define BUILD_DATE "unspecified" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I only now realized that update_buildinfo.sh
doesn't set the build date. Did you omit this on purpose? Wouldn't it be useful to have BUILD_DATE="$(date "+%Y-%m-%d %H:%M")"
in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HHHartmann However, we'd have to invert that order of precedence.
If we do
BUILD_DATE="$(date "+%Y-%m-%d %H:%M")"
#define BUILD_DATE "$BUILD_DATE"
in the script the #ifndef BUILD_DATE
would guarantee that any date the user sets explicitly is overwritten. It should be the other way around.
We could set BUILDINFO_BUILD_DATE and then be able to get it right in user_version.h |
Yep, that sounds like a good plan. |
excuse me. Please advise what is wrong. On version 2.0, work code |
@johndoe71rus Please don't perform necromancy of PRs as a support channel. That said... The code you have quoted here (which calls To be a little more precise about what seems to be ailing you, tho': if you look at your paste's printout, you will see that your |
before this changes i could collect sw and hw info, use wrote code above. |
This is not a suitable forum for the kind of support you are requesting. Please see https://nodemcu.readthedocs.io/en/master/support/ . |
Fixes #2799 #2398 #1739
dev
branch rather than formaster
.docs/*
.There are different variations of the firmware resulting from different modules, branches, SSL, int/float, LFS and release.
To better identify these firmware builds these information are made available in node.info() and in the startup message.
Currently I am having a problem with generating the commit DTS. It does not work for the docker image and I can't check it under other linux.
Works on my Win10 though:
git show -s --format=%cd --date=format:"%Y%m%d%H%M" HEAD
generates201907121923
which corresponds to the localtime of the commit which was at Fri Jul 12 19:23:02 2019 +0200.On docker the --date format is not recognized. In fact no format seems to be known at all there.
But even on win10 it should be UTC and not localtime to give an order.
So any help/suggestions welcome here.
Still needs the documentation but is short it adds the following defines to node.info()
BUILDINFO_BRANCH, BUILDINFO_COMMIT_ID, BUILDINFO_RELEASE, BUILDINFO_RELEASE_DTS, BUILDINFO_SSL, BUILDINFO_LFS, BUILDINFO_MODULES, BUILDINFO_BUILD_TYPE.
It also adds a string similar to that generated by docker (from which I took most of the code to generate the defines) to the welcome message.
Any comments welcome!