Skip to content

runners: restore obsolete synonyms for -i/--dev-id #53951

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

Conversation

mbolivar-nordic
Copy link
Contributor

@mbolivar-nordic mbolivar-nordic commented Jan 20, 2023

This is a partial revert of commit 2cee5ff
("scripts: west_commands: runners: remove deprecated options").

I remarked at the time that the removal of the older way of writing things from the runners themselves seemed gratuitous since they are easy to continue to support indefinitely and people may have been used to the old way of doing things. It didn't seem worth the fight to push for a revert at the time, though.

Since then I've run into real problems that their removal has caused in the wild and I am convinced that this part of that patch was wrong.

Restore the original, undeprecated forms of these options, but make it clear in the command line help that they're just obsolete alternative spellings at this point.

Fixes: #54384

This is a partial revert of commit
2cee5ff
("scripts: west_commands: runners: remove deprecated options").

I remarked at the time that the removal of the older way of writing
things from the runners themselves seemed gratuitous since they are
easy to continue to support indefinitely and people may have been used
to the old way of doing things. It didn't seem worth the fight to push
for a revert at the time, though.

Since then I've run into real problems that their removal has caused
in the wild and I am convinced that this part of that patch was wrong.

Restore the original, undeprecated forms of these options, but make it
clear in the command line help that they're just obsolete alternative
spellings at this point.

Signed-off-by: Marti Bolivar <[email protected]>
Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

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

snr option was deprecated long time ago, what is the point of adding obsolete features?

Edit: I think that if bringing the option one release more helps, it makes sense reverting, but not keep forever. I think we've been fairly consistent with deprecations, and I see no reason for an exception here. There are many other trivial deprecations that have been removed in time. Also, let's be transparent on this case: deprecation support was implemented relying on deprecated options being present. So, the problem would have popped up anyway, unless kept forever. However, since problem has been already fixed, and no SDK released with this problem, I see no value on bringing this back.

@nordicjm
Copy link
Collaborator

My view on deprecation: this doesn't fall into the zephyr defined deprecation system really, that's written about and for code, e.g. let's use tinycbor - it has been replaced with a new module, the in-tree code that used it has been replaced with the new module, so why keep a whole module still around that is unmaintained? Hence why it was deprecated and removed. However in the case of a command line argument for a flash runner, it's 1 line in a python file, it's not something that has to ever be maintained since it's already working and if something needs to be updated, it would be for the underlying common code itself used by both old and new commands, and it's not a piece of code that people pull in to use in their applications, it's supporting code in a zephyr script. So for me (at least), keeping an old and new command in a script is not anywhere near the level of removing deprecated code that can be used in an application that has the potential to cause big problems if people carry on using it where it has issues or security vulnerabilities - because those would be going into built applications.

@gmarull
Copy link
Member

gmarull commented Jan 20, 2023

Note: opened this as an alternative nrfconnect/sdk-zephyr#1032

@gmarull
Copy link
Member

gmarull commented Jan 20, 2023

@mbolivar-nordic
Copy link
Contributor Author

@gmarull we are not going to come to an agreement about this and I am using my right as maintainer of the runners to set the direction of the area. I am choosing to keep old options around for compatibility as long as they are not a big maintenance burden, which this clearly is not.

Please remove your -1. I don't need you to approve, but don't stand in the way.

@gmarull
Copy link
Member

gmarull commented Jan 23, 2023

@gmarull we are not going to come to an agreement about this and I am using my right as maintainer of the runners to set the direction of the area. I am choosing to keep old options around for compatibility as long as they are not a big maintenance burden, which this clearly is not.

I won't block as soon as patch is reverted properly, ie, mark --snr option as deprecated. However, it's not clear to me why this is added back, Nordic doesn't need this option anymore, as the problem (not fault of this removal) has been fixed.

Please remove your -1. I don't need you to approve, but don't stand in the way.

I'd like to remember that maintainers do not have the final word in Zephyr. I've personally been blocked in stuff I maintain (had to escalate it), or blocked by a minority. I won't contribute to this nonsense though.

@mbolivar-nordic
Copy link
Contributor Author

I won't block as soon as patch is reverted properly, ie, mark --snr option as deprecated.

It's not marked deprecated on purpose; the point is to make it clear that it's obsolete, but not deprecated.

However, it's not clear to me why this is added back, Nordic doesn't need this option anymore, as the problem (not fault of this removal) has been fixed.

You can see in the diff itself that the patch is not just about what happened to our SDK. Just because we found out about this issue from our SDK downstream users doesn't mean other people are not affected by this. I am restoring the old functionality so that the people we didn't hear from won't be affected either.

@gmarull
Copy link
Member

gmarull commented Jan 26, 2023

I won't block as soon as patch is reverted properly, ie, mark --snr option as deprecated.

It's not marked deprecated on purpose; the point is to make it clear that it's obsolete, but not deprecated.

So then my -1 stands, please escalate if you think I'm wrong. Adding obsolete options without any deprecation notice is a bad practice IMO. More considering this option was already deprecated. Imagine people copy a command from an outdated guide. They'll never notice about that option being obsolete until one day it is removed and breaks their workflows. With a deprecation message they'll at least notice.

However, it's not clear to me why this is added back, Nordic doesn't need this option anymore, as the problem (not fault of this removal) has been fixed.

You can see in the diff itself that the patch is not just about what happened to our SDK. Just because we found out about this issue from our SDK downstream users doesn't mean other people are not affected by this. I am restoring the old functionality so that the people we didn't hear from won't be affected either.

I'm pretty sure impact has been low/zero. And the SDK issue was in the end not our fault, they did their job on using --dev-id but deprecation detection code was wrong.

@mbolivar-nordic mbolivar-nordic added the dev-review To be discussed in dev-review meeting label Jan 30, 2023
@mbolivar-nordic
Copy link
Contributor Author

So then my -1 stands, please escalate if you think I'm wrong.

I really wish you would get out of the way

@mbolivar-nordic mbolivar-nordic added the TSC Topics that need TSC discussion label Jan 30, 2023
@mbolivar-nordic mbolivar-nordic added this to the v3.3.0 milestone Jan 30, 2023
@mbolivar-nordic mbolivar-nordic removed the TSC Topics that need TSC discussion label Jan 30, 2023
Copy link
Collaborator

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

I see no issues in allowing a synonym for --dev-id if it makes life easier for lot of users.

One comment though, as I didn't read all existing code.

What happens if a user specifies both --dev-id and --snr on same invocation ?
Clearly a user shouldn't do so, but I'm curious how code will behave, as I don't see the two arguments being mutual exclusive when just looking at this PR.

@gmarull gmarull dismissed their stale review January 31, 2023 10:34

Giving up, can't be part of reviews where PR author asks me "to get out of the way". For other reviewers, this is what I proposed nrfconnect/sdk-zephyr#1032 (ie, restore what we had before)

@gmarull
Copy link
Member

gmarull commented Jan 31, 2023

I see no issues in allowing a synonym for --dev-id if it makes life easier for lot of users.

Note that --snr should not be used, it is an obsolete option. It was deprecated ~1y ago in favor of using --dev-id. Ref #37509

@mbolivar-nordic
Copy link
Contributor Author

mbolivar-nordic commented Jan 31, 2023 via email

Copy link
Member

@stephanosio stephanosio left a comment

Choose a reason for hiding this comment

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

I think it is sensible to keep supporting the old option as long as the maintenance burden of doing so is minimal.

A deprecation/obsolescence warning would still help users move on to using the new option in case we ever decide to drop the support for it at some point in the future (which, otherwise, we will likely have to do yet another "deprecation" with a warning before finally dropping it for good).

@mbolivar-nordic
Copy link
Contributor Author

mbolivar-nordic commented Feb 1, 2023 via email

@nashif nashif removed the dev-review To be discussed in dev-review meeting label Feb 2, 2023
@mbolivar-nordic mbolivar-nordic added the bug The issue is a bug, or the PR is fixing a bug label Feb 2, 2023
@mbolivar-nordic mbolivar-nordic merged commit a2f203d into zephyrproject-rtos:main Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: West West utility bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removal of old runner options caused downstream breakage
7 participants