-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Don't compile ansi_term on Windows #1155
Comments
Alternatively, migrate to |
@SergioBenitez Your crate only supports ANSI escape sequences, which won't work in Windows consoles that don't have ANSI support. (Your API is also appears fundamentally incompatible with how Windows console coloring works.) |
@BurntSushi Yes, I'm quite aware of that; it's even part of the crate's name! This issue is about moving away from |
@SergioBenitez Let me rephrase: It would be great to move to a library that supports Windows console coloring. |
@Aaronepower However, this color re-write will be implemented in v3 (which actively being worked again after a stagnant period) and can be tracked via the overall v3 tracking issue #1037 I've implemented a feature freeze for v2 so I can actually get v3 out the door. So it shouldn't be long before v3-alpha1 is out. I'm going to close this so comments can be consolidated in one place. I appreciate the suggestions @SergioBenitez and if |
@kbknapp It's still compiled on Windows which is the real problem. |
@Aaronepower Ah, I see my mistake. I'll re-open this issue as "Don't compile |
I'd be willing to merge a PR for 2.29.3 that fixes this. |
Turns out this is harder than I had first thought: rust-lang/cargo#1197 |
For those compiling only to windows, not using the
I'm going to close this for now, and re-address once cargo supports per-target deps. I'll also keep this in mind during the great color redux in v3. |
You mean like |
@retep998 I meant them somewhat interchangeably. The issue being the What I'd like to happen is per-target features (so that on everything but Windows the If this is already possible, I may have misunderstood the state of things. |
While features themselves cannot be target specific, dependencies can, even if they are optional. You can enable the feature from any target, but the dependency will only be compiled for the targets it specifies. |
TIL...just tested it and it works! Wow 🎉 Thanks for the explanation @retep998 👍 I'll re-open this and put in the PR. |
Before this commit, ansi_term was compiled anytime the `color` feature was used. However, on Windows the `color` feature is ignored. Even so ansi_term was compiled, and just not used. This commit fixes that by only compiling ansi_term on non-Windows targets. Thanks to @retep998 for the gudiance. Closes #1155
Before this commit, ansi_term was compiled anytime the `color` feature was used. However, on Windows the `color` feature is ignored. Even so ansi_term was compiled, and just not used. This commit fixes that by only compiling ansi_term on non-Windows targets. Thanks to @retep998 for the gudiance. Closes #1155
The [clap](https://crates.io/crates/clap) crate used for argument parsing uses the `ansi_term` crate for colorized output, but colorized output is disabled for Windows. However, `ansi_term` is still compiled and used on Windows unless the build is configured to disable the "color" feature as discussed here: clap-rs/clap#1155 (comment) The manifest is updated to disable the color feature following these instructions: https://github.com/kbknapp/clap-rs#optional-dependencies--features
ansi_term
currently doesn't work on 32bit Windows platforms and is not being maintained.clap
being dependent by so many crates(mine included) needs to resolve this since there is no maintainer foransi_term
. There are two solutions I can think of.clap
maintains a forked version ofansi_term
.clap
pulls required functionality of ouransi_term
and into it's own module in tree.The text was updated successfully, but these errors were encountered: