anchore / syft

CLI tool and library for generating a Software Bill of Materials from container images and filesystems
Apache License 2.0
6.2k stars 571 forks source link

syft convert -o option erroring out #1095

Closed gm7y8 closed 2 years ago

gm7y8 commented 2 years ago

syft convert sbom.syft.json -o cyclonedx-json=img.cdx.json 2022/07/11 10:59:36 error during command execution: unknown shorthand flag: 'o' in -o Its experimental feature.. just wanted to check if there is any fix for this.

[Experimental] Convert SBOM files to, and from, SPDX, CycloneDX and Syft's format. For more info about data loss between formats see https://github.com/anchore/syft#format-conversion-experimental

Usage: convert [SOURCE-SBOM] -o [FORMAT] [flags]

Examples: syft convert img.syft.json -o spdx-json convert a syft SBOM to spdx-json, output goes to stdout in table format, by default syft convert img.syft.json -o cyclonedx-json=img.cdx.json convert a syft SBOM to CycloneDX, output goes to a file named img.cdx.json

Flags: -h, --help help for convert

Global Flags: -c, --config string application config file -q, --quiet suppress all logging output -v, --verbose count increase verbosity (-v = info, -vv = debug)

spiffcs commented 2 years ago

Thanks for the bug update here @gm7y8 - it looks like the flag is not being added during construction anymore which may have been caused during a recent refactor.

Our convert test on the integration side still seems to be passing though - https://github.com/anchore/syft/blob/main/test/integration/convert_test.go

I'll take a look when I can to try and resolve this bug.

spiffcs commented 2 years ago

Confirmed this is working in v0.46.x if you'd like to try it there: https://github.com/anchore/syft/releases/tag/v0.46.3

I'll try and get a release done that is a bug fix for v0.51.0 ==> v0.51.1 that resolves this

gm7y8 commented 2 years ago

@spiffcs thanks.. will try out with v0.46.x

gm7y8 commented 2 years ago

@spiffcs also Json generated using this version seems to not valid spdx json format hitting below error in format

The following warning(s) were raised: [object has missing required properties (["copyrightText"]) for {"pointer":"/packages/0"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/1"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/2"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/3"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/4"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/5"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/6"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/7"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/8"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/9"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/10"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/11"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/12"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/13"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/14"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/15"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/16"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/17"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/18"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/19"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/20"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/21"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/22"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/23"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/24"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/25"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/26"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/27"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/28"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/29"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/30"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/31"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/32"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/33"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/34"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/35"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/36"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/37"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/38"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/39"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/40"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/41"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/42"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/43"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/44"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/45"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/46"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/47"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/48"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/49"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/50"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/51"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/52"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/53"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/54"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/55"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/56"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/57"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/58"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/59"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/60"}, object has missing required properties (["copyrightText"]) for {"pointer":"/packages/61"}, Document must have at least one relationship of type DOCUMENT_DESCRIBES]

robparrott commented 2 years ago

Any eta for the fix here?