safety/sanitizers does not work with only workspace
alexkazik opened this issue · comments
If the Cargo.toml contains only a workspace then the sed part does not help.
I don't know enough about sed to create a patch ,but if it's changed to
"insert before first features or workspace"
then it should work just fine.
Hmm, when you say "does not help"/"does not work", what doesn't work? What error do you see?
I don't see any error, but the modified Cargo.toml doesn't contain the [profile.dev]
section (as it's cat'ed) and since the section is missing the next step with opt-level = 1
is also not added. (And I thought that the opt-level thing is required.)
Try it on a Cargo.toml with only a workspace and nothing else.
Ohh, I see what you mean!
Could you give the fix in #9 a try?
Works like a charm with my setup.
But breaks when the Cargo.toml has no trailing newline.
It works fine for me even with no trailing newline 🤔 Can you give an example TOML where it breaks?
Nice, thanks. Updated the PR. How's that for you?
That does the trick.
(Though my code has a trailing newline, I've checked that only to be sure it'll work.)