Skip to content

Commit

Permalink
Install golang from source not pkg manager
Browse files Browse the repository at this point in the history
Install golang from source not pkg manager

Signed-off-by: Milosz Linkiewicz <[email protected]>
  • Loading branch information
Mionsz committed Dec 19, 2024
1 parent a167b70 commit 303b49b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/setup_build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ function install_package_dependencies()
log_error "Exiting: No supported package manager found. Contact support"
exit 1
fi
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
log_info "Finished: Successful OS packages installation."
log_warning OS reboot is required for all of the changes to take place.
return 0
Expand All @@ -58,7 +56,6 @@ function install_ubuntu_package_dependencies()
curl \
dracut \
gcc-multilib \
golang \
libbsd-dev \
libcap-ng-dev \
libelf-dev \
Expand Down Expand Up @@ -88,6 +85,7 @@ function install_ubuntu_package_dependencies()
zlib1g-dev \
"${APT_LINUX_HEADERS}" \
"${APT_LINUX_MOD_EXTRA}" && \
lib_build_and_install_golang && \
return 0 || return 1
}

Expand All @@ -112,7 +110,6 @@ function install_yum_package_dependencies()
git \
glibc-devel.i686 \
glibc-devel.x86_64 \
golang \
gtest-devel \
intel-ipp-crypto-mb \
intel-ipsec-mb \
Expand Down Expand Up @@ -151,6 +148,7 @@ function install_yum_package_dependencies()
lib_install_nasm_from_rpm && \
lib_build_and_install_libfdt && \
lib_build_and_install_jsonc && \
lib_build_and_install_golang && \
return 0 || return 1
}

Expand Down Expand Up @@ -196,6 +194,16 @@ function lib_build_and_install_jsonc()
as_root make -j "${NPROC}" -C "${JSONC_DIR}/json-c-build" install
}

# Get and install golang from source
function lib_build_and_install_golang()
{
as_root wget_download_strip_unpack "https://go.dev/dl/go1.23.4.linux-amd64.tar.gz" "/usr/local/go/"
as_root ln -s /usr/local/go/bin/go /usr/bin/go
go version
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
}

# Build the xdp-tools project with ebpf
function lib_install_xdp_bpf_tools()
{
Expand Down

0 comments on commit 303b49b

Please sign in to comment.