Skip to content
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

Build number should be set/updated automatically in Bootstrap.ino sketch #214

Open
jingman opened this issue Nov 17, 2014 · 5 comments
Open
Assignees

Comments

@jingman
Copy link
Collaborator

jingman commented Nov 17, 2014

Would be great to have this as part of the build script. Should we set all of the variables (sketch name and sketch revision) or just the build?

@matthijskooijman
Copy link
Collaborator

Huh? build.sh sets the revision and build number in version.h already, right? What build number are you talking about exactly?

@jingman
Copy link
Collaborator Author

jingman commented Dec 2, 2014

I was thinking that I'd like to set one of the values in the version.h example sketch to reflect the latest build number. I want people to be able to flash their Scouts using the Arduino IDE, but still have HQ tell them about future updates. In order to do that, I need to know the build.

@matthijskooijman
Copy link
Collaborator

Right. The problem is that from the IDE, we can't tell the difference between using an exact, unmodified, Bootstrap version and a heavily customized version (we can't run any custom preprocessing commands from the IDE, like we do with build.sh).

The current approach is conservative - only use the build number when you're certain that a build is compiled from exactly that (unmodified) version. This is a good idea from a support perspective - if someone pastes his version info, you can see right away that they might have been messing with the code.

Setting an explicit version number, hardcoded in version.h when commiting a tag is tricky. For one, build numbers are now only tagged in firmware-pinoccio, but version.h would be in library-pinoccio. Also, even if we'd just add the version number in one commit (and remove it immediately in the next commit), there's still a fair chance that someone compiles a version but forgot to update some libraries, so the version number from library-pinoccio says his bootstrap is up-to-date, but the gainspan library might still be out-of-date, leading to hard-to-debug problems.

Still, if we'd just set SKETCH_BUILD to the build number and then leave SKETCH_REVISION to unknown, that could be sufficient indication of not running an "official" version (verified against the git tag).

We might also need to change SKETCH_NAME to "Bootstrap" in the default version.h then. I didn't do this initially, since people will be copying the Boostrap.ino for a custom sketch, but then not realize they need to change the name.

@jingman
Copy link
Collaborator Author

jingman commented Dec 4, 2014

Still, if we'd just set SKETCH_BUILD to the build number and then leave SKETCH_REVISION to unknown, that could be sufficient indication of not running an "official" version (verified against the git tag).

I think this is perfect.

@jingman
Copy link
Collaborator Author

jingman commented Dec 4, 2014

Also, great thoughts on the other difficult aspects of setting these values - lots of stuff I hadn't thought about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants