Skip to content

[Proposal] Simplify build profiles: debug and release only #3693

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

Merged
merged 1 commit into from
Feb 9, 2017

Conversation

bulislaw
Copy link
Member

@bulislaw bulislaw commented Feb 3, 2017

Description

I think our build profile story is a bit complicated and not clear. What's default profile? It doesn't mean much, requires checking documentation and leads to assumptions and issues. I think default build should be make in debug mode and as most environments/projects we should have clear release mode.

I've decided to remove default profile, make debug the default and rename small to release.

Let me know what do you think.

CC: @bridadan @theotherjimmy @0xc0170

@theotherjimmy
Copy link
Contributor

@AnotherButler More build_profile.md modifications here.

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

I like the way this is done, and I have no problem with removing the default profile. I agree that default has no meaning by itself.

@geky
Copy link
Contributor

geky commented Feb 3, 2017

+1 from me. Although this might push some examples over device limits in default build (now debug).

@bulislaw
Copy link
Member Author

bulislaw commented Feb 3, 2017

I have some more changes to build_profile.md in my pipeline (when #3566 hits master) and I'm aware about the external repo, so will merge it and submit PR agains it when it's all finished.

@bulislaw
Copy link
Member Author

bulislaw commented Feb 3, 2017

I'm assuming we are talking about nrf51? :) I'll test some of them on Monday.

@geky
Copy link
Contributor

geky commented Feb 3, 2017

More just a warning that this might be a very breaking change. Should probably be on a minor release.

@AnotherButler
Copy link
Contributor

I don't think y'all are working on the latest version of this document. It's here in the Handbook, here on GitHub.

@c1728p9
Copy link
Contributor

c1728p9 commented Feb 3, 2017

We probably want to run this by @sg- before merging if that hasn't been done already. Building as debug in the online compiler is going to make the code bigger and slower than it was before and without much benefit since it can't be used with a debugger.

@bridadan
Copy link
Contributor

bridadan commented Feb 3, 2017

I think this helps simplifies things quite a bit, thanks for bringing this up @bulislaw. Though like @geky said this may have some unintended consequence. We should probably run this by the Client team. I'll go ahead and mark this as do not merge for now until we've had time to investigate all the implications of this.

Looks like the Oulu CI found that it blows up the size of one of the mbed OS test apps already: https://jenkins-internal.mbed.com/job/ARMmbed/job/mbed-os-cliapp/job/master/2309/

@c1728p9 That's a really good point. How about we instead name the default profile to online or something. Then the online tools can be configured to use that profile instead? Then the default profile can be debug for offline tools.

@theotherjimmy
Copy link
Contributor

@bridadan That suggestion (online and debug) seems like a poor user experience. A user would be confused when something works by default online but does not fit in the device offline.

@bulislaw
Copy link
Member Author

bulislaw commented Feb 3, 2017

Right, seems that beetle can't handle cordio built with debug info.

@sg-
Copy link
Contributor

sg- commented Feb 3, 2017

I dont understand what is confusing. There is a default profile which equals backwards compatible profile. We have a debug profile and then there is a near unless small profile which you may want to use for release if memory constrained. What am I missing here?

What does the default profile not do that y'all would like it to do?

@pan-
Copy link
Member

pan- commented Feb 3, 2017

More just a warning that this might be a very breaking change. Should probably be on a minor release.

It might be a breaking change for big examples, code without optimization will definitely consume more flash. It might also be a breaking change for users with big applications and if ever they just use the online IDE then such change makes mbed and its ecosystem non usable anymore because they won't have the possibility to switch to the release profile.

Beside breaking changes, I wonder if increasing the size of binary generated by default is the right message to send. Here is the flash consumed by blinky when compiled by GCC on the K64F:

small default debug
17916 bytes 47159 bytes 57399 bytes

Increasing the size of such simple application to almost 60K is terrifying for someone without the background of what is generated.

@bridadan
Copy link
Contributor

bridadan commented Feb 3, 2017

Thanks for posting actual numbers, I didn't realize the impact would be that large

@ohagendorf
Copy link
Contributor

ohagendorf commented Feb 3, 2017 via email

@tommikas
Copy link
Contributor

tommikas commented Feb 6, 2017

Looks like the Oulu CI found that it blows up the size of one of the mbed OS test apps already

Yeah, some configurations don't build for all devices with debug enabled.

Switching CI to use a different profile isn't a problem of course, but as has been pointed out it's a breaking change for now. If you want to go forward with this, I can fix continuous-integration/jenkins/pr-head so it works with this PR and doesn't break on merge to master.

@bulislaw
Copy link
Member Author

bulislaw commented Feb 6, 2017

@pan- I would say having that simple application taking up almost 50k, not in obvious 'debug mode' is terrifying in the first place. I mean we know exactly why it's so big, but still seeing it from the user's point of view is bad, especially when they get it by default.

@sg- I think most of people are used to seeing debug/release, which is not only de facto standard, but also it's self explanatory. I know what to use without thinking about it and I know what to expect from the build. In our current situation with 'default' I don't really know what will i get without checking. Also I was thinking about features, that may be enabled/disabled basing on used profile and i actually got it wrong (and I'm sure 99% of people will do some sort assumption rather than check) I was assuming we use default for 'everyday' development, debug when something goes wrong and they actually need to debug, and people would use small for deployment. So it's not about default profile not doing something i need, it's about making it more verbose and predictable.

That being said, I wasn't expect such a fallout from boards/testing, but what do people think about at least renaming default profile? We treat it as release as it seems, so maybe we can call it 'release'.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 6, 2017

That being said, I wasn't expect such a fallout from boards/testing, but what do people think about at least renaming default profile? We treat it as release as it seems, so maybe we can call it 'release'.

It was always release for me, fine with me.

@pan-
Copy link
Member

pan- commented Feb 6, 2017

but what do people think about at least renaming default profile? We treat it as release as it seems, so maybe we can call it 'release'.

Given that a behavior like sleeping now depends on NDEBUG definition (see pr #3607) and the default profile doesn't define it because assertions have to be enabled; I believe default and small profiles are two different beasts with two very different behavior.

I was assuming we use default for 'everyday' development, debug when something goes wrong and they actually need to debug, and people would use small for deployment. So it's not about default profile not doing something i need, it's about making it more verbose and predictable.

I think you nailed it with a good terminology. There are three profiles: debug, development and release. Maybe renaming default into development and small into release would clear things up.

@bulislaw
Copy link
Member Author

bulislaw commented Feb 6, 2017

I agree debug, development and release are descriptive and sort of convey how they are intended to be used.

Also while we talk about the sleep, in this profile terminology, I would change it to work as a real sleep for both development and release (by disconnecting it from NDEBUG and introducing another flag, something like 'REAL_SLEEP' which could be defined for these profiles.

Rename small.json to release.json, default.json to develop.json and make
it the default profile.
@bulislaw bulislaw force-pushed the rework_build_profiles branch from 8225dd7 to 40d3b22 Compare February 7, 2017 11:42
@bulislaw
Copy link
Member Author

bulislaw commented Feb 7, 2017

Updated to reflect the conversation we had.

@bulislaw
Copy link
Member Author

bulislaw commented Feb 7, 2017

/morph test

@mbed-bot
Copy link

mbed-bot commented Feb 7, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1518

All builds and test passed!

@bridadan
Copy link
Contributor

bridadan commented Feb 9, 2017

@jupe the "small" profile has been renamed to "release". Will that affect any of your CIs?

@tommikas
Copy link
Contributor

@bridadan (Not Jussi, but...) I don't think so. We're currently using the default profile in CI builds. The name of the default changed but not the profile itself --> no effect.

@bridadan
Copy link
Contributor

Great thanks @tommikas (sorry should have tagged you 😄)

@tommikas
Copy link
Contributor

No worries. Jussi definitely could've answered the question too but he's currently on leave.

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

Successfully merging this pull request may close these issues.