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

Enable use of cargo-fuzz without a separate workspace #357

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

kdarkhan
Copy link
Contributor

@kdarkhan kdarkhan commented Jan 7, 2024

This addresses #345. Currently, cargo-fuzz defines an independent workspace

[workspace]
members = ["."]

which introduces some issues like caching setup, separate linting configs, etc.

The main reason for this seems to be a custom config for profile.release.debug which is allowed to be changed only at the root Cargo.toml of the workspace. This commit adds a workaround for that by supplying --config profile.release.debug=true.

In order to not break workflows of the existing users I introduced a new flag which allows to fallback to the old behavior.

src/options/init.rs Outdated Show resolved Hide resolved
@kdarkhan kdarkhan force-pushed the no-workspace branch 2 times, most recently from fd23262 to 143d918 Compare January 11, 2024 21:11
This addresses #345.
Currently, `cargo-fuzz` defines an independent workspace

```
[workspace]
members = ["."]
```

which introduces some issues like caching setup, separate linting
configs, etc.

The main reason for this seems to be a custom config for
`profile.release.debug` which is allowed to be changed only at the
root Cargo.toml of the workspace. This commit adds a workaround
for that by supplying `--config profile.release.debug=true`.

If users need to preserve the old behavior they can provide the flag
`--fuzzing-workspace=true` during `cargo fuzz init`
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thansk!

@fitzgen fitzgen merged commit 56bcbcf into rust-fuzz:main Jan 12, 2024
1 check passed
@kdarkhan kdarkhan deleted the no-workspace branch January 12, 2024 23:57
@kpcyrd
Copy link

kpcyrd commented Jan 24, 2024

I'm excited for the next release, having them in the same workspace would allow me to delete my fuzz/Cargo.lock file that I keep getting security alerts for. :)

@fitzgen
Copy link
Member

fitzgen commented Jan 25, 2024

I can cut a release in a little bit, but FWIW nothing is stopping you from manually removing the workspace declaration in fuzz/Cargo.toml and adding the crate to your existing workspace.

kdarkhan added a commit to kdarkhan/mdbook-i18n-helpers that referenced this pull request Jan 25, 2024
With the changes from rust-fuzz/cargo-fuzz#357
merged, `fuzz` dir now can be a part of the workspace.
kdarkhan added a commit to kdarkhan/mdbook-i18n-helpers that referenced this pull request Jan 26, 2024
With the changes from rust-fuzz/cargo-fuzz#357
merged, `fuzz` dir now can be a part of the workspace.
@kdarkhan
Copy link
Contributor Author

kdarkhan commented Jan 26, 2024

Thanks for releasing the new version @fitzgen

About changing the workspace structure without the new release - that would probably not work with the older version of cargo-fuzz due to missing flag --config profile.release.debug=true.

I don't know about the reason for setting the flag but it will be ignored in child workspace.

warning: profiles for the non root package will be ignored, specify profiles at the workspace root

kdarkhan added a commit to google/mdbook-i18n-helpers that referenced this pull request Jan 30, 2024
With the changes from rust-fuzz/cargo-fuzz#357
merged, `fuzz` dir now can be a part of the workspace.
kdarkhan added a commit to kdarkhan/mdbook-i18n-helpers that referenced this pull request Jan 30, 2024
With the changes from rust-fuzz/cargo-fuzz#357
merged, `fuzz` dir now can be a part of the workspace.
kdarkhan added a commit to google/mdbook-i18n-helpers that referenced this pull request Feb 2, 2024
With the changes from rust-fuzz/cargo-fuzz#357
merged, `fuzz` dir now can be a part of the workspace.
kdarkhan added a commit to kdarkhan/mdbook-i18n-helpers that referenced this pull request Feb 6, 2024
With the changes from rust-fuzz/cargo-fuzz#357
merged, `fuzz` dir now can be a part of the workspace.
kdarkhan added a commit to kdarkhan/pulldown-cmark that referenced this pull request Aug 30, 2024
This is possible because of the change introduced
in rust-fuzz/cargo-fuzz#357.

Using the same workspace enables reusing same deps
and sharing cache between members. It also has better editor
support.
kdarkhan added a commit to kdarkhan/pulldown-cmark that referenced this pull request Aug 31, 2024
This is possible because of the change introduced
in rust-fuzz/cargo-fuzz#357.

Using the same workspace enables reusing same deps
and sharing cache between members. It also has better editor
support.
kdarkhan added a commit to kdarkhan/pulldown-cmark that referenced this pull request Aug 31, 2024
This is possible because of the change introduced
in rust-fuzz/cargo-fuzz#357.

Using the same workspace enables reusing same deps
and sharing cache between members. It also has better editor
support.
kdarkhan added a commit to kdarkhan/pulldown-cmark that referenced this pull request Sep 5, 2024
This has the benefit of sharing the build cache
and better editor support. Previously it was not
possible to do it in `cargo-fuzz` but became possible
after rust-fuzz/cargo-fuzz#357.
kdarkhan added a commit to kdarkhan/pulldown-cmark that referenced this pull request Sep 5, 2024
This has the benefit of sharing the build cache
and better editor support. Previously it was not
possible to do it in `cargo-fuzz` but became possible
after rust-fuzz/cargo-fuzz#357.
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.

4 participants