Fix for crates using custom relative license-file paths in the Cargo.toml. #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are currently two ways which this crate uses to discover license
files.
The first method searches for paths starting with "LICENSE"
in the root of the current crate.
The second, uses a path specified by a crate author (in the Cargo.toml,
under the package table, a license-file can be specified).
The paths collected by the first method are absolute.
The path collected by the second is, however, relative to the crate.
The program however expects the paths to be absolute. For example,
in 'get_expression()', paths will be made relative by using the
'strip_prefix' method on the path. If the path is already relative,
as was the case before this commit, the program crashes.
Now perhaps the bug can also be fixed by making all paths relative,
however since I'm not well acquainted with the code base it is difficult
to make such a judgement, and as such this fix seemed safer to me.
Checklist
Description of Changes
Changes the license-file as specified by a crate author to be used internally as an absolute path instead of a relative path.
I'd like them included because I use these kinds of paths in my sic program and would like to keep using them. I discover the bug while attempting to run cargo-deny on the CI.
Related Issues
issue: #45