Skip to content

Importing issues in cdylib #281

@HaramanJohal

Description

@HaramanJohal

I am trying to fuzz some of my code but I am struggling with imports.

I have taken the following steps from the documentation:

  1. cargo install cargo-fuzz
  2. cd my_project
  3. cargo fuzz init

but then when I try to import my modules into the file fuzz_target_1.rs I get various errors

If I try extern crate my_project (as in the docs) I get can't find crate
If I try use my_project I get unresolved import and no external crate my_project

Is there some other way I am supposed to access my code from the fuzz target?

cargo fuzz init has automatically included the following in my_project/fuzz/Cargo.toml:

[dependencies.my_project]
path = ".."

(I was under the impression that this means I can do something like use my_project)

If there is a more appropriate place for me to ask this question I am happy to direct it elsewhere
(I would be happy to update documentation myself if necessary once I understand how this works)

I'm sure this might be something really basic that I'm missing, thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions