Skip to content
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

replace libterm with termcolor in libtest #63725

Open
wants to merge 1 commit into
base: master
from

Conversation

@euclio
Copy link
Contributor

commented Aug 20, 2019

This commit also completely removes libterm from the tree.

Fixes #60349.
Fixes #45728.

replace libterm with termcolor in libtest
This commit also completely removes libterm from the tree.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 20, 2019

r? @rkruppe

(rust_highfive has picked a reviewer for you, use r? to override)

@ehuss

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2019

I'm concerned about bumping the termcolor version. There is a bug between termcolor and the fwdansi crate that causes colors to go horribly wrong in cargo on windows 7 and 8. I think it would be good to get kennytm/fwdansi#1 fixed before bumping termcolor.

Colors are currently broken, but they just don't display. If termcolor is updated, then the colors don't reset and it looks awful. See #55769

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

In addition to @ehuss's concern the build process for libtest is changing in #63637 which will conflict with this PR unfortunately. There's a few issues with that which are:

  • The manifest of termcolor and its dependencies will need the rustc-dep-of-std treatment (before they didn't, but after that PR they will)
  • We've never gotten around to getting winapi building as part of libstd or for libtest, so termcolor's transitive dependency will be difficult to manage. We've basically just never tried this, but it's likely to be thorny for at least one reason or another.
@crlf0710

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

I coincidentally have a fork of termcolor that had got rid of the winapi dependency at https://github.com/crlf0710/termcolor , if anyone found it useful, feel free to cherry pick that commit away. I had named the feature "rustc-dep-of-test" but people might want to change it.

Also, i'm very grateful to #63637, i tried to do this change before in #62829 but it was so difficult to get it right.
@alexcrichton @euclio

@euclio

This comment has been minimized.

Copy link
Contributor Author

commented Aug 21, 2019

Nice, we can certainly try that. Though I'm curious what issues people foresee with trying to get winapi to build in-tree. It might be nice in the long term for libstd to start depending on it anyways.

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2019

☔️ The latest upstream changes (presumably #63637) made this pull request unmergeable. Please resolve the merge conflicts.

@crlf0710

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2019

@euclio need a rebase

@retep998

This comment has been minimized.

Copy link
Member

commented Aug 24, 2019

I would be happy to help with getting winapi building as part of libstd/libtest if that would make things easier.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Aug 26, 2019

As mentioned by @crlf0710 now that #63637 has landed this will require both a rebase and a more substantial update. I would personally still love to see src/libterm deleted and would love to transition over to termcolor, so if any guidance is needed please let me know!

@retep998 I'd personally also love to delete src/libstd/sys/windows/c.rs and rely on upstream winapi definitions instead. I don't recall exact sets of issues but I think the only possible blocker would be the custom import libraries of winapi. I suspect though you've thought about the issue before, and if we can solve that then I think depending on winapi can happen at any time with just a PR!

@retep998

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

Is the issue with linking to the custom import libraries, or depending on the import library crates at all? For the former rustbuild already sets an environment variable to not do so, but for the latter there would need to be a way to opt out perhaps via a default cargo feature.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

I'm just hypothesizing I don't actually know if there are any issues. The best way to find out is to actually make the change and see what happens or what goes wrong.

@euclio

This comment has been minimized.

Copy link
Contributor Author

commented Sep 7, 2019

I started by trying to add a rustc-dep-of-std feature to winapi, but cargo complains because winapi already has a feature named std. Is there a way to work around this?

@crlf0710

This comment has been minimized.

Copy link
Contributor

commented Sep 7, 2019

@alexcrichton Sorry, i just checked and it seems rustc-std-workspace-std on crates.io is totally blank (I think i made a mistake when uploading). Could you add the necessary pub use std::*; and publish a new dot version?
After that @euclio can use the optional dependency to replace the feature (just remove the std = [] line, i think.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

Sure, I've published a version with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.