rust-osdev / bootimage

Tool to create bootable disk images from a Rust OS kernel.
Apache License 2.0
765 stars 67 forks source link

Trying to install bootimage yields errors #82

Closed terrarier2111 closed 2 years ago

terrarier2111 commented 2 years ago

Just for the record: i added the "#![no_std]" and "#![no_main]" to the top of my main file. When trying to install bootimage (using cargo install bootimage) , when reaching the 21st dependency it starts spitting out warnings like this:

error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2139:52
     |
2139 | ...                   "nanos_since_epoch" => Ok(Field::Nanos),
     |                                              ^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2140:34
     |
2140 | ...                   _ => Err(Error::unknown_field(value, FIELDS)),
     |                            ^^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2149:52
     |
2149 | ...                   b"secs_since_epoch" => Ok(Field::Secs),
     |                                              ^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2150:53
     |
2150 | ...                   b"nanos_since_epoch" => Ok(Field::Nanos),
     |                                               ^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2153:33
     |
2153 | ...                   Err(Error::unknown_field(&value, FIELDS))
     |                       ^^^ not found in this scope

error[E0531]: cannot find tuple struct or tuple variant `Some` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2169:17
     |
2169 |                 Some(_) => Ok(()),
     |                 ^^^^ not found in this scope
     |
help: consider importing this tuple variant
     |
1    | use __private::de::Content::Some;
     |

error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2169:28
     |
2169 |                 Some(_) => Ok(()),
     |                            ^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2170:25
     |
2170 |                 None => Err(E::custom("overflow deserializing SystemTime epoch offset")),
     |                         ^^^ not found in this scope

error[E0531]: cannot find tuple struct or tuple variant `Some` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2188:21
     |
2188 |                     Some(value) => value,
     |                     ^^^^ not found in this scope
     |
help: consider importing this tuple variant
     |
1    | use __private::de::Content::Some;
     |

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2190:32
     |
2190 |                         return Err(Error::invalid_length(0, &self));
     |                                ^^^ not found in this scope

error[E0531]: cannot find tuple struct or tuple variant `Some` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2194:21
     |
2194 |                     Some(value) => value,
     |                     ^^^^ not found in this scope
     |
help: consider importing this tuple variant
     |
1    | use __private::de::Content::Some;
     |

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2196:32
     |
2196 |                         return Err(Error::invalid_length(1, &self));
     |                                ^^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2200:17
     |
2200 |                 Ok(Duration::new(secs, nanos))
     |                 ^^ not found in this scope

error[E0425]: cannot find value `None` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2207:45
     |
2207 |                 let mut secs: Option<u64> = None;
     |                                             ^^^^ not found in this scope
     |
help: consider importing this unit variant
     |
1    | use __private::de::Content::None;
     |

error[E0425]: cannot find value `None` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2208:46
     |
2208 |                 let mut nanos: Option<u32> = None;
     |                                              ^^^^ not found in this scope
     |
help: consider importing this unit variant
     |
1    | use __private::de::Content::None;
     |

error[E0531]: cannot find tuple struct or tuple variant `Some` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2209:27
     |
2209 |                 while let Some(key) = try!(map.next_key()) {
     |                           ^^^^ not found in this scope
     |
help: consider importing this tuple variant
     |
1    | use __private::de::Content::Some;
     |

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2213:40
     |
2213 | ...                   return Err(<A::Error as Error>::duplicate_field(
     |                              ^^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Some` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2217:36
     |
2217 | ...                   secs = Some(try!(map.next_value()));
     |                              ^^^^ not found in this scope
     |
help: consider importing this tuple variant
     |
1    | use __private::de::Content::Some;
     |

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2221:40
     |
2221 | ...                   return Err(<A::Error as Error>::duplicate_field(
     |                              ^^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `Some` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2225:37
     |
2225 | ...                   nanos = Some(try!(map.next_value()));
     |                               ^^^^ not found in this scope
     |
help: consider importing this tuple variant
     |
1    | use __private::de::Content::Some;
     |

error[E0531]: cannot find tuple struct or tuple variant `Some` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2230:21
     |
2230 |                     Some(secs) => secs,
     |                     ^^^^ not found in this scope
     |
help: consider importing this tuple variant
     |
1    | use __private::de::Content::Some;
     |

error[E0425]: cannot find function, tuple struct or tuple variant `Err` in this scope
    --> /home/threadexception/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/de/impls.rs:2231:36
     |
2231 |                     None => return Err(<A::Error as Error>::missing_field("secs_since_epoch")),
     |                                    ^^^ not found in this scope

my cargo.toml:

[package]
name = "Something"
version = "0.1.0"
edition = "2021"

[profile.dev]
panic = "abort"

[profile.release]
panic = "abort"

[dependencies]
bootloader = "0.9.22"

my cargo.lock:

version = 3

[[package]]
name = "Something"
version = "0.1.0"
dependencies = [
 "bootloader",
]

[[package]]
name = "bootloader"
version = "0.9.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de78decc37247c7cfac5dbf3495c7298c6ac97cb355161caa7e15969c6648e6c"

my config.toml:

[build]
target = "x86_64-os.json"

[unstable]
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]

[target.'cfg(target_os = "none")']
runner = "bootimage runner"
phil-opp commented 2 years ago

Try installing it from a different directory. E.g.:

cd /tmp
cargo install bootimage

The problem might be that cargo applies some settings of the .cargo/config.toml settings to the install command as well. If it still doesn't work from a different dir, please let me know!

phil-opp commented 2 years ago

Normally the .cargo/config.toml should be ignored for cargo installed though. Do you have some global .cargo/config.toml directly in your $HOME directory by any chance?

aaron336 commented 2 years ago

Beat me to it! As a noob I was having the same problem and discovered this solution a few hours ago.

OP, see: https://doc.rust-lang.org/cargo/reference/config.html

terrarier2111 commented 2 years ago

I fixed it by pulling the repo from my workstation from github (so the issue wasn't in any of the cargo config related files at all) it had something to do with the project itself idk what exactly it was tho

terrarier2111 commented 2 years ago

Thanks for yall's help tho

n-eq commented 2 years ago

~Hello @phil-opp , I currently have the same issue and installing from a different location (tested on /tmp) doesn't solve the problem, tried uninstalling and installing multiple times but doesn't help. Do you have any clue?~

Nevermind, I was not using the nightly channel