-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt Creator 18.0.0
-
None
-
7239868e5 (18.0)
The new Remote Linux support using gocmdbridge builds directly using Go:
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 |
| 687220,4 | CmdBridge: Add vendor mode option | 18.0 | qt-creator/qt-creator | Status: MERGED | +2 | +1 |