Skip to content

Commit

Permalink
fix docker images for azure + minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
therecipe committed Dec 29, 2019
1 parent 4ee12d6 commit 1b040f9
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 25 deletions.
6 changes: 5 additions & 1 deletion core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -55182,7 +55182,11 @@ func (ptr *QVariant) ToGoType(dst interface{}) {
}

default:
v.Set(reflect.ValueOf(ptr.ToInterface()).Convert(v.Type()))
if v.Kind() == reflect.String {
v.Set(reflect.ValueOf(ptr.ToString()))
} else {
v.Set(reflect.ValueOf(ptr.ToInterface()).Convert(v.Type()))
}
}
}

Expand Down
6 changes: 5 additions & 1 deletion internal/binding/templater/template_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,11 @@ case QVariant__Map:
}
default:
v.Set(reflect.ValueOf(ptr.ToInterface()).Convert(v.Type()))
if v.Kind() == reflect.String {
v.Set(reflect.ValueOf(ptr.ToString()))
} else {
v.Set(reflect.ValueOf(ptr.ToInterface()).Convert(v.Type()))
}
}
}
`)
Expand Down
3 changes: 3 additions & 0 deletions internal/cmd/minimal/minimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func Minimal(path, target, tags string, skipSetup bool) {
if cmd.ImportsQmlOrQuick() { //TODO: and not deploying + reinstate on moc.moc with deploying ?
if pkg_path := utils.GoQtPkgPath("internal/binding/runtime"); utils.QT_NOT_CACHED() || !utils.ExistsFile(filepath.Join(pkg_path, templater.CgoFileNames(pkg_path, target, templater.MOC)[0])) {
filepath.Walk(pkg_path, func(path string, info os.FileInfo, err error) error {
if err != nil || info.IsDir() {
return err
}
if strings.HasPrefix(info.Name(), "moc_cgo") || strings.HasPrefix(info.Name(), "rcc_cgo") { //rcc_cgo for static linux workaround
os.Remove(path)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/setup/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test(target string, docker, vagrant bool, vagrantsystem string) {
pattern = "all="
}

cmd := exec.Command("go", "test", "-v", "-tags=minimal", fmt.Sprintf("-ldflags=%v\"-s\"", pattern))
cmd := exec.Command("go", "test", "-v", "-tags=minimal", fmt.Sprintf("-ldflags=%v\"-s\"", pattern), "-race")
cmd.Env = append(os.Environ(), []string{"GODEBUG=cgocheck=2", "GO111MODULE=off"}...)
if runtime.GOOS == "linux" {
cmd.Env = append(cmd.Env, "QT_QPA_PLATFORM=offscreen")
Expand Down
18 changes: 10 additions & 8 deletions internal/docker/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ RUN GO=go1.13.4.linux-amd64.tar.gz && curl -sL --retry 10 --retry-delay 60 -O ht
RUN /usr/local/go/bin/go get -tags=no_env github.com/therecipe/qt/cmd/...

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install dbus fontconfig libx11-6 libx11-xcb1
RUN QT=qt-unified-linux-x64-online.run && curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/official_releases/online_installers/$QT && chmod +x $QT && QT_QPA_PLATFORM=minimal ./$QT --no-force-installations --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true
RUN find /opt/Qt/5.13.0 -type f -name "*.debug" -delete
RUN find /opt/Qt/Docs -type f ! -name "*.index" -delete
ENV QT qt-opensource-linux-x64-5.13.0.run
RUN curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/archive/qt/5.13/5.13.0/$QT && chmod +x $QT
RUN QT_QPA_PLATFORM=minimal ./$QT --no-force-installations --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true
RUN find /opt/Qt5.13.0/5.13.0 -type f -name "*.debug" -delete
RUN find /opt/Qt5.13.0/Docs -type f ! -name "*.index" -delete
RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install binutils
RUN find /opt/Qt/5.13.0/gcc_64 -type f ! -name "*.a" ! -name "*.la" ! -name "*.prl" -name "lib*" -exec strip -s {} \;
RUN find /opt/Qt5.13.0/5.13.0/gcc_64 -type f ! -name "*.a" ! -name "*.la" ! -name "*.prl" -name "lib*" -exec strip -s {} \;


FROM ubuntu:16.04
Expand All @@ -23,16 +25,16 @@ ENV USER user
ENV HOME /home/$USER
ENV GOPATH $HOME/work
ENV PATH /usr/local/go/bin:$PATH
ENV QT_DIR /opt/Qt
ENV QT_DIR /opt/Qt5.13.0
ENV QT_DOCKER true
ENV QT_VERSION 5.13.0

COPY --from=base /usr/local/go /usr/local/go
COPY --from=base $GOPATH/bin $GOPATH/bin
COPY --from=base $GOPATH/src/github.com/therecipe/qt $GOPATH/src/github.com/therecipe/qt
COPY --from=base /opt/Qt/5.13.0 /opt/Qt/5.13.0
COPY --from=base /opt/Qt/Docs /opt/Qt/Docs
COPY --from=base /opt/Qt/Licenses /opt/Qt/Licenses
COPY --from=base /opt/Qt5.13.0/5.13.0 /opt/Qt5.13.0/5.13.0
COPY --from=base /opt/Qt5.13.0/Docs /opt/Qt5.13.0/Docs
COPY --from=base /opt/Qt5.13.0/Licenses /opt/Qt5.13.0/Licenses

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install build-essential libglib2.0-dev libglu1-mesa-dev libpulse-dev \
&& apt-get --no-install-recommends -qq -y install fontconfig libasound2 libegl1-mesa libnss3 libpci3 libxcomposite1 libxcursor1 libxi6 libxrandr2 libxtst6 && apt-get -qq clean && apt-get -qq update && apt-get --no-install-recommends -qq -y install fcitx-frontend-qt5 && apt-get -qq clean
Expand Down
16 changes: 9 additions & 7 deletions internal/docker/linux/Dockerfile.512
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ RUN GO=go1.13.4.linux-amd64.tar.gz && curl -sL --retry 10 --retry-delay 60 -O ht
RUN /usr/local/go/bin/go get -tags=no_env github.com/therecipe/qt/cmd/...

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install dbus fontconfig libx11-6 libx11-xcb1
RUN QT=qt-unified-linux-x64-online.run && curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/official_releases/online_installers/$QT && chmod +x $QT && QT_QPA_PLATFORM=minimal ./$QT --no-force-installations --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true VERSION=qt5.5124
RUN find /opt/Qt/5.12.4 -type f -name "*.debug" -delete
RUN find /opt/Qt/Docs -type f ! -name "*.index" -delete
ENV QT qt-opensource-linux-x64-5.12.4.run
RUN curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/archive/qt/5.12/5.12.4/$QT && chmod +x $QT
RUN QT_QPA_PLATFORM=minimal ./$QT --no-force-installations --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true VERSION=qt5.5124
RUN find /opt/Qt5.12.4/5.12.4 -type f -name "*.debug" -delete
RUN find /opt/Qt5.12.4/Docs -type f ! -name "*.index" -delete
RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install binutils
RUN find /opt/Qt/5.12.4/gcc_64 -type f ! -name "*.a" ! -name "*.la" ! -name "*.prl" -name "lib*" -exec strip -s {} \;
RUN find /opt/Qt5.12.4/5.12.4/gcc_64 -type f ! -name "*.a" ! -name "*.la" ! -name "*.prl" -name "lib*" -exec strip -s {} \;


FROM ubuntu:16.04
Expand All @@ -23,15 +25,15 @@ ENV USER user
ENV HOME /home/$USER
ENV GOPATH $HOME/work
ENV PATH /usr/local/go/bin:$PATH
ENV QT_DIR /opt/Qt
ENV QT_DIR /opt/Qt5.12.4
ENV QT_DOCKER true
ENV QT_VERSION 5.12.4

COPY --from=base /usr/local/go /usr/local/go
COPY --from=base $GOPATH/bin $GOPATH/bin
COPY --from=base $GOPATH/src/github.com/therecipe/qt $GOPATH/src/github.com/therecipe/qt
COPY --from=base /opt/Qt/5.12.4 /opt/Qt/5.12.4
COPY --from=base /opt/Qt/Docs /opt/Qt/Docs
COPY --from=base /opt/Qt5.12.4/5.12.4 /opt/Qt5.12.4/5.12.4
COPY --from=base /opt/Qt5.12.4/Docs /opt/Qt5.12.4/Docs

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install build-essential libglib2.0-dev libglu1-mesa-dev libpulse-dev \
&& apt-get --no-install-recommends -qq -y install fontconfig libasound2 libegl1-mesa libnss3 libpci3 libxcomposite1 libxcursor1 libxi6 libxrandr2 libxtst6 && apt-get -qq clean && apt-get -qq update && apt-get --no-install-recommends -qq -y install fcitx-frontend-qt5 && apt-get -qq clean
Expand Down
16 changes: 9 additions & 7 deletions internal/docker/linux/Dockerfile.59
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ RUN GO=go1.13.4.linux-amd64.tar.gz && curl -sL --retry 10 --retry-delay 60 -O ht
RUN /usr/local/go/bin/go get -tags=no_env github.com/therecipe/qt/cmd/...

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install dbus fontconfig libx11-6 libx11-xcb1
RUN QT=qt-unified-linux-x64-online.run && curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/official_releases/online_installers/$QT && chmod +x $QT && QT_QPA_PLATFORM=minimal ./$QT --no-force-installations --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true VERSION=596
RUN find /opt/Qt/5.9.6 -type f -name "*.debug" -delete
RUN find /opt/Qt/Docs -type f ! -name "*.index" -delete
ENV QT qt-opensource-linux-x64-5.9.6.run
RUN curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/archive/qt/5.9/5.9.6/$QT && chmod +x $QT
RUN QT_QPA_PLATFORM=minimal ./$QT --no-force-installations --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true VERSION=596
RUN find /opt/Qt5.9.6/5.9.6 -type f -name "*.debug" -delete
RUN find /opt/Qt5.9.6/Docs -type f ! -name "*.index" -delete
RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install binutils
RUN find /opt/Qt/5.9.6/gcc_64 -type f ! -name "*.a" ! -name "*.la" ! -name "*.prl" -name "lib*" -exec strip -s {} \;
RUN find /opt/Qt5.9.6/5.9.6/gcc_64 -type f ! -name "*.a" ! -name "*.la" ! -name "*.prl" -name "lib*" -exec strip -s {} \;


FROM ubuntu:16.04
Expand All @@ -23,15 +25,15 @@ ENV USER user
ENV HOME /home/$USER
ENV GOPATH $HOME/work
ENV PATH /usr/local/go/bin:$PATH
ENV QT_DIR /opt/Qt
ENV QT_DIR /opt/Qt5.9.6
ENV QT_DOCKER true
ENV QT_VERSION 5.9.6

COPY --from=base /usr/local/go /usr/local/go
COPY --from=base $GOPATH/bin $GOPATH/bin
COPY --from=base $GOPATH/src/github.com/therecipe/qt $GOPATH/src/github.com/therecipe/qt
COPY --from=base /opt/Qt/5.9.6/gcc_64 /opt/Qt/5.9.6/gcc_64
COPY --from=base /opt/Qt/Docs /opt/Qt/Docs
COPY --from=base /opt/Qt5.9.6/5.9.6 /opt/Qt5.9.6/5.9.6
COPY --from=base /opt/Qt5.9.6/Docs /opt/Qt5.9.6/Docs

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install build-essential libglib2.0-dev libglu1-mesa-dev libpulse-dev \
&& apt-get --no-install-recommends -qq -y install fontconfig libasound2 libegl1-mesa libnss3 libpci3 libxcomposite1 libxcursor1 libxi6 libxrandr2 libxtst6 && apt-get -qq clean && apt-get -qq update && apt-get --no-install-recommends -qq -y install fcitx-frontend-qt5 && apt-get -qq clean
Expand Down

0 comments on commit 1b040f9

Please sign in to comment.