From 3ebab330f40bebb621c700ffa12bc57d45258cd1 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 17 Sep 2021 15:47:00 +0200 Subject: [PATCH 1/8] AddonManager: Fixed path of gitlab readme --- src/Mod/AddonManager/addonmanager_utilities.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/AddonManager/addonmanager_utilities.py b/src/Mod/AddonManager/addonmanager_utilities.py index e86fff54c2..cfb63ccbb6 100644 --- a/src/Mod/AddonManager/addonmanager_utilities.py +++ b/src/Mod/AddonManager/addonmanager_utilities.py @@ -266,8 +266,10 @@ def get_zip_url(baseurl): def get_readme_url(url): "Returns the location of a readme file" - if "github" in url or "framagit" in url or "gitlab" in url: + if "github" in url or "framagit" in url: return url+"/raw/master/README.md" + elif "gitlab" in url: + return url+"/-/raw/master/README.md" else: print("Debug: addonmanager_utilities.get_readme_url: Unknown git host:", url) return None From d91ba28614cc5924ca0dd0e4901373f0da1b5e0e Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Sun, 4 Jul 2021 19:11:19 +0100 Subject: [PATCH 2/8] [gitlab-ci] gitlab CI on docker initial commit --- ci/.gitlab-ci.yml | 56 ++++++++++++++++++++++ ci/Dockerfile | 118 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 ci/.gitlab-ci.yml create mode 100644 ci/Dockerfile diff --git a/ci/.gitlab-ci.yml b/ci/.gitlab-ci.yml new file mode 100644 index 0000000000..edb7bd10b9 --- /dev/null +++ b/ci/.gitlab-ci.yml @@ -0,0 +1,56 @@ +# This file is a template, and might need editing before it works on your project. +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml + +# This is a sample GitLab CI/CD configuration file that should run without any modifications. +# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, +# it uses echo commands to simulate the pipeline execution. +# +# A pipeline is composed of independent jobs that run scripts, grouped into stages. +# Stages run in sequential order, but jobs within stages run in parallel. +# +# For more information, see: https://docs.gitlab.com/ee/ci/yaml/README.html#stages + +# this image is on dockerhub. Dockerfile is here: https://gitlab.com/PrzemoF/FreeCAD/-/blob/gitlab-v1/ci/Dockerfile +image: freecadci/runner + +stages: # List of stages for jobs, and their order of execution + - build + - test + +before_script: + - apt-get update -yqq + # CCache Config + - mkdir -p ccache + - export CCACHE_BASEDIR=${PWD} + - export CCACHE_DIR=${PWD}/ccache + +cache: + paths: + - ccache/ + +build-job: # This job runs in the build stage, which runs first. + stage: build + + script: + - echo "Compiling the code..." + - mkdir build + - cd build + - ccache cmake ../ + - ccache cmake --build ./ -j$(nproc) + - echo "Compile complete." + + artifacts: + paths: + - build/ + +test-job: # This job runs in the test stage. + stage: test # It only starts when the job in the build stage completes successfully. + script: + - echo "Running unit tests... " + - cd build/bin/ + # Testing currently doesn't work due to problems with libraries ot being visible by the binary. + - ./FreeCADCmd -t 0 + diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000000..fb5196ed4d --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,118 @@ +FROM ubuntu:20.04 +MAINTAINER Przemo Firszt +# This is the docker image definition used to build FreeCAD. It's currently accessible on: +# https://hub.docker.com/repository/docker/freecadci/runner +# on under name freecadci/runner when using docker + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -y +RUN apt-get update -y && apt-get install -y gnupg2 +RUN echo "deb http://ppa.launchpad.net/freecad-maintainers/freecad-daily/ubuntu focal main" >> /etc/apt/sources.list.d/freecad-daily.list +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 83193AA3B52FF6FCF10A1BBF005EAE8119BB5BCA +RUN apt-get update -y + +# those 3 are for debugging purposes only. Not required to build FreeCAD +RUN apt-get install -y \ + vim \ + nano \ + bash + +# Main set of FreeCAD dependencies. To be verified. +RUN apt-get install -y \ + ccache \ + cmake \ + debhelper \ + dh-exec \ + dh-python \ + doxygen \ + git \ + graphviz \ + libboost-date-time-dev \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-filesystem1.71-dev \ + libboost-graph-dev \ + libboost-iostreams-dev \ + libboost-program-options-dev \ + libboost-program-options1.71-dev \ + libboost-python1.71-dev \ + libboost-regex-dev \ + libboost-regex1.71-dev \ + libboost-serialization-dev \ + libboost-system1.71-dev \ + libboost-thread-dev \ + libboost-thread1.71-dev \ + libboost1.71-dev \ + libcoin-dev \ + libdouble-conversion-dev \ + libeigen3-dev \ + libglew-dev \ + libgts-bin \ + libgts-dev \ + libkdtree++-dev \ + liblz4-dev \ + libmedc-dev \ + libmetis-dev \ + libnglib-dev \ + libocct-data-exchange-dev \ + libocct-ocaf-dev \ + libocct-visualization-dev \ + libopencv-dev \ + libproj-dev \ + libpyside2-dev \ + libqt5opengl5 \ + libqt5opengl5-dev \ + libqt5svg5-dev \ + libqt5webkit5 \ + libqt5webkit5-dev \ + libqt5x11extras5-dev \ + libqt5xmlpatterns5-dev \ + libshiboken2-dev \ + libspnav-dev \ + libvtk7-dev \ + libvtk7.1p \ + libvtk7.1p-qt \ + libx11-dev \ + libxerces-c-dev \ + libzipios++-dev \ + lsb-release \ + nastran \ + netgen \ + netgen-headers \ + occt-draw \ + pybind11-dev \ + pyqt5-dev-tools \ + pyside2-tools \ + python3-dev \ + python3-matplotlib \ + python3-pivy \ + python3-ply \ + python3-pyqt5 \ + python3-pyside2.* \ + python3-pyside2.qtcore \ + python3-pyside2.qtgui \ + python3-pyside2.qtsvg \ + python3-pyside2.qtuitools \ + python3-pyside2.qtwidgets \ + python3-pyside2.qtxml \ + python3-requests \ + python3-yaml \ + qt5-default \ + qt5-qmake \ + qtbase5-dev \ + qttools5-dev \ + qtwebengine5-dev \ + swig + +RUN apt-get update -y --fix-missing + +# Clean +RUN apt-get clean \ + && rm /var/lib/apt/lists/* \ + /usr/share/doc/* \ + /usr/share/locale/* \ + /usr/share/man/* \ + /usr/share/info/* -fR + + From f950cfab7b709b7acec21f3a29501beb89d9d1be Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Mon, 26 Jul 2021 23:17:55 +0100 Subject: [PATCH 3/8] [UnitTest] Replace deg symbol with deg unittest cannot handle the symbol on some systems. deg is a safe solution. Signed-off-by: Przemo Firszt --- src/Mod/Path/PathTests/TestPathDeburr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathTests/TestPathDeburr.py b/src/Mod/Path/PathTests/TestPathDeburr.py index 2dcf446018..6d103e7ab0 100644 --- a/src/Mod/Path/PathTests/TestPathDeburr.py +++ b/src/Mod/Path/PathTests/TestPathDeburr.py @@ -52,7 +52,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase): self.assertFalse(info) def test01(self): - '''Verify chamfer depth and offset for a 90° v-bit.''' + '''Verify chamfer depth and offset for a 90 deg v-bit.''' tool = Path.Tool() tool.FlatRadius = 0 tool.CuttingEdgeAngle = 90 @@ -68,7 +68,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase): self.assertFalse(info) def test02(self): - '''Verify chamfer depth and offset for a 90° v-bit with non 0 flat radius.''' + '''Verify chamfer depth and offset for a 90 deg v-bit with non 0 flat radius.''' tool = Path.Tool() tool.FlatRadius = 0.3 tool.CuttingEdgeAngle = 90 @@ -84,7 +84,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase): self.assertFalse(info) def test03(self): - '''Verify chamfer depth and offset for a 60° v-bit with non 0 flat radius.''' + '''Verify chamfer depth and offset for a 60 deg v-bit with non 0 flat radius.''' tool = Path.Tool() tool.FlatRadius = 10 tool.CuttingEdgeAngle = 60 From fc82a54b9799e8101909cf68152072af464aafab Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 21 Sep 2021 15:45:32 +0200 Subject: [PATCH 4/8] Web: Extended openBrowserHTML to allow custom icon --- src/Mod/Web/Gui/AppWebGui.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Web/Gui/AppWebGui.cpp b/src/Mod/Web/Gui/AppWebGui.cpp index c665318dff..a82508b93d 100644 --- a/src/Mod/Web/Gui/AppWebGui.cpp +++ b/src/Mod/Web/Gui/AppWebGui.cpp @@ -27,6 +27,7 @@ # include # include # include +# include #endif #include @@ -63,7 +64,7 @@ public: add_varargs_method("openBrowserWindow",&Module::openBrowserWindow ); add_varargs_method("open",&Module::openBrowser, - "open(string)\n" + "open(htmlcode,baseurl,[title,iconpath])\n" "Load a local (X)HTML file." ); add_varargs_method("insert",&Module::openBrowser, @@ -99,8 +100,9 @@ private: { const char* HtmlCode; const char* BaseUrl; + const char* IconPath; char* TabName = nullptr; - if (! PyArg_ParseTuple(args.ptr(), "ss|et", &HtmlCode, &BaseUrl, "utf-8", &TabName)) + if (! PyArg_ParseTuple(args.ptr(), "ss|ets", &HtmlCode, &BaseUrl, "utf-8", &TabName, &IconPath)) throw Py::Exception(); std::string EncodedName = "Browser"; @@ -114,6 +116,8 @@ private: pcBrowserView->resize(400, 300); pcBrowserView->setHtml(QString::fromUtf8(HtmlCode),QUrl(QString::fromLatin1(BaseUrl))); pcBrowserView->setWindowTitle(QString::fromUtf8(EncodedName.c_str())); + if (IconPath) + pcBrowserView->setWindowIcon(QIcon(QString::fromUtf8(IconPath))); Gui::getMainWindow()->addWindow(pcBrowserView); if (!Gui::getMainWindow()->activeWindow()) Gui::getMainWindow()->setActiveWindow(pcBrowserView); From f78576943e175de90032996f63b44c35dbd165df Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 21 Sep 2021 11:16:57 -0500 Subject: [PATCH 5/8] Tools: Corrected arguments to git.extractInfo --- src/Tools/WinVersion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tools/WinVersion.py b/src/Tools/WinVersion.py index eb02f62229..0e15568759 100644 --- a/src/Tools/WinVersion.py +++ b/src/Tools/WinVersion.py @@ -26,7 +26,7 @@ def main(): output = a git = SubWCRev.GitControl() - if(git.extractInfo(input)): + if(git.extractInfo(input, "")): print(git.hash) print(git.branch) print(git.rev[0:4]) From 776c2489da011d2e8a26dc684797090068fd56f9 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Tue, 21 Sep 2021 18:23:59 +0200 Subject: [PATCH 6/8] CI gitlab: update readme --- ci/.gitlab-ci.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/ci/.gitlab-ci.yml b/ci/.gitlab-ci.yml index edb7bd10b9..92200a8d8e 100644 --- a/ci/.gitlab-ci.yml +++ b/ci/.gitlab-ci.yml @@ -1,17 +1,4 @@ -# This file is a template, and might need editing before it works on your project. -# To contribute improvements to CI/CD templates, please follow the Development guide at: -# https://docs.gitlab.com/ee/development/cicd/templates.html -# This specific template is located at: -# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml - -# This is a sample GitLab CI/CD configuration file that should run without any modifications. -# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, -# it uses echo commands to simulate the pipeline execution. -# -# A pipeline is composed of independent jobs that run scripts, grouped into stages. -# Stages run in sequential order, but jobs within stages run in parallel. -# -# For more information, see: https://docs.gitlab.com/ee/ci/yaml/README.html#stages +# gitlab CI config file # this image is on dockerhub. Dockerfile is here: https://gitlab.com/PrzemoF/FreeCAD/-/blob/gitlab-v1/ci/Dockerfile image: freecadci/runner From 5959a3b17d594eab405a7c035c0cb689c7f7263c Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 21 Sep 2021 12:56:34 -0500 Subject: [PATCH 7/8] Web: Fix MSVC compile error in BrowserView --- src/Mod/Web/Gui/BrowserView.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Mod/Web/Gui/BrowserView.h b/src/Mod/Web/Gui/BrowserView.h index 67efacdceb..fae6c608b0 100644 --- a/src/Mod/Web/Gui/BrowserView.h +++ b/src/Mod/Web/Gui/BrowserView.h @@ -97,7 +97,9 @@ public: bool onMsg(const char* pMsg,const char** ppReturn); bool onHasMsg(const char* pMsg) const; - bool canClose(void); +#ifdef QTWEBENGINE + void setWindowIcon(const QIcon &icon); +#endif protected Q_SLOTS: void onLoadStarted(); @@ -107,7 +109,6 @@ protected Q_SLOTS: void urlFilter(const QUrl &url); #ifdef QTWEBENGINE void onDownloadRequested(QWebEngineDownloadItem *request); - void setWindowIcon(const QIcon &icon); void onLinkHovered(const QString& url); #else void onDownloadRequested(const QNetworkRequest& request); From 7e2e7f625ce37e7793fcc363f4c6f2892eb03277 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 21 Sep 2021 13:08:29 -0500 Subject: [PATCH 8/8] Web: Fix MSVC compile error in BrowserView (part 2) --- src/Mod/Web/Gui/BrowserView.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Web/Gui/BrowserView.h b/src/Mod/Web/Gui/BrowserView.h index fae6c608b0..b36e505b32 100644 --- a/src/Mod/Web/Gui/BrowserView.h +++ b/src/Mod/Web/Gui/BrowserView.h @@ -97,6 +97,8 @@ public: bool onMsg(const char* pMsg,const char** ppReturn); bool onHasMsg(const char* pMsg) const; + bool canClose (void); + #ifdef QTWEBENGINE void setWindowIcon(const QIcon &icon); #endif