Opened 4 years ago
Last modified 4 years ago
#60844 new enhancement
Make the reinplace warning an error
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | base | Version: | |
Keywords: | Cc: | kurthindenburg (Kurt Hindenburg) | |
Port: |
Description
Currently, reinplace will print a warning ("reinplace didn't change anything in ...") if nothing got replaced. I would like to change this to an error. This will ensure that developers can't forget to change a reinplace that needs to be adjusted when updating a port.
It had been my hope that developers would take note of the reinplace warnings and make the necessary changes to their ports, but in many cases this has not happened. There are many open tickets about reinplaces that do nothing that have been open for years, some more than 10 years, any many more such issues that have gone unreported. Changing the warning to an error will prevent those ports from installing. That may be a good thing as it will finally force maintainers to do what they were warned years ago to do.
Change History (5)
comment:1 follow-up: 2 Changed 4 years ago by kurthindenburg (Kurt Hindenburg)
Cc: | kurthindenburg added |
---|
comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to kurthindenburg:
A rough count is 5k instances;
What are you counting?
I think it would cause havoc on the port builds.
It will certainly cause many ports to be unable to be installed until someone fixes the problems.
Do you have an alternate suggestion for how we can get developers to fix these problems?
comment:3 follow-up: 4 Changed 4 years ago by kurthindenburg (Kurt Hindenburg)
The count is a simple grep of all Portfiles. I wonder if adding another flag which would change the error to a warning again. The maintainers would have to research that the reinplace can't be fixed easily or for all XYX (macOS versions, compilers, etc) and then use the new flag.
comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to kurthindenburg:
The count is a simple grep of all Portfiles.
So you're counting how many instances of reinplace
there are in Portfiles? The vast majority of those are hopefully working just fine. The warning is only printed for reinplaces that don't change anything.
I wonder if adding another flag which would change the error to a warning again. The maintainers would have to research that the reinplace can't be fixed easily or for all XYX (macOS versions, compilers, etc) and then use the new flag.
Prior to adding the existing warning, we already added a flag -q
to quiet the warning, for exactly that purpose. Primarily this is intended to be used for batch reinplaces, for example when you need to replace a string in a very large number of files, and do so using fs-traverse or glob, but not all of the files matched contain the string to be replaced, and that is known and understood by the portfile developer and they wish to suppress the warning and take responsibility for ensuring it continues to work in the future.
A rough count is 5k instances; the base code change is trivial but I think it would cause havoc on the port builds.