From 9420de5931cb1a978eaad6d642a768b63024dbcf Mon Sep 17 00:00:00 2001 From: tao wang Date: Wed, 1 Mar 2023 12:27:41 +0800 Subject: [PATCH 1/9] FIX:fixed Lan mode printer will disconnection after connection Change-Id: Ifa81f35f4d4f58626fc74f9d092a8a1b4d10fb0d --- src/slic3r/GUI/DeviceManager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 98e2610bf6..926242061c 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -3966,6 +3966,8 @@ bool DeviceManager::set_selected_machine(std::string dev_id) auto last_selected = my_machine_list.find(selected_machine); if (last_selected != my_machine_list.end()) { if (last_selected->second->connection_type() == "lan") { + if (last_selected->second->is_connecting()) + return false; m_agent->disconnect_printer(); } } From 69573c9b017708d5645edd8159eb5fa5b432fc63 Mon Sep 17 00:00:00 2001 From: gerrit Date: Wed, 1 Mar 2023 14:06:31 +0800 Subject: [PATCH 2/9] ci: update build version to 01.05.00.59 Change-Id: I2f74a48b30833d295fee2a3383e7d46ce9c08720 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 07e7942a29..7783f6103c 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.05.00.58") +set(SLIC3R_VERSION "01.05.00.59") From a64085f165617130e9007c0cbbb89f188876f5bd Mon Sep 17 00:00:00 2001 From: Cal Heldenbrand Date: Wed, 22 Feb 2023 12:13:05 -0600 Subject: [PATCH 3/9] Copy Containerfile to Dockerfile before modifying --- Dockerfile | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..4969b3dede --- /dev/null +++ b/Dockerfile @@ -0,0 +1,71 @@ +# Build Bambu Slicer in a container +# +# Build an AppImage using rootless Podman (refer to https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md): +# rm -rf build; podman build . -t bambu-studio-builder && podman run --rm localhost/bambu-studio-builder /bin/bash -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv +# +# Troubleshooting the build container: +# podman run -it --name bambu-studio-builder localhost/bambu-studio-builder /bin/bash +# +# Debugging the resulting AppImage: +# 1) Install `gdb` +# 2) In a terminal in the same directory as the AppImage, start it with following: +# echo -e "run\nbt\nquit" | gdb ./BambuStudio_ubu64.AppImage +# 3) Find related issue using backtrace output for clues and add backtrace to it on github +# +# Docker alternative AppImage build syntax (use this if you can't install podman): +# rm -rf build; docker build . --file Containerfile -t bambu-studio-builder; docker run --rm bambu-studio-builder /bin/bash -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv +# +# +# TODO: bind mount BambuStudio to inside the container instead of COPY to enable faster rebuilds during dev work. + +FROM docker.io/ubuntu:20.04 +LABEL maintainer "DeftDawg " + +# Disable interactive package configuration +RUN apt-get update && \ + echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +# Add a deb-src +RUN echo deb-src http://archive.ubuntu.com/ubuntu \ + $(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) main universe>> /etc/apt/sources.list + +RUN apt-get update && apt-get install -y \ + git \ + build-essential \ + autoconf pkgconf m4 \ + cmake extra-cmake-modules \ + libglu1-mesa-dev libglu1-mesa-dev \ + libwayland-dev libxkbcommon-dev wayland-protocols \ + eglexternalplatform-dev libglew-dev \ + libgtk-3-dev \ + libdbus-1-dev \ + libcairo2-dev \ + libgtk-3-dev libwebkit2gtk-4.0-dev \ + libsoup2.4-dev \ + libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev libgstreamerd-3-dev \ + libmspack-dev \ + libosmesa6-dev \ + libssl-dev libcurl4-openssl-dev libsecret-1-dev \ + libudev-dev \ + curl \ + wget \ + file \ + sudo + +COPY ./ BambuStudio + +WORKDIR BambuStudio + +# These can run together, but we run them seperate for podman caching +# Update System dependencies +RUN ./BuildLinux.sh -u + +# Build dependencies in ./deps +RUN ./BuildLinux.sh -d + +# Build slic3r +RUN ./BuildLinux.sh -s + +# Build AppImage +ENV container podman +RUN ./BuildLinux.sh -i From b8bbbf3cbcb9b8795a1a5c951c170069d45ee224 Mon Sep 17 00:00:00 2001 From: Cal Heldenbrand Date: Wed, 22 Feb 2023 12:13:49 -0600 Subject: [PATCH 4/9] Remove comments, alpha-sort package names for easier maintenance --- Dockerfile | 65 ++++++++++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4969b3dede..7864390f16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,3 @@ -# Build Bambu Slicer in a container -# -# Build an AppImage using rootless Podman (refer to https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md): -# rm -rf build; podman build . -t bambu-studio-builder && podman run --rm localhost/bambu-studio-builder /bin/bash -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv -# -# Troubleshooting the build container: -# podman run -it --name bambu-studio-builder localhost/bambu-studio-builder /bin/bash -# -# Debugging the resulting AppImage: -# 1) Install `gdb` -# 2) In a terminal in the same directory as the AppImage, start it with following: -# echo -e "run\nbt\nquit" | gdb ./BambuStudio_ubu64.AppImage -# 3) Find related issue using backtrace output for clues and add backtrace to it on github -# -# Docker alternative AppImage build syntax (use this if you can't install podman): -# rm -rf build; docker build . --file Containerfile -t bambu-studio-builder; docker run --rm bambu-studio-builder /bin/bash -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv -# -# -# TODO: bind mount BambuStudio to inside the container instead of COPY to enable faster rebuilds during dev work. - FROM docker.io/ubuntu:20.04 LABEL maintainer "DeftDawg " @@ -30,27 +10,40 @@ RUN echo deb-src http://archive.ubuntu.com/ubuntu \ $(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) main universe>> /etc/apt/sources.list RUN apt-get update && apt-get install -y \ - git \ + autoconf \ build-essential \ - autoconf pkgconf m4 \ - cmake extra-cmake-modules \ - libglu1-mesa-dev libglu1-mesa-dev \ - libwayland-dev libxkbcommon-dev wayland-protocols \ - eglexternalplatform-dev libglew-dev \ - libgtk-3-dev \ - libdbus-1-dev \ + cmake \ + curl \ + eglexternalplatform-dev \ + extra-cmake-modules \ + file \ + git \ libcairo2-dev \ - libgtk-3-dev libwebkit2gtk-4.0-dev \ - libsoup2.4-dev \ - libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev libgstreamerd-3-dev \ + libcurl4-openssl-dev \ + libdbus-1-dev \ + libglew-dev \ + libglu1-mesa-dev \ + libglu1-mesa-dev \ + libgstreamer1.0-dev \ + libgstreamerd-3-dev \ + libgstreamer-plugins-base1.0-dev \ + libgstreamer-plugins-good1.0-dev \ + libgtk-3-dev \ + libgtk-3-dev \ libmspack-dev \ libosmesa6-dev \ - libssl-dev libcurl4-openssl-dev libsecret-1-dev \ + libsecret-1-dev \ + libsoup2.4-dev \ + libssl-dev \ libudev-dev \ - curl \ - wget \ - file \ - sudo + libwayland-dev \ + libwebkit2gtk-4.0-dev \ + libxkbcommon-dev \ + m4 \ + pkgconf \ + sudo \ + wayland-protocols \ + wget COPY ./ BambuStudio From 6916f49e98d771aaa75205ce9f38fc18d816921c Mon Sep 17 00:00:00 2001 From: Cal Heldenbrand Date: Wed, 22 Feb 2023 14:29:08 -0600 Subject: [PATCH 5/9] Copy .gitignore to .dockerignore --- .dockerignore | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..77ed8b50b9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +Build +Build.bat +/build/ +deps/build +MYMETA.json +MYMETA.yml +_build +blib +xs/buildtmp +*.o +*.log +MANIFEST.bak +xs/MANIFEST.bak +xs/assertlib* +.init_bundle.ini +.vs/* +local-lib +/src/TAGS +/.vscode/ +build-linux/* +deps/build-linux/* +**/.DS_Store +install_* +build_*/ +SVG From 4933f9089c14987fab0b88980c9050bdc856cfcc Mon Sep 17 00:00:00 2001 From: Cal Heldenbrand Date: Wed, 22 Feb 2023 14:30:02 -0600 Subject: [PATCH 6/9] Add some dockery things to ignore --- .dockerignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.dockerignore b/.dockerignore index 77ed8b50b9..378649ff6e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,3 +23,6 @@ deps/build-linux/* install_* build_*/ SVG +Dockerfile +DockerBuild.sh +DockerRun.sh From 36e2179adc104e76dfb8fc4c90181a9defdad3df Mon Sep 17 00:00:00 2001 From: Cal Heldenbrand Date: Thu, 23 Feb 2023 10:40:17 -0600 Subject: [PATCH 7/9] Added some build process to Dockerfile --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7864390f16..3f34d66a29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,12 +39,23 @@ RUN apt-get update && apt-get install -y \ libwayland-dev \ libwebkit2gtk-4.0-dev \ libxkbcommon-dev \ + locales \ + locales-all \ m4 \ pkgconf \ sudo \ wayland-protocols \ wget +# Change your locale here if you want. See the output +# of `locale -a` to pick the correct string formatting. +ENV LC_ALL=en_US.utf8 +RUN locale-gen $LC_ALL + +# Set this so that Bambu Studio doesn't complain about +# the CA cert path on every startup +ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt + COPY ./ BambuStudio WORKDIR BambuStudio @@ -62,3 +73,20 @@ RUN ./BuildLinux.sh -s # Build AppImage ENV container podman RUN ./BuildLinux.sh -i + +# It's easier to run Bambu Studio as the same username, +# UID and GID as your workstation. Since we bind mount +# your home directory into the container, it's handy +# to keep permissions the same. Just in case, defaults +# are root. +SHELL ["/bin/bash", "-l", "-c"] +ARG USER=root +ARG UID=0 +ARG GID=0 +RUN [[ "$UID" != "0" ]] \ + && groupadd -g $GID $USER \ + && useradd -u $UID -g $GID $USER + +# Using an entrypoint instead of CMD because the binary +# accepts several command line arguments. +ENTRYPOINT ["/BambuStudio/build/package/bin/bambu-studio"] From a6641287144052c2a7041ca5b96f78a15675ec5c Mon Sep 17 00:00:00 2001 From: Cal Heldenbrand Date: Thu, 23 Feb 2023 10:40:59 -0600 Subject: [PATCH 8/9] Add DockerBuild.sh and DockerRun.sh helper scripts --- DockerBuild.sh | 15 +++++++++++++++ DockerRun.sh | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 DockerBuild.sh create mode 100755 DockerRun.sh diff --git a/DockerBuild.sh b/DockerBuild.sh new file mode 100755 index 0000000000..3546bf2b83 --- /dev/null +++ b/DockerBuild.sh @@ -0,0 +1,15 @@ +#!/bin/bash +PROJECT_ROOT=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") + +set -x + +# Wishlist hint: For developers, creating a Docker Compose +# setup with persistent volumes for the build & deps directories +# would speed up recompile times significantly. For end users, +# the simplicity of a single Docker image and a one-time compilation +# seems better. +docker build -t bambustudio \ + --build-arg USER=$USER \ + --build-arg UID=$(id -u) \ + --build-arg GID=$(id -g) \ + $PROJECT_ROOT diff --git a/DockerRun.sh b/DockerRun.sh new file mode 100755 index 0000000000..30fd215b8a --- /dev/null +++ b/DockerRun.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -x +# Just in case, here's some other things that might help: +# Force the container's hostname to be the same as your workstation +# -h $HOSTNAME \ +# just give it all privileges if there's a wierd error +# --privileged=true \ +# If there's problems with the X display, try this +# -v /tmp/.X11-unix:/tmp/.X11-unix \ +docker run \ + `# Use the hosts networking. Printer wifi and also dbus communication` \ + --net=host \ + `# Run as your workstations username to keep permissions the same` \ + -u $USER \ + `# Bind mount your home directory into the container for loading/saving files` \ + -v $HOME:/home/$USER \ + `# Pass the X display number to the container` \ + -e DISPLAY=$DISPLAY \ + `# Attach tty for running bambu with command line things` \ + -ti \ + `# Pass all parameters from this script to the bambu ENTRYPOINT binary` \ + bambustudio $* + From 0d6778a9d450e4017dc83e318cb0b498c9812d34 Mon Sep 17 00:00:00 2001 From: Cal Heldenbrand Date: Thu, 23 Feb 2023 11:38:14 -0600 Subject: [PATCH 9/9] Add privleged mode... The popover window to select printers acts strange and fuzzes out. I see errors trying to access the raw video card device using libGL, and other errors with dbus access. Turning on privileged mode fixes this. --- DockerRun.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DockerRun.sh b/DockerRun.sh index 30fd215b8a..31319fb810 100755 --- a/DockerRun.sh +++ b/DockerRun.sh @@ -3,8 +3,6 @@ set -x # Just in case, here's some other things that might help: # Force the container's hostname to be the same as your workstation # -h $HOSTNAME \ -# just give it all privileges if there's a wierd error -# --privileged=true \ # If there's problems with the X display, try this # -v /tmp/.X11-unix:/tmp/.X11-unix \ docker run \ @@ -16,6 +14,8 @@ docker run \ -v $HOME:/home/$USER \ `# Pass the X display number to the container` \ -e DISPLAY=$DISPLAY \ + `# It seems that libGL and dbus things need privileged mode` \ + --privileged=true \ `# Attach tty for running bambu with command line things` \ -ti \ `# Pass all parameters from this script to the bambu ENTRYPOINT binary` \