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

Instead of an empty crate, give a compile error when not on Windows #949

Closed
wants to merge 4 commits into from

Conversation

jyn514
Copy link

@jyn514 jyn514 commented Oct 29, 2020

Previously, programs trying to use winapi on other targets would see
errors like this:

failed to resolve: could not find um in winapi
... many other related errors ...

Now, they'll see errors like this:

  --- stderr
  error: winapi is only supported on Windows platforms
  help: if your application is multi-platform, use `[target.'cfg(windows)'.dependencies] winapi = "..."`
  help: if your application is only supported on Windows, use `--target x86_64-pc-windows-gnu` or some other windows platform

This is a breaking change. The reason for this change is two-fold:

  1. For programs intending to use winapi, it gives them a much better
    error message telling them how to fix the error.
  2. For programs that don't need winapi, it forces them to remove it from
    dependencies, decreasing their compile times.

tim-weis and others added 4 commits July 13, 2020 16:19
Previously, programs trying to use winapi on other targets would see
errors like this:

```
failed to resolve: could not find um in winapi
... many other related errors ...
```

Now, they'll see errors like this:

```
  --- stderr
  error: winapi is only supported on Windows platforms
  help: if your application is multi-platform, use `[target.'cfg(windows)'.dependencies] winapi = "..."`
  help: if your application is only supported on Windows, use `--target x86_64-pc-windows-gnu` or some other windows platform
```

This is a breaking change. The reason for this change is two-fold:

1. For programs intending to use winapi, it gives them a much better
error message telling them how to fix the error.
2. For programs that don't need winapi, it forces them to remove it from
dependencies, decreasing their compile times.
@jyn514
Copy link
Author

jyn514 commented Nov 12, 2020

CI is failing because it's still building on linux even though I told it not to, I think because it's using the CI file from the 0.3 branch instead of my PR.

@MaulingMonkey
Copy link
Contributor

This would be a breaking change - I believe this should target the dev branch instead of the 0.3 branch?

@jyn514
Copy link
Author

jyn514 commented Feb 15, 2022

@retep998 what are your thoughts on this? I'm ok with closing it if you don't want it, but I do think it's a good change.

@jyn514 jyn514 closed this Mar 10, 2023
@jyn514 jyn514 deleted the require-windows branch March 10, 2023 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants