feat: make is_terminal replaceble with std implementation#160
feat: make is_terminal replaceble with std implementation#160JarvisCraft wants to merge 2 commits intophsym:masterfrom
is_terminal replaceble with std implementation#160Conversation
|
In worst case if done as non-additive these are prone to cause miscompilation and maintenance is a headache. Majority of big downstream are transient libraries and not top-level binaries leaving problematic feature-chain via tree. The correct way would be to use Can see relevant discussion here: There we had a problem where these features were ~never used or in worst case it led to compilation errors and dependency chain generally never adopted chaining them across to top-level binary. Also this would still raise MSRV (no default features) and making something like this on-by-default is not going to work with downstream - features weren't really designed to be used to "negate" compilation either. However the impact of having the dependency is minor and I do not see a reason to add additional complexity temporarily. The other PR can stay as csv bump but this can switch to isTerminal given when we are open to move up MSRV. |
|
Apologies for the late reply, I've initially read the message but did not respond at the time
This is the exact reason why this specific PR implements this via an enabled-by-default "legacy" (
That's true.
That's a nice Idea! I will try to re-implement this PR using it, thanks for the reference.
Are there any plans or schedule for the MSRV bump? Not trying to be insitent here, but just planning on when to come with a PR using this ability to get rid of legacy :) |
549bec1 to
27be74d
Compare
Description
This adds an opt-out
legacy-is-terminalfeature whose absence enables the use ofstd'sIsTerminalinstead ofis-termminal's.This way users of Rust 1.70+ will be able to remove
is-terminal's dependency tree from their dependencies while not breaking.The only potential breakage is for users who both:
Which seems to be very rare (if observable at all).
This is to follow @pinkforest's suggestion that MSRV bump to 1.70 cannot be done for now.
Alternatives
Considering that (any) change requires a version bump anyway, I would prefer the feature to be opt-out (i.e. use
stdby default and only fall back tois-terminalif explicitly required by a non-default feature) which would be more logical and more supportive towards those who use newer Rust versions.