Skip to content
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

Fix "file not found" error when the crate name contains hyphens #48

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

parasyte
Copy link
Contributor

The library is written with hyphens replaced with underscores.


Example that demonstrates the bug:

Cargo.toml:

[package]
name = "hello-world"

Crank.toml:

[[target]]
name = "hello-world"

[target.metadata]
name = "Hello World"
version = "0.1.0"
$ RUST_LOG=debug crank build --release --example hello-world

# ... snip ...

 DEBUG crank > copy: "C:\\Users\\jay\\other-projects\\crankstart\\target\\release\\examples/hello-world.dll" -> "C:\\Users\\jay\\other-projects\\crankstart\\target\\Hello World\\pdex.dll"
Error: The system cannot find the file specified. (os error 2)
$ ls -la target/release/examples/*.dll

-rwxr-xr-x 2 jay 197121 139264 Aug 26 17:58 target/release/examples/hello_world.dll*
-rwxr-xr-x 2 jay 197121 139264 Aug 26 17:58 target/release/examples/hello_world-30373b030c92bf1c.dll*

After applying the patch:

$ RUST_LOG=debug crank build --release --example hello-world

# ... snip ...

 DEBUG crank > copy: "C:\\Users\\jay\\other-projects\\crankstart\\target\\release\\examples/hello_world.dll" -> "C:\\Users\\jay\\other-projects\\crankstart\\target\\Hello World\\pdex.dll"
 INFO  crank > copy_assets
 
# ... etc, and it completes successfully!

@parasyte parasyte force-pushed the fix/hyphenated-crate-names branch from 79c33a0 to 997c897 Compare August 31, 2023 07:20
The library is written with hyphens replaced with underscores.
@parasyte parasyte force-pushed the fix/hyphenated-crate-names branch from 997c897 to c5f84d5 Compare August 31, 2023 23:26
@boozook boozook assigned boozook and parasyte and unassigned boozook Sep 4, 2023
@parasyte
Copy link
Contributor Author

parasyte commented Sep 4, 2023

The failing tests are caused by having two versions of the zip crate (0.5 and 0.6), which is unrelated to this PR.

I'll see what it takes to fix that, though. It will be fixed in its own PR and I'll rebase this (and the other open PR) after the fix is merged.

@parasyte parasyte mentioned this pull request Sep 5, 2023
@parasyte parasyte marked this pull request as draft September 5, 2023 06:24
@boozook boozook marked this pull request as ready for review September 13, 2023 12:21
@boozook boozook merged commit 155da63 into pd-rs:main Sep 13, 2023
7 checks passed
@parasyte parasyte deleted the fix/hyphenated-crate-names branch September 14, 2023 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants