arihant2math opened issue #9625:
Currently if an explicit isle directory is found when the "isle-in-source-tree" feature is not enabled, the following error message is shown by the build script for cranelift-codegen:
--- 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.
as emitted by https://github.com/bytecodealliance/wasmtime/blob/3e0b7e501beebf5d7c094b7ac751f582ba12bc95/cranelift/codegen/build.rs#L78.
However this is misleading as deleting the
target/
directory (atleast on windows) does not fix the issue. The directory, for me, was located in%HOME%\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\cranelift-codegen-0.113.1\\isle_generated_code
. Could there possibly be a better check/error message and/or the actual directory located printed out to stderr?
arihant2math edited issue #9625:
Currently if an explicit isle directory is found when the "isle-in-source-tree" feature is not enabled, the following error message is shown by the build script for cranelift-codegen:
--- 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.
as emitted by https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/codegen/build.rs#L78C9-L87C10.
However this is misleading as deleting the
target/
directory (atleast on windows) does not fix the issue. The directory, for me, was located in%HOME%\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\cranelift-codegen-0.113.1\\isle_generated_code
. Could there possibly be a better check/error message and/or the actual directory located printed out to stderr?
cfallin commented on issue #9625:
This seems to be a duplicate of #9588. That directory should not ever be created inside the
.cargo
path. Could you say more about how you're building Cranelift?
arihant2math commented on issue #9625:
I'm using wasmtime, so building is done because/through that. I'm not using any special features, just the default configuration.
I did some digging around the code, I think the bug is around L61 when calling
env::current_dir()
, since I'm pretty sure that's inconsistent when used in build scripts, I printed it out and got "%HOME%\\.cargo\\registry\src\index.crates.io-6f17d22bba15001f\\cranelift-codegen-0.113.1", which seems to be the issue.If changed to the
OUT_DIR
env variable, it would be in the target folder, which would be an improvement.
bjorn3 commented on issue #9625:
env::current_dir()
is used for exactly two purposes in the build script:
- Getting the source files. Using
OUT_DIR
here would be wrong.- Looking for a
isle_generated_code
directory in the source directory to use ifisle-in-source-tree
is enabled. The very intent ofisle-in-source-tree
requires this to keep using the source directory too.If you aren't doing development on Cranelift itself,
isle-in-source-tree
should never be enabled (and it definitively shouldn't be enabled when using it as crates.io dependency as those are not allowed to write to their source directory) and as suchisle_generated_code
should never be generated in the source directory. We want to know why it is generated anyway. Is any project you built that depends on Cranelift usingisle-in-source-tree
?
bjorn3 commented on issue #9625:
So turns out until very recently Wasmer was enabling
isle-in-source-tree
: https://github.com/wasmerio/wasmer/pull/5202 Did you build Wasmer within the past couple of weeks? Note that Wasmer and Wasmtime are two entirely separate wasm engines. They just happen to share Cranelift as one of the compiler backends they use.
cfallin commented on issue #9625:
That's fairly obnoxious. Perhaps we should remove the feature altogether, unless folks are still using it -- I'll bring this up in the Cranelift meeting in a few minutes.
alexcrichton closed issue #9625:
Currently if an explicit isle directory is found when the "isle-in-source-tree" feature is not enabled, the following error message is shown by the build script for cranelift-codegen:
--- 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.
as emitted by https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/codegen/build.rs#L78C9-L87C10.
However this is misleading as deleting the
target/
directory (atleast on windows) does not fix the issue. The directory, for me, was located in%HOME%\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\cranelift-codegen-0.113.1\\isle_generated_code
. Could there possibly be a better check/error message and/or the actual directory located printed out to stderr?
Last updated: Nov 22 2024 at 17:03 UTC