Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-33679

Provide a way to compile gocmdbridge without Internet access

XMLWordPrintable

    • 7239868e5 (18.0)

      The new Remote Linux support using gocmdbridge builds directly using Go:

      src/libs/gocmdbridge/server/CMakeLists.txt
                  if ((${PLATFORM} STREQUAL "linux" OR (${PLATFORM} STREQUAL "windows" AND ${ARCHITECTURE} STREQUAL "amd64")) AND NOT UPX_BIN STREQUAL "UPX_BIN-NOTFOUND")
                      add_custom_command(
                          OUTPUT "${OUTPUT}"
                          COMMAND ${CMAKE_COMMAND} -E env GOARCH=${ARCHITECTURE} GOOS=${PLATFORM} CGO_ENABLED=0 ${GO_BIN} build -ldflags "-s -w ${LDFLAGS}" -o ${OUTPUT}
                          COMMAND ${UPX_BIN} -9 ${OUTPUT}
                          DEPENDS ${SOURCES}
                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                          COMMENT "Building ${TARGET_NAME}"
                          VERBATIM
      
                      )
                  else()
                      add_custom_command(
                          OUTPUT "${OUTPUT}"
                          COMMAND ${CMAKE_COMMAND} -E env GOARCH=${ARCHITECTURE} GOOS=${PLATFORM} CGO_ENABLED=0 ${GO_BIN} build -ldflags "-s -w ${LDFLAGS}" -o ${OUTPUT}
                          DEPENDS ${SOURCES}
                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                          COMMENT "Building ${TARGET_NAME}"
                          VERBATIM
                      )
                  endif()
      

      I noticed this because it downloaded stuff from the Internet on my workstation and printed information about it. That is not acceptable while building packages.

      Building Go packages offline involves pre-downloading all the dependencies and "vendoring" them. During build, one then passes -mod=vendor to tell the Go compiler to use those pre-downloaded content. See how rclone is built, for example, for openSUSE and Fedora.

      Creating the vendor.tar.gz file is out of scope and easily solved by anyone who has packaged Go. What needs changing is the ability to pass the necessary options to the Go compiler. Please include that in the README.md.

      You may also suggest that they compile the server executable manually, directly using go build.

        For Gerrit Dashboard: QTCREATORBUG-33679
        # Subject Branch Project Status CR V

            con Eike Ziller
            thiago Thiago Macieira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes