oxidecomputer / amd-apcb

AMD Generic Encapsulated Software Architecture Platform Security Processor Configuration Block manipulation library
Mozilla Public License 2.0
13 stars 1 forks source link

amd-apcb requires things not present in rust 1.60 but has no toolchain file #41

Closed wesolows closed 2 years ago

wesolows commented 2 years ago

A fresh checkout of main does not build with stable rustc 1.60; presumably this needs newer and/or unstable features but there is no toolchain file to bring them in:

$ make
cargo build
   Compiling amd-apcb v0.1.0 (/home/wesolows/src/amd-apcb)
error: method calls are not supported by `pre` on the stable compiler
   --> src/apcb.rs:728:9
    |
728 | /         entries.insert_entry(
729 | |             entry_id,
730 | |             instance_id,
731 | |             board_instance_mask,
...   |
736 | |             priority_mask,
737 | |         ) {
    | |_________^

error: method calls are not supported by `pre` on the stable compiler
    --> src/apcb.rs:995:9
     |
995  | /         group.insert_token(
996  | |             entry_id,
997  | |             instance_id,
998  | |             board_instance_mask,
999  | |             token_id,
1000 | |             token_value,
1001 | |         ) {
     | |_________^

error: method calls are not supported by `pre` on the stable compiler
   --> src/entry.rs:317:17
    |
317 |                 a.insert_token(token_id, token_value)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: preconditions are not supported for methods on the stable compiler
   --> src/entry.rs:298:6
    |
298 |       #[pre(
    |  ______^
299 | |         "Caller already increased the entry size by `size_of::<TOKEN_ENTRY>()`"
300 | |     )]
    | |______^

error: preconditions are not supported for methods on the stable compiler
   --> src/group.rs:421:11
    |
421 |     #[pre("Caller already grew the group by `payload_size + size_of::<ENTRY_HEADER>()`")]
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: preconditions are not supported for methods on the stable compiler
   --> src/group.rs:606:11
    |
606 | ...re("If `size_diff > 0`, caller needs to have expanded the group by `size_diff` already.  If `size_diff < 0`, caller needs to call `resize_entry_by` BEFORE resizing the group....
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: method calls are not supported by `pre` on the stable compiler
   --> src/group.rs:687:25
    |
687 |           let mut entry = self.resize_entry_by(
    |  _________________________^
688 | |             entry_id,
689 | |             instance_id,
690 | |             board_instance_mask,
691 | |             token_size as i64,
692 | |         )?;
    | |_________^

error: method calls are not supported by `pre` on the stable compiler
   --> src/group.rs:701:9
    |
701 |         entry.insert_token(token_id, token_value)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: preconditions are not supported for methods on the stable compiler
   --> src/group.rs:670:11
    |
670 |     #[pre("Caller already grew the group by `size_of::<TOKEN_ENTRY>()`")]
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: method calls are not supported by `pre` on the stable compiler
   --> src/group.rs:731:9
    |
731 | /         self.resize_entry_by(
732 | |             entry_id,
733 | |             instance_id,
734 | |             board_instance_mask,
735 | |             token_size_diff,
736 | |         )?;
    | |_________^

error: preconditions are not supported for methods on the stable compiler
   --> src/tokens_entry.rs:182:6
    |
182 |       #[pre(
    |  ______^
183 | |         "Caller already increased the entry size by `size_of::<TOKEN_ENTRY>()`"
184 | |     )]
    | |______^

error: method calls are not supported by `pre` on the stable compiler
   --> src/tokens_entry.rs:608:9
    |
608 |         iter.insert_token(token_id, token_value)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: preconditions are not supported for methods on the stable compiler
   --> src/tokens_entry.rs:591:6
    |
591 |       #[pre(
    |  ______^
592 | |         "Caller already increased the entry size by `size_of::<TOKEN_ENTRY>()`"
593 | |     )]
    | |______^

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1339:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1339 |         pub instance_0: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1340:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1340 |         pub instance_1: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1341:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1341 |         pub instance_2: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1342:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1342 |         pub instance_3: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1343:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1343 |         pub instance_4: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1344:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1344 |         pub instance_5: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1345:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1345 |         pub instance_6: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1346:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1346 |         pub instance_7: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1347:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1347 |         pub instance_8: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1348:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1348 |         pub instance_9: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1349:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1349 |         pub instance_10: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1350:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1350 |         pub instance_11: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1351:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1351 |         pub instance_12: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1352:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1352 |         pub instance_13: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1353:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1353 |         pub instance_14: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:1354:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
1354 |         pub instance_15: bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:3767:13
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
3767 |             pub peak_count || u8 : B5 | pub get u8 : pub set u8,
     |             ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:3770:13
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
3770 |             pub repeat_count || u8 : B4 | pub get u8 : pub set u8,
     |             ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:3771:13
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
3771 |             pub _reserved_1 || SerdeHex32 : B20,
     |             ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7307:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7307 |         pub s0_gpp0_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7308:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7308 |         pub s0_gpp1_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7309:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7309 |         pub s0_gpp4_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7310:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7310 |         pub s0_gpp2_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7311:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7311 |         pub s0_gpp3_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7312:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7312 |         pub _reserved_1 || SerdeHex8 : B3,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7314:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7314 |         pub s1_gpp0_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7315:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7315 |         pub s1_gpp1_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7316:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7316 |         pub s1_gpp4_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7317:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7317 |         pub s1_gpp2_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7318:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7318 |         pub s1_gpp3_off : bool | pub get bool : pub set bool,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0424]: expected value, found module `self`
    --> src/ondisk.rs:7319:9
     |
1177 |     $(#[$struct_meta])*
     |       - this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
...
7319 |         pub _reserved_2 || SerdeHex8 : B3,
     |         ^^^ `self` value is a keyword only available in methods with a `self` parameter

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/lib.rs:6:1
  |
6 | #![feature(generic_associated_types)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0424, E0554.
For more information about an error, try `rustc --explain E0424`.
error: could not compile `amd-apcb` due to 45 previous errors
make: *** [Makefile:6: all] Error 101
daym commented 2 years ago

The real driver for us to require nightly in this was generic_associated_types. That one cannot be avoided if we want JSON config serializer autogeneration--but generic_associated_types will "soon" stabilize anyway https://github.com/rust-lang/rust/issues/44265.

For now, it makes sense to add a rust-toolchain file to force nightly. Note: There is already a rust-toolchain file in the actual program crate (so in amd-host-image-builder), and that is the more important one anyway.