Closed roharvey closed 8 months ago
With the way cargo parses cargo:rustc-env=KEY=VALUE
only the part of the value before the first newline will be included in the env var anyway. So a potential solution would be to just preemptively truncate at the first newline.
Alternatively, or as a future enhancement, newlines could be encoded and then later decoded when reading the env var. Or ideally cargo could provide support for build scripts emitting env var values that contain newlines.
I found this problem via a dependabot PR message, copied into the third line of the commit message.
With:
and a commit message generated from dependabot groups like:
we had a build failure:
I don't think this should cause an error since it comes from git. At least a simple check could be done to ensure it fits a regex before creating an error, but ultimately it would be safer to compare to cargo options.
The best workaround for us was to change
all_git()
togit_sha(false)
, but only because we weren't using other git features.