Skip to content

Dandelion dev #3

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

Merged
merged 28 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
07f8e2c
adding some code documentation
leon-thomm Oct 4, 2023
b21048b
rewriting section parsing
leon-thomm Oct 4, 2023
0a03ab5
reorganizing parsers
leon-thomm Oct 4, 2023
b86dd3a
minor parser doc changes
leon-thomm Oct 4, 2023
8abf67f
parser doc fix
leon-thomm Oct 4, 2023
71da83b
undo parser name section parsing fix
leon-thomm Oct 17, 2023
52ed549
redo parser name section parsing fix
leon-thomm Oct 17, 2023
7803e0f
copy paste hell (fix previous commit)
leon-thomm Oct 17, 2023
f8a03ce
Merge branch 'dandelion-dev' into cosmetic-parser-changes
leon-thomm Oct 17, 2023
1700ead
Merge pull request #1 from eth-easl/cosmetic-parser-changes
leon-thomm Oct 17, 2023
76b9e2c
fix old run_manual! usage
leon-thomm Oct 17, 2023
fbe31e2
Merge pull request #2 from eth-easl/cosmetic-parser-changes
leon-thomm Oct 17, 2023
cea4936
add option --no-alloc
leon-thomm Oct 17, 2023
3f3355c
do not overwrite Cargo.toml
leon-thomm Oct 19, 2023
2da921d
prevent IndirectFuncRet dead_code warning
leon-thomm Oct 21, 2023
1f05eed
add option --crate-name
leon-thomm Oct 21, 2023
818cd0d
remove panic handler
leon-thomm Oct 22, 2023
12578a5
improve --crate-name help text
leon-thomm Oct 22, 2023
265ae3e
allow static initialization
leon-thomm Oct 28, 2023
4b601b1
print memory size
leon-thomm Nov 6, 2023
932b252
make WasmModule::new() non-const
leon-thomm Nov 12, 2023
3e32aa1
remove const-friendly memory initialization
leon-thomm Nov 12, 2023
74b8bba
add option --extern-memory
leon-thomm Nov 12, 2023
96fcaef
silence some warnings
leon-thomm Nov 21, 2023
7cdd656
support memory import
leon-thomm Dec 11, 2023
f89337d
remove --extern-memory
leon-thomm Dec 11, 2023
efd9d9f
make memory public
leon-thomm Dec 15, 2023
fcd54b6
update .gitignore
leon-thomm Dec 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ pub struct CmdLineOpts {
/// Path to output directory
#[clap(default_value = "./generated")]
output_directory: std::path::PathBuf,
/// Customize the name of the generated Rust crate.
/// Default: sandboxed-<input-file-name-base>
#[clap(long)]
crate_name: Option<String>,
/// Prevent reformatting, for debug purposes
#[clap(short, long)]
prevent_reformat: bool,
Expand Down Expand Up @@ -81,6 +85,11 @@ pub struct CmdLineOpts {
/// Generate a `no_std` library, limiting usage to `core` and `alloc`
#[clap(long)]
no_std_library: bool,
/// Generate statically allocated, heapless code (implies --no-std-library,
/// requires --fixed-mem-size)
/// (Warning: experimental performance impact)
#[clap(long)]
no_alloc: bool,
}

fn main() -> Maybe<()> {
Expand All @@ -106,6 +115,12 @@ fn main() -> Maybe<()> {
if opts.generate_as_wasi_library {
opts.generate_wasi_executable = true;
}
if opts.no_alloc {
if opts.fixed_mem_size.is_none() {
return Err(eyre!("Must use --fixed-mem-size when using --no-alloc"));
}
opts.no_std_library = true;
}

let inp = std::fs::read(&opts.input_path)?;
println!("Finished reading");
Expand Down
Loading