Skip to content

Commit

Permalink
make: cli-compiler: resolve build-docs errors
Browse files Browse the repository at this point in the history
Fix compilation errors in documentation build by:
- Adding missing LLVM compiler dependency
- Correcting imports in store.rs
- Updating feature flags in cli-compiler

Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
  • Loading branch information
charmitro committed Jan 29, 2025
1 parent 5af33d2 commit 0d9dfdd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/cli-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ target-lexicon = { version = "0.12", features = ["std"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
wasmer-compiler-singlepass = { version = "=5.0.5-rc1", path = "../compiler-singlepass", optional = true }
wasmer-compiler-cranelift = { version = "=5.0.5-rc1", path = "../compiler-cranelift", optional = true }
wasmer-compiler-llvm = { version = "=5.0.5-rc1", path = "../compiler-llvm", optional = true }
clap = { version = "4.4.0", features = ["derive", "env"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
Expand All @@ -49,6 +50,7 @@ wasmer-compiler-singlepass = { version = "=5.0.5-rc1", path = "../compiler-singl
wasmer-compiler-cranelift = { version = "=5.0.5-rc1", path = "../compiler-cranelift", optional = true, default-features = false, features = [
"wasm",
] }
wasmer-compiler-llvm = { version = "=5.0.5-rc1", path = "../compiler-llvm", optional = true, default-features = false, features = [] }
# NOTE: Must use different features for clap because the "color" feature does not
# work on wasi, due to the anstream dependency not compiling.
clap = { version = "4.4.0", default-features = false, features = [
Expand All @@ -75,7 +77,7 @@ cranelift = ["wasmer-compiler-cranelift", "compiler"]
debug = ["fern", "log"]
disable-all-logging = []
jit = []
llvm = []
llvm = ["wasmer-compiler-llvm"]

[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
6 changes: 5 additions & 1 deletion lib/cli-compiler/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
use crate::common::WasmFeatures;
use anyhow::Result;
use clap::Parser;
#[cfg(doc)]
use std::path::PathBuf;
use std::string::ToString;
#[allow(unused_imports)]
use std::sync::Arc;
use wasmer_compiler::{
types::target::{PointerWidth, Target},
CompilerConfig, EngineBuilder, Features,
};
#[cfg(doc)]
use wasmer_types::Type;
use wasmer_types::{MemoryStyle, MemoryType, Pages, TableStyle, TableType};

/// Minimul Subset of Tunable parameters for WebAssembly compilation.
Expand Down Expand Up @@ -211,7 +215,7 @@ impl CompilerOptions {
use std::fs::File;
use std::io::Write;
use wasmer_compiler_llvm::{
CompiledKind, InkwellMemoryBuffer, InkwellModule, LLVMCallbacks, LLVM,
CompiledKind, InkwellMemoryBuffer, InkwellModule, LLVMCallbacks,
};
use wasmer_types::entity::EntityRef;
let mut config = LLVM::new();
Expand Down

0 comments on commit 0d9dfdd

Please sign in to comment.