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

failed to load source for dependency wdk-build #99

Closed
iKunCai opened this issue Feb 5, 2024 · 8 comments
Closed

failed to load source for dependency wdk-build #99

iKunCai opened this issue Feb 5, 2024 · 8 comments
Assignees

Comments

@iKunCai
Copy link

iKunCai commented Feb 5, 2024

ERROR - Error while running plugin: Source: Unknown Line: 38 - [tasks.wdk-build-init]'s script failed with exit code: 1

Caused by:
failed to load source for dependency wdk-build

I got same error in the closed issues.however, there is not information about how to fix this error

@lurebat
Copy link

lurebat commented Feb 5, 2024

I worked around it by changing the makefile -

Change Makefile.toml to

extend = ".cargo-make-loadscripts/rust-driver-makefile.toml"

[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true

And then in rust-driver-makefile.toml change every wdk-build = ...
to wdk-build = {git = "https://github.com/microsoft/windows-drivers-rs.git", branch = "main"}

@iKunCai
Copy link
Author

iKunCai commented Feb 5, 2024

I worked around it by changing the makefile -

Change Makefile.toml to

extend = ".cargo-make-loadscripts/rust-driver-makefile.toml"

[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true

And then in rust-driver-makefile.toml change every wdk-build = ... to wdk-build = {git = "https://github.com/microsoft/windows-drivers-rs.git", branch = "main"}

thank you. i will try it.

@iKunCai iKunCai closed this as completed Feb 5, 2024
@lurebat
Copy link

lurebat commented Feb 5, 2024

I'm guessing #36 will let you edit the file, but it still needs to be fixed, so maybe don't close the issue.

@iKunCai iKunCai reopened this Feb 5, 2024
@iKunCai
Copy link
Author

iKunCai commented Feb 5, 2024

I'm guessing #36 will let you edit the file, but it still needs to be fixed, so maybe don't close the issue.

Ok,Done

@wmmc88
Copy link
Collaborator

wmmc88 commented Feb 5, 2024

#36 makes it so that there is not longer an extra step to get the rust-driver-makefile, since it already exists in the filesystem when u take a dependency on wdk-build. This also ensures the makefile is versioned with the build crate.

The previous loadscript(assuming u copied from the example/readme) always pulled the latest makefile from main branch. Its possible that when #35 merged, it started pulling an incompatible rust-driver-toolchain.toml. you can edit the loadscript to pull in the specific one you want.

What version of the crates are you using, and how have you consumed them(git vs crates.io)? What does you load_script look like?

@lurebat
Copy link

lurebat commented Feb 5, 2024

The makefile as it currently is seems to look for the crate in the wrong path.

it tries to go to .cargo-make-loadscripts/crates/wdk-build

Which makes sense for this repo (as there is a crates directory with wdk-build in the path of the project), but in repos that use it it doesn't exist.

@wmmc88 wmmc88 self-assigned this Feb 6, 2024
@wmmc88
Copy link
Collaborator

wmmc88 commented Feb 6, 2024

The makefile as it currently is seems to look for the crate in the wrong path.

it tries to go to .cargo-make-loadscripts/crates/wdk-build

Which makes sense for this repo (as there is a crates directory with wdk-build in the path of the project), but in repos that use it it doesn't exist.

How does your repo use WDR?

The crates/wdk-build path used here is in a makefile that is meant only for use in this repo. Your own repos that use WDR should have their own Makefile setup based off of the example in this readme. The readme was updated in #36 (now merged) with new paths for a client's loadscript, since after #36, the load_script block will place a symlink in the target folder to point to the rust-driver-makefile.toml file that lives in crates/wdk-build inside your .cargo folder (specific folder depends on whether you ingest via crates.io or via Cargo git dependency

@lurebat
Copy link

lurebat commented Feb 10, 2024

Using the newest script in the readme fixes it

@wmmc88 wmmc88 closed this as completed Feb 12, 2024
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