Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- add conan.lock to the list #59

Merged
merged 30 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
01e25d0
- add conan.lock to the list
SSE4 Dec 15, 2022
389daee
- conan lockfile parser
SSE4 Dec 18, 2022
73d2a1d
- make CodeQL happy, use explicit uint64 cast
SSE4 Dec 19, 2022
a785811
Merge branch 'main' into patch-1
SSE4 Dec 19, 2022
71b70d2
Merge branch 'main' into patch-1
SSE4 Jan 4, 2023
23094d2
Update pkg/lockfile/parse-conan-lock.go
SSE4 Jan 5, 2023
30a39d6
Update pkg/lockfile/parse-conan-lock.go
SSE4 Jan 6, 2023
591dc67
Merge branch 'main' into patch-1
SSE4 Jan 9, 2023
9f374c0
Update pkg/lockfile/parse-conan-lock.go
SSE4 Jan 9, 2023
351c834
Update pkg/lockfile/parse-conan-lock.go
SSE4 Jan 9, 2023
d70e89c
Update pkg/lockfile/parse-conan-lock.go
SSE4 Jan 9, 2023
a064617
Update pkg/lockfile/parse-conan-lock.go
SSE4 Jan 9, 2023
75d6361
Merge branch 'main' into patch-1
SSE4 Jan 9, 2023
c7f4cbf
Merge branch 'main' into patch-1
SSE4 Jan 9, 2023
93853d2
- skip references with no name
SSE4 Jan 9, 2023
c0d6810
Merge branch 'main' into patch-1
SSE4 Jan 10, 2023
f743185
Merge branch 'main' into patch-1
SSE4 Jan 10, 2023
2366b89
- add test for packages with no name specified
SSE4 Jan 10, 2023
bce6481
Merge branch 'main' into patch-1
SSE4 Jan 11, 2023
c84ce84
Merge branch 'main' into patch-1
SSE4 Jan 12, 2023
b7ffcc7
Merge branch 'main' into patch-1
SSE4 Jan 12, 2023
682fad2
Merge branch 'main' into patch-1
SSE4 Jan 12, 2023
7ea90ed
Merge branch 'main' into patch-1
SSE4 Jan 13, 2023
80f5db3
Update README.md
SSE4 Jan 16, 2023
4b351ef
Update parse_test.go
SSE4 Jan 16, 2023
2aed9ae
Update parse.go
SSE4 Jan 16, 2023
eddf1ff
Merge branch 'main' into patch-1
SSE4 Jan 16, 2023
8a0b95a
Merge branch 'main' into patch-1
SSE4 Jan 17, 2023
df17d69
- fix test
SSE4 Jan 17, 2023
e4aa79a
Merge branch 'main' into patch-1
SSE4 Jan 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ osv-scanner --sbom=/path/to/your/sbom.json

A wide range of lockfiles are supported by utilizing this [lockfile package](https://github.com/google/osv-scanner/tree/main/pkg/lockfile). This is the current list of supported lockfiles:

- `conan.lock`
SSE4 marked this conversation as resolved.
Show resolved Hide resolved
- `Cargo.lock`
- `package-lock.json`
- `packages.lock.json`
Expand Down
1 change: 1 addition & 0 deletions pkg/lockfile/ecosystems.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ func KnownEcosystems() []Ecosystem {
MavenEcosystem,
PipEcosystem,
PubEcosystem,
ConanEcosystem,
}
}
15 changes: 15 additions & 0 deletions pkg/lockfile/fixtures/conan/empty.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"graph_lock": {
"nodes": {
"0": {
"ref": "test/1.0",
"options": "fPIC=True\nshared=False",
"path": "conanfile.py",
"context": "host"
}
},
"revisions_enabled": false
},
"version": "0.4",
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n"
}
15 changes: 15 additions & 0 deletions pkg/lockfile/fixtures/conan/empty.v1.revisions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"graph_lock": {
"nodes": {
"0": {
"ref": "test/1.0",
"options": "fPIC=True\nshared=False",
"path": "conanfile.py",
"context": "host"
}
},
"revisions_enabled": true
},
"version": "0.4",
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n"
}
6 changes: 6 additions & 0 deletions pkg/lockfile/fixtures/conan/empty.v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "0.5",
"requires": [],
"build_requires": [],
"python_requires": []
}
62 changes: 62 additions & 0 deletions pkg/lockfile/fixtures/conan/nested-dependencies.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"graph_lock": {
"nodes": {
"0": {
"ref": "test/1.0",
"options": "fPIC=True\nshared=False\nbrotli:enable_debug=False\nbrotli:enable_log=False\nbrotli:enable_portable=False\nbrotli:enable_rbit=True\nbrotli:endianness=None\nbrotli:fPIC=True\nbrotli:shared=False\nbrotli:target_bits=None\nbzip2:build_executable=True\nbzip2:fPIC=True\nbzip2:shared=False\nfreetype:fPIC=True\nfreetype:shared=False\nfreetype:subpixel=False\nfreetype:with_brotli=True\nfreetype:with_bzip2=True\nfreetype:with_png=True\nfreetype:with_zlib=True\nlibpng:api_prefix=\nlibpng:fPIC=True\nlibpng:shared=False\nlibpng:sse=True\nzlib:fPIC=True\nzlib:shared=False",
"requires": [
"1"
],
"path": "conanfile.py",
"context": "host"
},
"1": {
"ref": "freetype/2.12.1",
"options": "fPIC=True\nshared=False\nsubpixel=False\nwith_brotli=True\nwith_bzip2=True\nwith_png=True\nwith_zlib=True\nbrotli:enable_debug=False\nbrotli:enable_log=False\nbrotli:enable_portable=False\nbrotli:enable_rbit=True\nbrotli:endianness=None\nbrotli:fPIC=True\nbrotli:shared=False\nbrotli:target_bits=None\nbzip2:build_executable=True\nbzip2:fPIC=True\nbzip2:shared=False\nlibpng:api_prefix=\nlibpng:fPIC=True\nlibpng:shared=False\nlibpng:sse=True\nzlib:fPIC=True\nzlib:shared=False",
"package_id": "bca7b8880d98719d556dd526ce612be20a815922",
"prev": "0",
"requires": [
"2",
"3",
"4",
"5"
],
"context": "host"
},
"2": {
"ref": "libpng/1.6.39",
"options": "api_prefix=\nfPIC=True\nshared=False\nsse=True\nzlib:fPIC=True\nzlib:shared=False",
"package_id": "d5b3dc27faecfb4eb94086722000dd65bb9e6bff",
"prev": "0",
"requires": [
"3"
],
"context": "host"
},
"3": {
"ref": "zlib/1.2.13",
"options": "fPIC=True\nshared=False",
"package_id": "19729b9559f3ae196cad45cb2b97468ccb75dcd1",
"prev": "0",
"context": "host"
},
"4": {
"ref": "bzip2/1.0.8",
"options": "build_executable=True\nfPIC=True\nshared=False",
"package_id": "91a8b22c2c5a149bc617cfc06cdd21bf23b12567",
"prev": "0",
"context": "host"
},
"5": {
"ref": "brotli/1.0.9",
"options": "enable_debug=False\nenable_log=False\nenable_portable=False\nenable_rbit=True\nendianness=None\nfPIC=True\nshared=False\ntarget_bits=None",
"package_id": "bfdbb855937046dc347fec082c59cb7f733e8855",
"prev": "0",
"context": "host"
}
},
"revisions_enabled": false
},
"version": "0.4",
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n"
}
62 changes: 62 additions & 0 deletions pkg/lockfile/fixtures/conan/nested-dependencies.v1.revisions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"graph_lock": {
"nodes": {
"0": {
"ref": "test/1.0",
"options": "fPIC=True\nshared=False\nbrotli:enable_debug=False\nbrotli:enable_log=False\nbrotli:enable_portable=False\nbrotli:enable_rbit=True\nbrotli:endianness=None\nbrotli:fPIC=True\nbrotli:shared=False\nbrotli:target_bits=None\nbzip2:build_executable=True\nbzip2:fPIC=True\nbzip2:shared=False\nfreetype:fPIC=True\nfreetype:shared=False\nfreetype:subpixel=False\nfreetype:with_brotli=True\nfreetype:with_bzip2=True\nfreetype:with_png=True\nfreetype:with_zlib=True\nlibpng:api_prefix=\nlibpng:fPIC=True\nlibpng:shared=False\nlibpng:sse=True\nzlib:fPIC=True\nzlib:shared=False",
"requires": [
"1"
],
"path": "conanfile.py",
"context": "host"
},
"1": {
"ref": "freetype/2.12.1#7e1b67634f54f38a979bbad44fd09a2c",
"options": "fPIC=True\nshared=False\nsubpixel=False\nwith_brotli=True\nwith_bzip2=True\nwith_png=True\nwith_zlib=True\nbrotli:enable_debug=False\nbrotli:enable_log=False\nbrotli:enable_portable=False\nbrotli:enable_rbit=True\nbrotli:endianness=None\nbrotli:fPIC=True\nbrotli:shared=False\nbrotli:target_bits=None\nbzip2:build_executable=True\nbzip2:fPIC=True\nbzip2:shared=False\nlibpng:api_prefix=\nlibpng:fPIC=True\nlibpng:shared=False\nlibpng:sse=True\nzlib:fPIC=True\nzlib:shared=False",
"package_id": "bca7b8880d98719d556dd526ce612be20a815922",
"prev": "400c9a65b20f791ea05c47eb6817e80a",
"requires": [
"2",
"3",
"4",
"5"
],
"context": "host"
},
"2": {
"ref": "libpng/1.6.39#7927e8ce5b2576a6ea497c6ca70e9751",
"options": "api_prefix=\nfPIC=True\nshared=False\nsse=True\nzlib:fPIC=True\nzlib:shared=False",
"package_id": "d5b3dc27faecfb4eb94086722000dd65bb9e6bff",
"prev": "3e3b7f79b03c52ab932089560ea2eb56",
"requires": [
"3"
],
"context": "host"
},
"3": {
"ref": "zlib/1.2.13#13c96f538b52e1600c40b88994de240f",
"options": "fPIC=True\nshared=False",
"package_id": "19729b9559f3ae196cad45cb2b97468ccb75dcd1",
"prev": "562e6cc3d7987119418780e5c5697342",
"context": "host"
},
"4": {
"ref": "bzip2/1.0.8#464be69744fa6d48ed01928cfe470008",
"options": "build_executable=True\nfPIC=True\nshared=False",
"package_id": "91a8b22c2c5a149bc617cfc06cdd21bf23b12567",
"prev": "94d2f51be78e63879215a3b2ba014fda",
"context": "host"
},
"5": {
"ref": "brotli/1.0.9#4bfbb302b87df342ccd6a2b5fdad307a",
"options": "enable_debug=False\nenable_log=False\nenable_portable=False\nenable_rbit=True\nendianness=None\nfPIC=True\nshared=False\ntarget_bits=None",
"package_id": "bfdbb855937046dc347fec082c59cb7f733e8855",
"prev": "c2eaa7784f2988c35d8b8925a783e73b",
"context": "host"
}
},
"revisions_enabled": true
},
"version": "0.4",
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n"
}
12 changes: 12 additions & 0 deletions pkg/lockfile/fixtures/conan/nested-dependencies.v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.5",
"requires": [
"zlib/1.2.13#13c96f538b52e1600c40b88994de240f%1667396813.733",
"libpng/1.6.39#7927e8ce5b2576a6ea497c6ca70e9751%1669038072.946",
"freetype/2.12.1#7e1b67634f54f38a979bbad44fd09a2c%1669913185.923",
"bzip2/1.0.8#464be69744fa6d48ed01928cfe470008%1666580345.213",
"brotli/1.0.9#4bfbb302b87df342ccd6a2b5fdad307a%1661519995.45"
],
"build_requires": [],
"python_requires": []
}
1 change: 1 addition & 0 deletions pkg/lockfile/fixtures/conan/not-json.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this is not json!
18 changes: 18 additions & 0 deletions pkg/lockfile/fixtures/conan/old-format-0.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"profile": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n",
"graph_lock": {
"nodes": {
"05b715be-7ec7-11ed-8a66-b537134a228d": {
"pref": null,
"options": "zlib:fPIC=True\nzlib:minizip=False\nzlib:shared=False",
"requires": {
"zlib/1.2.11@bincrafters/testing#5f4917ce0a630b102f472afd00102d40": "05b715bd-7ec7-11ed-8a66-b537134a228d"
}
},
"05b715bd-7ec7-11ed-8a66-b537134a228d": {
"pref": "zlib/1.2.11@bincrafters/testing#5f4917ce0a630b102f472afd00102d40:19729b9559f3ae196cad45cb2b97468ccb75dcd1#58846c4ed127f63e9c88c5be5190a6d9",
"options": "fPIC=True\nminizip=False\nshared=False"
}
}
}
}
20 changes: 20 additions & 0 deletions pkg/lockfile/fixtures/conan/old-format-0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n",
"graph_lock": {
"nodes": {
"1058d05a-7ec6-11ed-8a66-b537134a228d": {
"pref": "test/1.0:2ce08bf790c58b729dda567426e810ed5e35e513",
"options": "fPIC=True\nshared=False\nzlib:fPIC=True\nzlib:minizip=False\nzlib:shared=False",
"requires": {
"zlib/1.2.11#5f4917ce0a630b102f472afd00102d40": "1058d059-7ec6-11ed-8a66-b537134a228d"
},
"path": "/home/sse4/projects/conan_test/v1/conanfile.py"
},
"1058d059-7ec6-11ed-8a66-b537134a228d": {
"pref": "zlib/1.2.11#5f4917ce0a630b102f472afd00102d40:19729b9559f3ae196cad45cb2b97468ccb75dcd1#58846c4ed127f63e9c88c5be5190a6d9",
"options": "fPIC=True\nminizip=False\nshared=False"
}
}
},
"version": "0.1"
}
20 changes: 20 additions & 0 deletions pkg/lockfile/fixtures/conan/old-format-0.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n",
"graph_lock": {
"nodes": {
"0": {
"pref": "test/1.0:2ce08bf790c58b729dda567426e810ed5e35e513",
"options": "fPIC=True\nshared=False\nzlib:fPIC=True\nzlib:minizip=False\nzlib:shared=False",
"requires": {
"zlib/1.2.11#5f4917ce0a630b102f472afd00102d40": "1"
},
"path": "/home/sse4/projects/conan_test/v1/conanfile.py"
},
"1": {
"pref": "zlib/1.2.11#5f4917ce0a630b102f472afd00102d40:19729b9559f3ae196cad45cb2b97468ccb75dcd1#58846c4ed127f63e9c88c5be5190a6d9",
"options": "fPIC=True\nminizip=False\nshared=False"
}
}
},
"version": "0.2"
}
21 changes: 21 additions & 0 deletions pkg/lockfile/fixtures/conan/old-format-0.3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n",
"graph_lock": {
"nodes": {
"0": {
"pref": "test/1.0:2ce08bf790c58b729dda567426e810ed5e35e513",
"options": "fPIC=True\nshared=False\nzlib:fPIC=True\nzlib:minizip=False\nzlib:shared=False",
"requires": [
"1"
],
"path": "/home/sse4/projects/conan_test/v1/conanfile.py"
},
"1": {
"pref": "zlib/1.2.11#5f4917ce0a630b102f472afd00102d40:19729b9559f3ae196cad45cb2b97468ccb75dcd1#58846c4ed127f63e9c88c5be5190a6d9",
"options": "fPIC=True\nminizip=False\nshared=False",
"modified": "built"
}
}
},
"version": "0.3"
}
25 changes: 25 additions & 0 deletions pkg/lockfile/fixtures/conan/one-package-dev.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"graph_lock": {
"nodes": {
"0": {
"ref": "test/1.0",
"options": "fPIC=True\nshared=False",
"build_requires": [
"1"
],
"path": "conanfile.py",
"context": "host"
},
"1": {
"ref": "ninja/1.11.1",
"options": "",
"package_id": "24647d9fe8ec489125dfbae4b3ebefaf7581674c",
"prev": "0",
"context": "host"
}
},
"revisions_enabled": false
},
"version": "0.4",
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n"
}
25 changes: 25 additions & 0 deletions pkg/lockfile/fixtures/conan/one-package-dev.v1.revisions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"graph_lock": {
"nodes": {
"0": {
"ref": "test/1.0",
"options": "fPIC=True\nshared=False",
"build_requires": [
"1"
],
"path": "conanfile.py",
"context": "host"
},
"1": {
"ref": "ninja/1.11.1#a2f0b832705907016f336839f96963f8",
"options": "",
"package_id": "24647d9fe8ec489125dfbae4b3ebefaf7581674c",
"prev": "d894345ae9996c9b97f1cb4150051c25",
"context": "host"
}
},
"revisions_enabled": true
},
"version": "0.4",
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n"
}
8 changes: 8 additions & 0 deletions pkg/lockfile/fixtures/conan/one-package-dev.v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "0.5",
"requires": [],
"build_requires": [
"ninja/1.11.1#a2f0b832705907016f336839f96963f8%1667050636.338"
],
"python_requires": []
}
25 changes: 25 additions & 0 deletions pkg/lockfile/fixtures/conan/one-package.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"graph_lock": {
"nodes": {
"0": {
"ref": "test/1.0",
"options": "fPIC=True\nshared=False\nzlib:fPIC=True\nzlib:shared=False",
"requires": [
"1"
],
"path": "conanfile.py",
"context": "host"
},
"1": {
"ref": "zlib/1.2.11",
"options": "fPIC=True\nshared=False",
"package_id": "19729b9559f3ae196cad45cb2b97468ccb75dcd1",
"prev": "0",
"context": "host"
}
},
"revisions_enabled": false
},
"version": "0.4",
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++\ncompiler.version=10\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\n"
}
Loading