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

Fix diagnostics; set up CI which includes make run and cargo clippy #5

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

zjp-CN
Copy link

@zjp-CN zjp-CN commented Jan 12, 2025

This is a draft PR. I'll make it ready once the following problems are solved.

  1. make BIN=loongarch64-qemu run leads to qemu-system-loongarch64: command not found (see CI ), so how to set up for loongarch64?
  2. There are two clippy warnings left, but I'm not sure how to do
  • for the first one, 01000 might be a typo, but what is it? 0x1000, 0o1000, or 0b1000?
  • for the second one, parameter envp is not really used, so I think it can be removed?
 warning: this is a decimal constant
    --> kernel/src/syscall/shm.rs:35:21
     |
  35 |         if shmflg & 01000 > 0 {
     |                     ^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal
     = note: `#[warn(clippy::zero_prefixed_literal)]` on by default
  help: if you mean to use a decimal constant, remove the `0` to avoid confusion
     |
  35 |         if shmflg & 1000 > 0 {
     |                     ~~~~
  help: if you mean to use an octal constant, use `0o`
     |
  35 |         if shmflg & 0o1000 > 0 {
     |                     ~~~~~~

  warning: parameter is only used in recursion
     --> kernel/src/syscall/task.rs:191:5
      |
  191 |     envp: Vec<String>,
      |     ^^^^ help: if this is intentional, prefix it with an underscore: `_envp`
      |
  note: parameter used here
     --> kernel/src/syscall/task.rs:249:79
      |
  249 |             return exec_with_process(task, String::from("busybox"), new_args, envp).await;
      |                                                                               ^^^^
  ...
  272 |                 return exec_with_process(task, new_args[0].clone(), new_args, envp).await;
      |                                                                               ^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion
      = note: `#[warn(clippy::only_used_in_recursion)]` on by default
  1. KernelTask is undeclared with net feature enabled:
 error[E0433]: failed to resolve: use of undeclared type `KernelTask`
    --> kernel/src/tasks/mod.rs:89:25
     |
  89 |     thread::spawn_blank(KernelTask::new(handle_net()));
     |                         ^^^^^^^^^^ use of undeclared type `KernelTask`
  1. Although there is a rust-toolchain.toml which specifies nightly-2023-12-01, the latest nightly toolchain is required somewhere and make run will fail (see CI ):
error: toolchain 'nightly-x86_64-unknown-linux-gnu' is not installed
Makefile:40: *** "ARCH" must be one of "x86_64", "riscv64", "aarch64" or "loongarch64".  Stop.

zjp-CN added 25 commits January 12, 2025 16:28
rust-objcopy --binary-architecture=riscv64 target/riscv64gc-unknown-none-elf/release/kernel --strip-all -O binary target/riscv64gc-unknown-none-elf/release/kernel.bin
Could not find tool: objcopy
at: /root/.rustup/toolchains/nightly-2023-12-01-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objcopy
Consider `rustup component add llvm-tools-preview`
make: *** [Makefile:110: build] Error 102
slice_mut_with_len ensures the exact length
called `is_none()` after searching an `Iterator` with `find`
this is more succinctly expressed by calling `any()` with negation
for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
`#[warn(clippy::search_is_some)]` on by default [search_is_some]
package `cargo-platform v0.1.9` cannot be built because it requires rustc 1.78 or newer, while the currently active rustc version is 1.76.0-nightly
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.

1 participant