-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Julia language analyzer support (#5635)
- Loading branch information
1 parent
7c22ee3
commit fecafb1
Showing
31 changed files
with
849 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ jobs: | |
swift | ||
bitnami | ||
conda | ||
julia | ||
os | ||
lang | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,7 @@ language: | |
- go | ||
- elixir | ||
- dart | ||
- julia | ||
|
||
vuln: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Julia | ||
|
||
## Features | ||
|
||
Trivy supports [Pkg.jl](https://pkgdocs.julialang.org/v1/), which is the Julia package manager. | ||
The following table provides an outline of the features Trivy offers. | ||
|
||
| Package manager | File | Transitive dependencies | Dev dependencies | License | Dependency graph | Position | | ||
| --------------- | ------------- | :---------------------: | :--------------- | :-----: | :--------------: | :------: | | ||
| Pkg.jl | Manifest.toml | ✅ | Excluded[^1] | - | ✅ | ✅ | | ||
|
||
### Pkg.jl | ||
|
||
Trivy searches for `Manifest.toml` to detect dependencies. | ||
|
||
Trivy also supports dependency trees; however, to display an accurate tree, it needs to know whether each package is a direct dependency of the project. | ||
Since this information is not included in `Manifest.toml`, Trivy parses `Project.toml`, which should be located next to `Project.toml`. | ||
If you want to see the dependency tree, please ensure that `Project.toml` is present. | ||
|
||
Scanning `Manifest.toml` and `Project.toml` together also removes developer dependencies. | ||
|
||
Dependency extensions are currently ignored. | ||
|
||
[^1]: When you scan `Manifest.toml` and `Project.toml` together. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file is machine-generated - editing it directly is not advised | ||
|
||
julia_version = "1.9.0" | ||
manifest_format = "2.0" | ||
project_hash = "f0a796fb78285c02ad123fec6e14c8bac09a2ccc" | ||
|
||
[[deps.A]] | ||
uuid = "ead4f63c-334e-11e9-00e6-e7f0a5f21b60" | ||
|
||
[deps.A.deps] | ||
B = "f41f7b98-334e-11e9-1257-49272045fb24" | ||
|
||
[[deps.B]] | ||
uuid = "f41f7b98-334e-11e9-1257-49272045fb24" | ||
[[deps.B]] | ||
uuid = "edca9bc6-334e-11e9-3554-9595dbb4349c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name = "packageName" | ||
uuid = "1c653b0a-0b5a-4cff-b25a-92f0db012773" | ||
version = "0.1.0" | ||
|
||
[deps] | ||
A = "ead4f63c-334e-11e9-00e6-e7f0a5f21b60" | ||
B = "edca9bc6-334e-11e9-3554-9595dbb4349c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
{ | ||
"spdxVersion": "SPDX-2.3", | ||
"dataLicense": "CC0-1.0", | ||
"SPDXID": "SPDXRef-DOCUMENT", | ||
"name": "testdata/fixtures/repo/julia", | ||
"documentNamespace": "http://aquasecurity.github.io/trivy/filesystem/testdata/fixtures/repo/julia-3ff14136-e09f-4df9-80ea-000000000006", | ||
"creationInfo": { | ||
"creators": [ | ||
"Organization: aquasecurity", | ||
"Tool: trivy-dev" | ||
], | ||
"created": "2021-08-25T12:20:30Z" | ||
}, | ||
"packages": [ | ||
{ | ||
"name": "Manifest.toml", | ||
"SPDXID": "SPDXRef-Application-18fc3597717a3e56", | ||
"downloadLocation": "NONE", | ||
"filesAnalyzed": false, | ||
"attributionTexts": [ | ||
"Class: lang-pkgs", | ||
"Type: julia" | ||
], | ||
"primaryPackagePurpose": "APPLICATION" | ||
}, | ||
{ | ||
"name": "A", | ||
"SPDXID": "SPDXRef-Package-2a46714189f3b9de", | ||
"versionInfo": "1.9.0", | ||
"supplier": "NOASSERTION", | ||
"downloadLocation": "NONE", | ||
"filesAnalyzed": false, | ||
"sourceInfo": "package found in: Manifest.toml", | ||
"licenseConcluded": "NONE", | ||
"licenseDeclared": "NONE", | ||
"externalRefs": [ | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:julia/[email protected]?uuid=ead4f63c-334e-11e9-00e6-e7f0a5f21b60" | ||
} | ||
], | ||
"attributionTexts": [ | ||
"PkgID: ead4f63c-334e-11e9-00e6-e7f0a5f21b60", | ||
"PkgType: julia" | ||
], | ||
"primaryPackagePurpose": "LIBRARY" | ||
}, | ||
{ | ||
"name": "B", | ||
"SPDXID": "SPDXRef-Package-4a8e351c4c9b7318", | ||
"versionInfo": "1.9.0", | ||
"supplier": "NOASSERTION", | ||
"downloadLocation": "NONE", | ||
"filesAnalyzed": false, | ||
"sourceInfo": "package found in: Manifest.toml", | ||
"licenseConcluded": "NONE", | ||
"licenseDeclared": "NONE", | ||
"externalRefs": [ | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:julia/[email protected]?uuid=edca9bc6-334e-11e9-3554-9595dbb4349c" | ||
} | ||
], | ||
"attributionTexts": [ | ||
"PkgID: edca9bc6-334e-11e9-3554-9595dbb4349c", | ||
"PkgType: julia" | ||
], | ||
"primaryPackagePurpose": "LIBRARY" | ||
}, | ||
{ | ||
"name": "B", | ||
"SPDXID": "SPDXRef-Package-d10d5e4a30a43fff", | ||
"versionInfo": "1.9.0", | ||
"supplier": "NOASSERTION", | ||
"downloadLocation": "NONE", | ||
"filesAnalyzed": false, | ||
"sourceInfo": "package found in: Manifest.toml", | ||
"licenseConcluded": "NONE", | ||
"licenseDeclared": "NONE", | ||
"externalRefs": [ | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:julia/[email protected]?uuid=f41f7b98-334e-11e9-1257-49272045fb24" | ||
} | ||
], | ||
"attributionTexts": [ | ||
"PkgID: f41f7b98-334e-11e9-1257-49272045fb24", | ||
"PkgType: julia" | ||
], | ||
"primaryPackagePurpose": "LIBRARY" | ||
}, | ||
{ | ||
"name": "testdata/fixtures/repo/julia", | ||
"SPDXID": "SPDXRef-Filesystem-1be792dd0077c431", | ||
"downloadLocation": "NONE", | ||
"filesAnalyzed": false, | ||
"attributionTexts": [ | ||
"SchemaVersion: 2" | ||
], | ||
"primaryPackagePurpose": "SOURCE" | ||
} | ||
], | ||
"relationships": [ | ||
{ | ||
"spdxElementId": "SPDXRef-Application-18fc3597717a3e56", | ||
"relatedSpdxElement": "SPDXRef-Package-2a46714189f3b9de", | ||
"relationshipType": "CONTAINS" | ||
}, | ||
{ | ||
"spdxElementId": "SPDXRef-Application-18fc3597717a3e56", | ||
"relatedSpdxElement": "SPDXRef-Package-4a8e351c4c9b7318", | ||
"relationshipType": "CONTAINS" | ||
}, | ||
{ | ||
"spdxElementId": "SPDXRef-Application-18fc3597717a3e56", | ||
"relatedSpdxElement": "SPDXRef-Package-d10d5e4a30a43fff", | ||
"relationshipType": "CONTAINS" | ||
}, | ||
{ | ||
"spdxElementId": "SPDXRef-DOCUMENT", | ||
"relatedSpdxElement": "SPDXRef-Filesystem-1be792dd0077c431", | ||
"relationshipType": "DESCRIBES" | ||
}, | ||
{ | ||
"spdxElementId": "SPDXRef-Filesystem-1be792dd0077c431", | ||
"relatedSpdxElement": "SPDXRef-Application-18fc3597717a3e56", | ||
"relationshipType": "CONTAINS" | ||
}, | ||
{ | ||
"spdxElementId": "SPDXRef-Package-2a46714189f3b9de", | ||
"relatedSpdxElement": "SPDXRef-Package-d10d5e4a30a43fff", | ||
"relationshipType": "DEPENDS_ON" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
pkg/dependency/parser/julia/manifest/testdata/julia_v1.0_format/Manifest.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[[Foo]] | ||
deps = ["Bar", "Baz", "Qux"] | ||
uuid = "767738be-2f1f-45a9-b806-0234f3164144" | ||
git-tree-sha1 = "7c626031568a5e432112a74009c3763f9b851e3e" | ||
path = "deps/Foo1" | ||
|
||
[[Foo]] | ||
deps = ["Qux"] | ||
uuid = "6f418443-bd2e-4783-b551-cdbac608adf2" | ||
path = "deps/Foo2.jl" | ||
|
||
[[Bar]] | ||
uuid = "2a550a13-6bab-4a91-a4ee-dff34d6b99d0" | ||
path = "deps/Bar" | ||
[Bar.deps] | ||
Baz = "6801f525-dc68-44e8-a4e8-cabd286279e7" | ||
Foo = "6f418443-bd2e-4783-b551-cdbac608adf2" | ||
|
||
[[Baz]] | ||
uuid = "6801f525-dc68-44e8-a4e8-cabd286279e7" | ||
git-tree-sha1 = "efc7e24c53d6a328011975294a2c75fed2f9800a" | ||
[Baz.deps] | ||
Foo = "6f418443-bd2e-4783-b551-cdbac608adf2" | ||
Qux = "b5ec9b9c-e354-47fd-b367-a348bdc8f909" | ||
|
||
[[Qux]] | ||
uuid = "b5ec9b9c-e354-47fd-b367-a348bdc8f909" | ||
path = "deps/Qux.jl" |
6 changes: 6 additions & 0 deletions
6
pkg/dependency/parser/julia/manifest/testdata/julia_v1.0_format/Project.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name = "TestProject" | ||
uuid = "84c38c17-0c6f-4d12-a694-d20b69c16777" | ||
|
||
[deps] | ||
Foo = "767738be-2f1f-45a9-b806-0234f3164144" | ||
Bar = "2a550a13-6bab-4a91-a4ee-dff34d6b99d0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.