Skip to content

Commit 18bcda0

Browse files
committed
Make manifest path absolute without resolving symlinks
Signed-off-by: Sebastian Walz <sebastian.walz@secunet.com>
1 parent 4b098ca commit 18bcda0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cargo-cyclonedx/src/generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ impl GeneratedSbom {
964964
/// This must be run **after** `cargo metadata` which will generate the `Cargo.lock` file
965965
/// and make sure it's up to date.
966966
fn locate_cargo_lock(manifest_path: &Path) -> Result<PathBuf, std::io::Error> {
967-
let manifest_path = manifest_path.canonicalize()?;
967+
let manifest_path = std::path::absolute(manifest_path)?;
968968
let ancestors = manifest_path.as_path().ancestors();
969969

970970
for path in ancestors {

cargo-cyclonedx/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn setup_logging(args: &Args) -> anyhow::Result<()> {
119119

120120
fn locate_manifest(args: &Args) -> Result<PathBuf, io::Error> {
121121
if let Some(manifest_path) = &args.manifest_path {
122-
let manifest_path = manifest_path.canonicalize()?;
122+
let manifest_path = std::path::absolute(manifest_path)?;
123123
log::info!(
124124
"Using manually specified Cargo.toml manifest located at: {}",
125125
manifest_path.to_string_lossy()

0 commit comments

Comments
 (0)