Skip to content

Does not compile as dependency due to fs error #94

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

Closed
Devon7925 opened this issue Feb 10, 2025 · 4 comments
Closed

Does not compile as dependency due to fs error #94

Devon7925 opened this issue Feb 10, 2025 · 4 comments

Comments

@Devon7925
Copy link

Here's my log

PS C:\...> cargo run
   Compiling wgpu-core v0.19.4
   Compiling burn-jit v0.13.2
   Compiling burn-ndarray v0.13.2
   Compiling hf-hub v0.4.1
error[E0599]: no function or associated item named `create_new` found for struct `tokio::fs::File` in the current scope
   --> C:\Users\impor\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hf-hub-0.4.1\src\api\tokio.rs:82:32
    |
82  |         match tokio::fs::File::create_new(path.clone()).await {
    |                                ^^^^^^^^^^ function or associated item not found in `File`
    |
note: if you're trying to build a new `tokio::fs::File`, consider using `tokio::fs::File::from_std` which returns `tokio::fs::File`       
   --> C:\Users\impor\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\fs\file.rs:237:5
    |
237 |     pub fn from_std(std: StdFile) -> File {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: there is an associated function `create` with a similar name
    |
82  |         match tokio::fs::File::create(path.clone()).await {
    |                                ~~~~~~

For more information about this error, try `rustc --explain E0599`.
error: could not compile `hf-hub` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Here's my cargo.toml

[package]
name = "gpt-burn"
version = "0.1.0"
edition = "2021"

[dependencies]
burn = { version = "0.13", features = [
    "fusion",
    "ndarray",
    "train",
    "vision",
    "wgpu",
] }
bincode = "1"
clap = { version = "4", features = ["derive"] }
indicatif = { version = "0.17", features = ["rayon"] }
rand = "0.8"
rayon = "1"
serde = { version = "1", features = ["derive"] }
candle-datasets = "0.8.2"
@Devon7925
Copy link
Author

Looks like this is fixed but not released to crates.io.

@StrayDragon
Copy link

same issue here, also have a problem in rust 1.75.0 build with deps

cannot find function size_of in this scope not found in this scope

context here:

[{
	"resource": "~/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/hf-hub-0.4.1/src/api/tokio.rs",
	"owner": "rustc",
	"code": {
		"value": "Click for full compiler diagnostic",
		"target": {
			"$mid": 1,
			"path": "/diagnostic message [0]",
			"scheme": "rust-analyzer-diagnostics-view",
			"query": "0",
			"fragment": "file:///~/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/hf-hub-0.4.1/src/api/tokio.rs"
		}
	},
	"severity": 8,
	"message": "cannot find function `size_of` in this scope\nnot found in this scope",
	"source": "rustc",
	"startLineNumber": 565,
	"startColumn": 32,
	"endLineNumber": 565,
	"endColumn": 39,
	"relatedInformation": [
		{
			"startLineNumber": 1,
			"startColumn": 1,
			"endLineNumber": 1,
			"endColumn": 1,
			"message": "consider importing one of these items: `use core::mem::size_of;\n`, `use std::mem::size_of;\n`",
			"resource": "~/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/hf-hub-0.4.1/src/api/tokio.rs"
		}
	]
}]

@Narsil
Copy link
Collaborator

Narsil commented Feb 26, 2025

New patch release was made. Did it fix rust <1.75 ?

@Devon7925
Copy link
Author

@Narsil patch fixes my original issue so I'm closing this. Looks like the patch is missing from github releases though.

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

No branches or pull requests

3 participants