Stream: git-wasmtime

Topic: wasmtime / issue #9588 Give a bit more informative error ...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2024 at 22:43):

larry0x opened issue #9588:

PR #4143 added this error if a isle_generated_code/ directory exists and an "isle-in-source-tree" feature isn't enabled:

#[cfg(not(feature = "isle-in-source-tree"))]
{
    if explicit_isle_dir.is_dir() {
        eprintln!(concat!(
            "Error: directory isle_generated_code/ exists but is only used when\n",
            "`--feature isle-in-source-tree` is specified. To prevent confusion,\n",
            "this build script requires the directory to be removed when reverting\n",
            "to the usual generated code in target/. Please delete the directory and\n",
            "re-run this build.\n",
        ));
        std::process::exit(1);
    }
}

It says to delete the directory. However, for users who are not familiar with the inner workings of cranelift, it's not clear where this directory is. It took me a long while to find it:

~/.cargo/registry/src/index.crates.io-{hash}/cranelift-codegen-{version}/isle_generated_code

It may be helpful to add the explicit_isle_dir value to the error message so that users are informed exactly which directory they are supposed to delete.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2024 at 22:53):

cfallin commented on issue #9588:

Hmm, something is going wrong here -- you shouldn't ever need to delete a directory in ~/.cargo. The intent of this feature was to allow Cranelift developers to see a version of the code in-tree when developing Cranelift, and should not be used when Cranelift is pulled in as a dependency from crates.io. Could you say more about your environment and how you're using Cranelift?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2024 at 22:57):

larry0x commented on issue #9588:

@cfallin I don't use cranelift directly so not sure what's supposed to happen... I use wasmer. At wasmer 5.0.0 my program compiles with no problem. Once bumped to wasmer 5.0.1, compiling my program results in this error:

error: failed to run custom build command for `cranelift-codegen v0.110.2`

Caused by:
  process didn't exit successfully: `/Users/[...]/target/release/build/cranelift-codegen-725296997bf7694e/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=build.rs

  --- stderr
  Error: directory isle_generated_code/ exists but is only used when
  `--feature isle-in-source-tree` is specified. To prevent confusion,
  this build script requires the directory to be removed when reverting
  to the usual generated code in target/. Please delete the directory and
  re-run this build.

I followed the instruction and deleted:

~/.cargo/registry/src/index.crates.io-{hash}/cranelift-codegen-{version}/isle_generated_code

Now the program compiles just fine.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2024 at 00:12):

cfallin closed issue #9588:

PR #4143 added this error if a isle_generated_code/ directory exists and an "isle-in-source-tree" feature isn't enabled:

#[cfg(not(feature = "isle-in-source-tree"))]
{
    if explicit_isle_dir.is_dir() {
        eprintln!(concat!(
            "Error: directory isle_generated_code/ exists but is only used when\n",
            "`--feature isle-in-source-tree` is specified. To prevent confusion,\n",
            "this build script requires the directory to be removed when reverting\n",
            "to the usual generated code in target/. Please delete the directory and\n",
            "re-run this build.\n",
        ));
        std::process::exit(1);
    }
}

It says to delete the directory. However, for users who are not familiar with the inner workings of cranelift, it's not clear where this directory is. It took me a long while to find it:

~/.cargo/registry/src/index.crates.io-{hash}/cranelift-codegen-{version}/isle_generated_code

It may be helpful to add the explicit_isle_dir value to the error message so that users are informed exactly which directory they are supposed to delete.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2024 at 00:12):

cfallin commented on issue #9588:

@larry0x OK, thanks for the additional info. This error does not happen when using Cranelift by itself, or with Wasmtime (in this repo). We do not provide support for Wasmer -- that is a different project. I would recommend asking them for help if the issue occurs again; they may be setting options in some way that is causing this issue.


Last updated: Dec 23 2024 at 13:07 UTC