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

Bump winapi dependency 0.2.1 -> 0.2.6 #832

Merged
merged 1 commit into from
Apr 25, 2018
Merged

Bump winapi dependency 0.2.1 -> 0.2.6 #832

merged 1 commit into from
Apr 25, 2018

Conversation

dimbleby
Copy link
Contributor

@dimbleby dimbleby commented Apr 7, 2018

winapi versions earlier than 0.2.7 don't successfully compile with the
nightly compiler.

Discovered via cargo update -Z minimal-versions

@carllerche
Copy link
Member

Could you clarify why they don’t compile? This seems like a very bad rustc bug

@dimbleby
Copy link
Contributor Author

dimbleby commented Apr 7, 2018

Lots of reasons, different in different releases:

2.4:

   Compiling winapi v0.2.4
error[E0391]: cyclic dependency detected
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\sapi.rs:1653:9
     |
1653 | /         SPGO_SRGS as i32 | SPGO_SRGS_MS_SCRIPT as i32 | SPGO_SRGS_W3C_SCRIPT as i32 |
1654 | |         SPGO_SRGS_STG_SCRIPT as i32,
     | |___________________________________^ cyclic reference
     |
note: the cycle begins when const-evaluating `sapi::SPGRAMMAROPTIONS::SPGO_SRGS_SCRIPT::{{initializer}}`...
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\sapi.rs:1653:9
     |
1653 | /         SPGO_SRGS as i32 | SPGO_SRGS_MS_SCRIPT as i32 | SPGO_SRGS_W3C_SCRIPT as i32 |
1654 | |         SPGO_SRGS_STG_SCRIPT as i32,
     | |___________________________________^
note: ...which then requires computing layout of `sapi::SPGRAMMAROPTIONS`...
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\sapi.rs:1653:9
     |
1653 |         SPGO_SRGS as i32 | SPGO_SRGS_MS_SCRIPT as i32 | SPGO_SRGS_W3C_SCRIPT as i32 |
     |         ^^^^^^^^^
     = note: ...which then again requires const-evaluating `sapi::SPGRAMMAROPTIONS::SPGO_SRGS_SCRIPT::{{initializer}}`, completing the cycle.

error: aborting due to previous error

For more information about this error, try `rustc --explain E0391`.
error: Could not compile `winapi`.

To learn more, run the command again with --verbose.

2.5:

error[E0592]: duplicate definitions with name `item`
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\macros.rs:148:13
     |
148  |                pub unsafe fn $variant(&self) -> &$fieldtype {
     |   _____________-
     |  |_____________|
     | ||
149  | ||                 ::std::mem::transmute(&self.$field)
150  | ||             }
     | ||             -
     | ||_____________|
     | |______________duplicate definitions for `item`
     |                other definition for `item`
     |
    ::: C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\commctrl.rs:2496:1
     |
2496 |    UNION!(TVINSERTSTRUCTA, itemex, item, item_mut, TV_ITEMA);
     |    ---------------------------------------------------------- in this macro invocation

error[E0592]: duplicate definitions with name `item_mut`
    --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\macros.rs:152:13
     |
152  |                pub unsafe fn $variantmut(&mut self) -> &mut $fieldtype {
     |   _____________-
     |  |_____________|
     | ||
153  | ||                 ::std::mem::transmute(&mut self.$field)
154  | ||             }
     | ||             -
     | ||_____________|
     | |______________duplicate definitions for `item_mut`
     |                other definition for `item_mut`
     |
    ::: C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.5\src\commctrl.rs:2496:1
     |
2496 |    UNION!(TVINSERTSTRUCTA, itemex, item, item_mut, TV_ITEMA);
     |    ---------------------------------------------------------- in this macro invocation

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0592`.

2.6:

   Compiling winapi v0.2.6
error[E0080]: constant evaluation error
   --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.6\src\commctrl.rs:162:31
    |
162 | pub const BCN_FIRST: ::UINT = 0 - 1250;
    |                               ^^^^^^^^ attempt to subtract with overflow

error[E0080]: constant evaluation error
   --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.6\src\commctrl.rs:130:31
    |
130 | pub const HDN_FIRST: ::UINT = 0 - 300;
    |                               ^^^^^^^ attempt to subtract with overflow

error[E0080]: constant evaluation error
   --> C:\Users\dch\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.6\src\commctrl.rs:140:31
    |
140 | pub const TBN_FIRST: ::UINT = 0 - 700;
    |                               ^^^^^^^ attempt to subtract with overflow

... etc.

@carllerche
Copy link
Member

@dimbleby

Could you open an issue on the rust repo pointing this out. This seems like a regression.

@dimbleby
Copy link
Contributor Author

dimbleby commented Apr 9, 2018

Current state of that other issue is that:

  • winapi 0.2.5 (and 0.2.4) was broken by compiler changes fully two years ago
  • they're still thinking about whether to allow the 0.2.6 breakages to progress to the stable compiler

So certainly the lower bound for a winapi dependency wants to be bumped at least to 0.2.6, it's not yet clear whether it's really necessary to go to 0.2.7.

winapi versions earlier than 0.2.6 don't successfully compile

Discovered via `cargo update -Z minimal-versions`
@dimbleby
Copy link
Contributor Author

Looks like they're going to fix the recent breakages, so I've updated this pull request to specify winapi 0.2.6.

As above, versions prior to that have been failing to compile on stable for two years now - so it makes no sense to rely on them.

@dimbleby dimbleby changed the title Bump winapi dependency 0.2.1 -> 0.2.7 Bump winapi dependency 0.2.1 -> 0.2.6 Apr 20, 2018
@carllerche carllerche merged commit a4f3f0d into tokio-rs:master Apr 25, 2018
@dimbleby dimbleby deleted the minimal-versions branch April 25, 2018 16:08
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.

None yet

2 participants