Skip to content

Commit

Permalink
chore(go): Drop the support for the Go dep package manager
Browse files Browse the repository at this point in the history
Go dep is depracated as of 2020, see [1]. Meanwhile Go mod is commonly
used instead. So need the need for analyzing Go projects which still use
`dep` as package manager arises only rarely if at all. Stop supporting
Go dep with ORT to reduce maintainance cost.

Note: In order to uprade go to the latest version the Go dep
integration would need to be refactored, because that upgrade currently
breaks tests. So, this change unblocks upgrading Go.

[1] https://github.com/golang/dep

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Apr 4, 2024
1 parent 1a10da7 commit 62b1d2c
Show file tree
Hide file tree
Showing 30 changed files with 4 additions and 875 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docker-ort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
version: "${{ env.GO_VERSION }}"
build-args: |
GO_DEP_VERSION=${{ env.GO_DEP_VERSION }}
GO_VERSION=${{ env.GO_VERSION }}
android_image:
Expand Down
1 change: 0 additions & 1 deletion .versions
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ COMPOSER_VERSION=2.2
CONAN_VERSION=1.63.0
DART_VERSION=2.18.4
DOTNET_VERSION=6.0
GO_DEP_VERSION=0.5.4
GO_VERSION=1.21.6
HASKELL_STACK_VERSION=2.13.1
JAVA_VERSION=17
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,13 @@ COPY --from=rustbuild /opt/rust /opt/rust
# GOLANG - Build as a separate component
FROM base AS gobuild

ARG GO_DEP_VERSION=0.5.4
ARG GO_VERSION=1.21.6
ENV GOBIN=/opt/go/bin
ENV PATH=$PATH:/opt/go/bin

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
&& curl -L https://dl.google.com/go/go$GO_VERSION.linux-$ARCH.tar.gz | tar -C /opt -xz \
&& curl -ksS https://raw.githubusercontent.com/golang/dep/v$GO_DEP_VERSION/install.sh | bash
&& curl -L https://dl.google.com/go/go$GO_VERSION.linux-$ARCH.tar.gz | tar -C /opt -xz

FROM scratch AS golang
COPY --from=gobuild /opt/go /opt/go
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile-legacy
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ ENV \
COMPOSER_VERSION=2.2.6-2ubuntu4 \
CONAN_VERSION=1.63.0 \
DOTNET_VERSION=6.0 \
GO_DEP_VERSION=0.5.4 \
GO_VERSION=1.21.6 \
HASKELL_STACK_VERSION=2.13.1 \
NPM_VERSION=10.1.0 \
Expand Down Expand Up @@ -168,7 +167,6 @@ RUN /opt/ort/bin/export_proxy_certificates.sh /tmp/certificates/ && \
pip install --no-cache-dir conan==$CONAN_VERSION poetry==$PYTHON_POETRY_VERSION pipenv==$PYTHON_PIPENV_VERSION && \
# Install golang in order to have `go mod` as package manager.
curl -ksS https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz | tar -C /opt -xz && \
curl -ksS https://raw.githubusercontent.com/golang/dep/v$GO_DEP_VERSION/install.sh | sh && \
curl -ksS https://raw.githubusercontent.com/commercialhaskell/stack/v$HASKELL_STACK_VERSION/etc/scripts/get-stack.sh | sh && \
mkdir -p $SWIFT_HOME && \
curl -L https://download.swift.org/swift-$SWIFT_VERSION-release/ubuntu2204/swift-$SWIFT_VERSION-RELEASE/swift-$SWIFT_VERSION-RELEASE-ubuntu22.04.tar.gz \
Expand Down
6 changes: 0 additions & 6 deletions analyzer/src/funTest/kotlin/PackageManagerFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class PackageManagerFunTest : WordSpec({
"conan-txt/conanfile.txt",
"dotnet/test.csproj",
"glide/glide.yaml",
"godep/Gopkg.toml",
"godeps/Godeps.json",
"gomod/go.mod",
"gradle-groovy/build.gradle",
"gradle-kotlin/build.gradle.kts",
Expand Down Expand Up @@ -105,10 +103,6 @@ class PackageManagerFunTest : WordSpec({
"conan-py/conanfile.py",
"conan-txt/conanfile.txt"
)
managedFilesByName["GoDep"] should containExactlyInAnyOrder(
"glide/glide.yaml",
"godep/Gopkg.toml", "godeps/Godeps.json"
)
managedFilesByName["GoMod"] should containExactly("gomod/go.mod")
managedFilesByName["Gradle"] should containExactlyInAnyOrder(
"gradle-groovy/build.gradle",
Expand Down
2 changes: 1 addition & 1 deletion examples/example.rules.kts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fun RuleSet.copyleftInSourceLimitedRule() = packageRule("COPYLEFT_LIMITED_IN_SOU
fun RuleSet.dependencyInProjectSourceRule() = projectSourceRule("DEPENDENCY_IN_PROJECT_SOURCE_RULE") {
val denyDirPatterns = listOf(
"**/node_modules" to setOf("NPM", "Yarn", "PNPM"),
"**/vendor" to setOf("GoMod", "GoDep")
"**/vendor" to setOf("GoMod")
)

denyDirPatterns.forEach { (pattern, packageManagers) ->
Expand Down
4 changes: 0 additions & 4 deletions examples/go-dep.ort.yml

This file was deleted.

1 change: 0 additions & 1 deletion integrations/schemas/package-managers-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"CocoaPods",
"Composer",
"Conan",
"GoDep",
"GoMod",
"Gradle",
"GradleInspector",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 62b1d2c

Please sign in to comment.