puffyCid / artemis

A cross platform forensic parser written in Rust!
MIT License
59 stars 6 forks source link

Issue: Build fails with 3 errors when building on Windows Server 2022 #130

Closed scott91e1 closed 3 months ago

scott91e1 commented 3 months ago

Describe the bug

Pulled the latest code from main and when I go to build these are the errors.

I don't know enough Rust to know whats broken, but it looks like a path based issue.

BTW, Very cool project :)

   Compiling artemis-server v0.8.0 (C:\DEV\artemis\repos\gh\server)
error: #[derive(RustEmbed)] folder 'C:\DEV\artemis\repos\gh\server\../target/dist/web' does not exist. cwd: 'C:\DEV\artemis\repos\gh'
 --> server\src\frontend\webui.rs:7:1
  |
7 | / #[folder = "../target/dist/web"]
8 | | struct Frontend;
  | |________________^

error[E0599]: no function or associated item named `get` found for struct `Frontend` in the current scope
  --> server\src\frontend\webui.rs:12:21
   |
8  | struct Frontend;
   | --------------- function or associated item `get` not found for this struct
...
12 |     match Frontend::get("index.html") {
   |                     ^^^ function or associated item not found in `Frontend`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following traits define an item `get`, perhaps you need to implement one of them:
           candidate #1: `SliceIndex`
           candidate #2: `RustEmbed`
           candidate #3: `toml_edit::table::TableLike`

error[E0599]: no function or associated item named `get` found for struct `Frontend` in the current scope
  --> server\src\frontend\webui.rs:21:21
   |
8  | struct Frontend;
   | --------------- function or associated item `get` not found for this struct
...
21 |     match Frontend::get(path) {
   |                     ^^^ function or associated item not found in `Frontend`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following traits define an item `get`, perhaps you need to implement one of them:
           candidate #1: `SliceIndex`
           candidate #2: `RustEmbed`
           candidate #3: `toml_edit::table::TableLike`

warning: unused import: `IntoResponse`
 --> server\src\frontend\webui.rs:2:28
  |
2 | use axum::response::{Html, IntoResponse, Response};
  |                            ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0599`.
warning: `artemis-server` (lib) generated 1 warning
error: could not compile `artemis-server` (lib) due to 3 previous errors; 1 warning emitted

Steps to Reproduce

cargo build

[C:\DEV\artemis\repos\gh]cargo --version
cargo 1.77.1 (e52e36006 2024-03-26)

Environment

Edition Windows Server 2022 Datacenter
Version 21H2
Installed on    ‎16/‎05/‎2023
OS build    20348.2227
puffyCid commented 3 months ago

hey @scott91e1 thanks for opening the issue.

Apologies i thought i had the documentation updated on compiling. I will make sure to push an update on compiling to the docs at https://puffycid.github.io/artemis-api/docs/Intro/installation#build-from-source

The easiest way to build the artemis CLI binary with only cargo is:

clone the repository
navigate to the cli directory/workspace

run cargo build or cargo build --release

Since you are using the latest version you will need to have cmake installed on your windows server due to recent dependency updates.

There error you are seeing is related to the experimental and optional web server and its webui

Building that is a bit more advance but is documented at: https://puffycid.github.io/artemis-api/docs/Contributing/building

Again thoguh if you just want the cli binary, you just need to install cmake and navigate to the cli directory/workspace and run cargo build

please let know if u still encounter issues. thanks

scott91e1 commented 3 months ago

Thanks for the thoughtful reply.

Both the debug and release editions compiled without errors when built from CLI directory.

👌