Skip to content

Cross compile gopls#119

Merged
robmck1995 merged 1 commit intomainfrom
rob
Jan 27, 2025
Merged

Cross compile gopls#119
robmck1995 merged 1 commit intomainfrom
rob

Conversation

@robmck1995
Copy link
Copy Markdown
Contributor

@robmck1995 robmck1995 commented Jan 27, 2025

CodeAnt-AI Description

  • Updated the Go version from 1.21.4 to 1.23.5 in both Dockerfiles to ensure the use of the latest features and security updates.
  • Introduced cross-compilation support in release/Dockerfile by adding a TARGETARCH argument and conditionally copying the gopls binary based on the target architecture.
  • Changed the installation path of gopls to /usr/bin in lsproxy/Dockerfile for consistency.
  • Set DEBIAN_FRONTEND to noninteractive in release/Dockerfile to streamline package installations.

Changes walkthrough

Relevant files
Enhancement
Dockerfile
Update Go version and adjust `gopls` installation path                 

lsproxy/Dockerfile

  • Updated Go version from 1.21.4 to 1.23.5.
  • Changed installation path for gopls from /usr/local/bin to /usr/bin.
  • +4/-4     
    Configuration changes
    Dockerfile
    Cross-compile support and Go version update                                       

    release/Dockerfile

  • Added TARGETARCH argument for cross-compilation.
  • Updated Go version from 1.21.4 to 1.23.5.
  • Implemented conditional copying of gopls based on architecture.
  • Set DEBIAN_FRONTEND to noninteractive to streamline installations.
  • +21/-5   

    🔍 Infra Scan Results:
    Failed Dockerfile Checks
    Check NameFile PathLines
    Ensure that APT isn't usedlsproxy/Dockerfile90-92
    Ensure that HEALTHCHECK instructions have been added to container imageslsproxy/Dockerfile1-117
    Ensure that a user for the container has been createdlsproxy/Dockerfile1-117
    Ensure that APT isn't usedrelease/Dockerfile163-165
    Ensure that HEALTHCHECK instructions have been added to container imagesrelease/Dockerfile1-195
    Ensure that a user for the container has been createdrelease/Dockerfile1-195
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Retrigger review

    Ask CodeAnt AI to review the PR again, by typing:

    @codeant-ai: review
    

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    @codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jan 27, 2025
    @codeant-ai
    Copy link
    Copy Markdown
    Contributor

    codeant-ai Bot commented Jan 27, 2025

    Pull Request Feedback 🔍

    🔒 No security issues identified
    ⚡ Recommended areas for review

    Code Smell
    The use of ~/go/bin/gopls in the cp command assumes that the GOPATH is set to the default location. This could lead to issues if the GOPATH is changed in the future or if the environment is different.

    Code Smell
    The cp command for gopls based on TARGETARCH uses hardcoded paths like linux_amd64 and linux_arm64. This could lead to maintenance issues if more architectures are added or if the directory structure changes.

    Comment thread release/Dockerfile
    ;; \
    esac

    RUN curl -O -L "https://go.dev/dl/go1.23.5.linux-${BUILDARCH}.tar.gz" && \
    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggestion: Consider adding error handling for the curl command to ensure the download is successful before proceeding with extraction. [best practice]

    Suggested change
    RUN curl -O -L "https://go.dev/dl/go1.23.5.linux-${BUILDARCH}.tar.gz" && \
    RUN curl -f -O -L "https://go.dev/dl/go1.23.5.linux-${BUILDARCH}.tar.gz" && \

    @robmck1995 robmck1995 merged commit b068a79 into main Jan 27, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    size:S This PR changes 10-29 lines, ignoring generated files

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants