Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

kebab-case zomes fail to compile #2177

@pdaoust

Description

@pdaoust

Steps to reproduce:

  1. hc init my-dna
  2. cd my-dna
  3. hc generate zomes/kebab-case
  4. hc package

Output:

> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && echo $CARGO_TARGET_DIR 
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && echo $CARGO_TARGET_DIR "
/home/paul/target
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && cargo build --release --target=wasm32-unknown-unknown --target-dir=$CARGO_TARGET_DIR
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && cargo build --release --target=wasm32-unknown-unknown --target-dir=$CARGO_TARGET_DIR"
    Updating crates.io index
   Compiling kebab-case v0.1.0 (/home/paul/Holochain/kebab-test/zomes/kebab-case/code)
    Finished release [optimized] target(s) in 2.79s
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/kebab-case.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/kebab-case.wasm"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:999:5
stack backtrace:
   0: std::panicking::default_hook::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::continue_panic_fmt
   3: rust_begin_unwind
   4: core::panicking::panic_fmt
   5: core::result::unwrap_failed
   6: wasm_gc::main
   7: std::rt::lang_start::{{closure}}
Error: Couldn't traverse DNA in directory "/home/paul/Holochain/kebab-test": command CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/kebab-case.wasm was not successful

As you can see, it compiles fine, but then when wasm-gc looks for the artifact kebab-case.wasm it can't find it. Looking in the target dir, it exists as kebab_case.wasm. Seems that cargo and rustc default to snake_casing the build artifact's filename, and there's no way for cargo to pass an explicit filename to rustc yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions