From 3574c5f6cebd41bbf11c4e2128dd5167e3fc8129 Mon Sep 17 00:00:00 2001 From: scottsha Date: Tue, 24 Oct 2023 02:30:41 -0400 Subject: [PATCH 01/11] Add in newer Ubuntu in supported platform, change python bootstrapping to accomodate newer python. Fix distro description as platform.linux_distribution is deprecated and removed after Python 3.8 --- README.md | 30 ++++++++++++++----- build_tools/platforms.py | 12 ++++++-- cmake-tools/MBCMakeToolsConfig.cmake | 3 +- cmake-tools/python34.cmake | 12 ++++---- .../artifactory_clean_repo_diagnostic.py | 6 ++-- 5 files changed, 43 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 5e5a8fde..5daae04d 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,32 @@ Setting all dependencies to build a toolchain locally is toolchain and OS depend * [Ubuntu 18.04 setup instructions](https://github.com/makerbot/Toolchain-Release/wiki/Firmware-setup-for-Ubuntu-18.04-(morepork-toolchain)) * [Fedora 31 setup instructions](https://github.com/makerbot/Toolchain-Release/wiki/Firmware-Setup-for-Fedora-31-(Morepork-Toolchain)) -Other firmware development links +Oth[ArchivePDBS.py](ArchivePDBS.py)er firmware development links * [Unstructured firmware development notes](https://github.com/makerbot/Toolchain-Release/wiki/Unstructured-firmware-development-notes) ### Ubuntu setup -* Install some basic utilities + +#### Toolpath Quick Setup + +If only building toolpath: +```bash +sudo apt update +sudo apt install -y build-essential cmake git ninja-build libboost-dev-all libyajl-dev python2.7 npm +``` +The update script still requires python2: +```bash +python3 -m pip install -U pip +python3 -m pip install jsonschema dohq-artifactory wheel +``` +The build can be invoked with +```bash +python3 update-repos.py -t=toolpather +python3 build-repos.py +``` + +#### Firmware +If you are building firmware ```bash sudo apt-get install build-essential cmake-curses-gui @@ -37,10 +57,6 @@ sudo apt-get install git python python-setuptools python-software-properties pyt sudo apt-get install openssh-server lsb-release devscripts cdbs debhelper libudev-dev libjpeg-dev genext2fs libusb-1.0-0-dev ``` -* If you are using Ubuntu Precise (12.04), get a new computer - -* If you are using Ubuntu Xenial (16.04): - Manually install Python3.4: ```bash mkdir python-build && cd python-build @@ -58,8 +74,6 @@ sudo apt-get update sudo apt-get install python3.4 python3.4-dev python3-pip ``` -If you are going to build firmware: - * Install 32-bit libc: ```bash diff --git a/build_tools/platforms.py b/build_tools/platforms.py index a1885e80..923083dc 100644 --- a/build_tools/platforms.py +++ b/build_tools/platforms.py @@ -31,6 +31,8 @@ UBU_1610_32 = 'Ubuntu_1610_32' UBU_1610_64 = 'Ubuntu_1610_64' UBU_1804_64 = 'Ubuntu_1804_64' +UBU_2204_64 = 'Ubuntu_2204_64' +UBU_2304_64 = 'Ubuntu_2304_64' FED_20_32 = 'Fedora_20_32' FED_20_64 = 'Fedora_20_64' @@ -56,6 +58,8 @@ UBU_1510_64, UBU_1604_64, UBU_1804_64, + UBU_2204_64, + UBU_2304_64, FED_20_32, FED_20_64, FED_21_32, @@ -106,8 +110,12 @@ def find_platform(Win32=False): # TODO(ted): why msvc 12? platform_string = 'Windows_MSVC14_' + bitness elif utils.is_linux: - (distro, version, codename) = platform.linux_distribution() - platform_string = distro + "_" + try: + (distro_str, version, codename) = platform.linux_distribution() + except AttributeError: + from distro import linux_distribution + (distro_str, version, codename) = linux_distribution() + platform_string = distro_str + "_" platform_string += str.replace(version, '.', '') + "_" platform_string += bitness else: diff --git a/cmake-tools/MBCMakeToolsConfig.cmake b/cmake-tools/MBCMakeToolsConfig.cmake index 11bcf2cb..2c9f7a9e 100644 --- a/cmake-tools/MBCMakeToolsConfig.cmake +++ b/cmake-tools/MBCMakeToolsConfig.cmake @@ -1,7 +1,7 @@ # This is the top-level package Config file for MakerBot # cmake tools -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.3) # Policies # Any Policy introduced in 3.1 or earlier will be set to NEW by the @@ -9,6 +9,7 @@ cmake_minimum_required(VERSION 3.1) # we manually set them so that the build system devs can use them. # I'm not setting all of them, because some don't seem to have any # bearing on us. +cmake_policy(SET CMP0057 NEW) if(${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 1) # strict break() cmake_policy(SET CMP0055 NEW) diff --git a/cmake-tools/python34.cmake b/cmake-tools/python34.cmake index 88c801b0..f670520e 100644 --- a/cmake-tools/python34.cmake +++ b/cmake-tools/python34.cmake @@ -91,7 +91,7 @@ macro(add_python34) set(PYTHON_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${HEADER_INSTALL_DIR}/python3.4m" CACHE INTERNAL "") - find_package(PythonLibs 3.4 EXACT REQUIRED) + find_package(PythonLibs REQUIRED) set(PYTHON_DEV_HOME "${CMAKE_INSTALL_PREFIX}/${RESOURCE_INSTALL_DIR}/python34") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -106,19 +106,19 @@ macro(add_python34) set(PYTHON_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${HEADER_INSTALL_DIR}/python3.4m" CACHE INTERNAL "") - find_package(PythonLibs 3.4 EXACT REQUIRED) + find_package(PythonLibs REQUIRED) # This only works if LIB_INSTALL_DIR ends with /lib set(PYTHON_DEV_HOME "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/..") else() - find_program(PYTHON34_EXECUTABLE python3.4) + find_program(PYTHON34_EXECUTABLE python) # This fails on linux when we are not building a CXX project if(CMAKE_CXX_COMPILER_LOADED) - find_package(PythonLibs 3.4 EXACT REQUIRED) + find_package(PythonLibs REQUIRED) endif() endif() if(NOT PYTHON34_EXECUTABLE) - message(FATAL_ERROR "Python 3.4 not found") + message(STATUS "Python 3.4 not found") endif() # Store the basic command for calling python 34 in PYTHON34_COMMAND @@ -323,7 +323,7 @@ function(build_wheel target_name) RESULT_VARIABLE error) if(${error}) - message(FATAL_ERROR "Could not determine wheel name") + message(STATUS "Could not determine wheel name") endif() # So, we've been trying pretty hard to maintain that under cmake diff --git a/dev-tools/artifactory_clean_repo_diagnostic.py b/dev-tools/artifactory_clean_repo_diagnostic.py index b23b070e..a5ab6bc8 100644 --- a/dev-tools/artifactory_clean_repo_diagnostic.py +++ b/dev-tools/artifactory_clean_repo_diagnostic.py @@ -68,9 +68,9 @@ for repo in repos: space_made = 0; for plat in plats: - all = list(artifactory_utils.all(repo, platform=plat)) - all = sorted(all, key=lambda art: art.stat().mtime) - old = [i for i in all if + all_artifacts_unsorted = list(artifactory_utils.all(repo, platform=plat)) + all_artifacts = sorted(all_artifacts_unsorted, key=lambda art: art.stat().mtime) + old = [i for i in all_artifacts if (datetime.today()-i.stat().mtime.replace(tzinfo=None)) > age_cutoff] #for i in all: From bf5cfadadc4e807addf7639310ba986328961f9a Mon Sep 17 00:00:00 2001 From: Shane Scott Date: Tue, 24 Oct 2023 02:34:02 -0400 Subject: [PATCH 02/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5daae04d..2c15bc17 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Setting all dependencies to build a toolchain locally is toolchain and OS depend * [Ubuntu 18.04 setup instructions](https://github.com/makerbot/Toolchain-Release/wiki/Firmware-setup-for-Ubuntu-18.04-(morepork-toolchain)) * [Fedora 31 setup instructions](https://github.com/makerbot/Toolchain-Release/wiki/Firmware-Setup-for-Fedora-31-(Morepork-Toolchain)) -Oth[ArchivePDBS.py](ArchivePDBS.py)er firmware development links +Other firmware development links * [Unstructured firmware development notes](https://github.com/makerbot/Toolchain-Release/wiki/Unstructured-firmware-development-notes) From 8dba54660e02ecfa92224ee73e8f68236f5e10eb Mon Sep 17 00:00:00 2001 From: scottsha Date: Tue, 24 Oct 2023 14:45:23 -0400 Subject: [PATCH 03/11] keep cmake 3.1 compatibility --- README.md | 145 --------------------------- cmake-tools/MBCMakeToolsConfig.cmake | 4 +- 2 files changed, 2 insertions(+), 147 deletions(-) diff --git a/README.md b/README.md index 2c15bc17..acc34bb6 100644 --- a/README.md +++ b/README.md @@ -48,151 +48,6 @@ python3 update-repos.py -t=toolpather python3 build-repos.py ``` -#### Firmware -If you are building firmware - -```bash -sudo apt-get install build-essential cmake-curses-gui -sudo apt-get install git python python-setuptools python-software-properties python-pip -sudo apt-get install openssh-server lsb-release devscripts cdbs debhelper libudev-dev libjpeg-dev genext2fs libusb-1.0-0-dev -``` - -Manually install Python3.4: -```bash -mkdir python-build && cd python-build -wget https://www.python.org/ftp/python/3.4.5/Python-3.4.5.tgz -tar xf Python-3.4.5.tgz -cd Python-3.4.5 -./configure --prefix=/usr --enable-shared # this is important for firmware builds especially -make -sudo make altinstall # this will install Python3.4 alongside 3.5 instead of overwriting it -``` -Alternatively, you can install Python3.4 from the deadsnakes repo: -```bash -sudo add-apt-repository ppa:deadsnakes/ppa -sudo apt-get update -sudo apt-get install python3.4 python3.4-dev python3-pip -``` - -* Install 32-bit libc: - -```bash - sudo apt-get install libc6-i386 libssl-dev -``` -* Install Qt: - - Recommended that you do not use apt-get to install Qt. Goto https://www.qt.io/download-open-source/ to download the Qt Open Source Installer. Select Qt version 5.10.1 when performing install. You will need to make symbolic links for the qmake, lrelease, and lupdate binaries. - -```bash - sudo ln -s /path/to/Qt/5.10.1/gcc_64/bin/qmake /usr/local/bin/qmake - sudo ln -s /path/to/Qt/5.10.1/gcc_64/bin/lrelease /usr/local/bin/lrelease - sudo ln -s /path/to/Qt/5.10.1/gcc_64/bin/lupdate /usr/local/bin/lupdate -``` - -Install yajl and boost: -```bash -sudo apt-get install libyajl-dev -sudo apt-get install libboost1.58-all-dev -sudo apt-get install mercurial # only necessary if you want to do full build-root builds -``` - -Pip install some additional dependencies: - -```bash - sudo pip install protobuf -``` - -* Use git to download our main repository - -```bash - git clone git@github.com:makerbot/Toolchain-Release.git - cd Toolchain-Release/ -``` - -* Add our internal master repository -* Use double quotes ("), not single quotes(') -* This command will automatically add the correct distribution - -```bash -sudo apt-add-repository "http://sid.soft.makerbot.net/apt/develop" -sudo apt-get update -``` - -* In the root of the Toolchain-Release repository there is a file called ./ubuntusetup.sh -If you run it it will install all of the build dependencies for you -(if it doesn't go bug Ryan) - -* Either make sure you do not have qt4 installed, or add the following to your environment: -`export QT_SELECT=qt5` - -* You also need python3.4 with pip and some extra python packages: - -```bash -pip3 install wheel jsonschema aiohttp netifaces appdirs lockfile watchdog -sudo pip3 install artifactory -``` - -* From the `Toolchain-Release` directory invoke the following command: -`./update-repos.py --toolchain=desktop` -This will pull down either the source or artifacts of each of our other repositories depending default settings -* After downloading all of the sources run -`./build-repos.py` - -If there are any errors related to missing packages please bother Ryan to update the ubuntusetup script(or do it yourself) - -This command will take a long time to finish. It will download the source -package tarballs for all of our projects, extract them, then for each one -it will install the build dependencies and compile the project. - - -### Mac-specific Tools Setup - -[Setup instructions for 10.10](https://github.com/makerbot/Toolchain-Release/blob/develop/Bundle-Mac/OSX_10_10_setup.md). -These instructions are up to date as of August 2016, and are probably still more correct -than anything else even for different OSX versions. - -Once setup is done you should be able to run any of the following, -depending on what you want to build: - -```bash -./update-repos.py --toolchain=penguin # dependencies for makerbot print -./update-repos.py --toolchain=sliceconfig -./update-repos.py --toolchain=toolpathviz2 -``` - -and then run `./build-repos.py` to actually build. You may even be able to build the `desktop` -toolchain (i.e. makerbot desktop 3.x), although in all likelihood there is still something -missing from the setup instructions. - -### Windows-specific Tools Setup. -* Install Microsoft Visual Studio 2015 (Professional with Update 3 should work fine): https://my.visualstudio.com/Downloads?q=visual%20studio%202015 -* Install CMake v3.4 from http://www.cmake.org/download/ (add it to the path for all users) - * Note that CMake v3.5 and up will cause boost library link errors, since the FindBoost module has changed and our current adapter no longer works -* Install Git from https://git-scm.com/download/win (check the 'use Git and optional Unix tools from the Windows command prompt' when the option comes up and 'checkout as-is, commit unix-style line endings') - -The following instructions assume you're doing a 64 bit build, substitute the 32 bit versions of any of the following: - -* Install latest version of Python 2. At the time of writing, 2.7.18 was the latest version. - * preferably the 64-bit version at https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi -* Install Boost(again ask for an updated version, 1.61 at time of writing) - 64bit: https://sourceforge.net/projects/boost/files/boost-binaries/1.61.0/boost_1_61_0-msvc-14.0-64.exe/download -* Now we need to set up the environment and install some python modules from pip - * Run `pip install requests urllib3` - * Run `pip install http://y.soft.makerbot.net/files/artifactory-0.1.11-py2-none-any.whl`. It installs our custom artifactory python 2 module to your system. Functions like `get_dependencies.py` use it to communicate with our artifactory server -* Install nvm: https://github.com/coreybutler/nvm-windows -* Install node (right now we're using 14.15.3) - * Run `nvm install 14.15.3` - - -* Open a command prompt, create a directory called `Toolchain` and cd into it. Run `git clone git@y.soft.makerbot.net:third-party-win.git`. Enter the password when prompted. If you don't know the password, ask your team lead or authorized personnel. - -* While in Toolchain directory run `git clone git@github.com:makerbot/Toolchain-Release.git` to download Toolchain-Release repo - -* `cd` into `Toolchain/third-party-win` and run `./setup_devtools.bat` -then close and re-open command prompt to make the changes take - -* (Optional) Install NSIS so you can build the installer http://nsis.sourceforge.net/Download - ### Getting our sources & building * At the root of the Toolchain-Release repo run `update-repos.py`. This will run a bunch of git commands to pull down additional repositories and their submodules into the "Toolchain" subdirectory. It also installs a set of git-hooks that do style checking and other things. You can run this again at any time to pull down the latest updates for everything. diff --git a/cmake-tools/MBCMakeToolsConfig.cmake b/cmake-tools/MBCMakeToolsConfig.cmake index 2c9f7a9e..67030aef 100644 --- a/cmake-tools/MBCMakeToolsConfig.cmake +++ b/cmake-tools/MBCMakeToolsConfig.cmake @@ -1,7 +1,7 @@ # This is the top-level package Config file for MakerBot # cmake tools -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.1) # Policies # Any Policy introduced in 3.1 or earlier will be set to NEW by the @@ -9,7 +9,6 @@ cmake_minimum_required(VERSION 3.3) # we manually set them so that the build system devs can use them. # I'm not setting all of them, because some don't seem to have any # bearing on us. -cmake_policy(SET CMP0057 NEW) if(${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 1) # strict break() cmake_policy(SET CMP0055 NEW) @@ -20,6 +19,7 @@ elseif(${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 2) cmake_policy(SET CMP0061 NEW) # Disallow install() of export() result. cmake_policy(SET CMP0062 NEW) + cmake_policy(SET CMP0057 NEW) endif() # Make makefiles show each command line as it is used. From 1583a602783e0b0acaea09f1fcfd3afd8d542820 Mon Sep 17 00:00:00 2001 From: scottsha Date: Tue, 24 Oct 2023 17:23:17 -0400 Subject: [PATCH 04/11] unreachable code block? --- cmake-tools/MBCMakeToolsConfig.cmake | 30 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/cmake-tools/MBCMakeToolsConfig.cmake b/cmake-tools/MBCMakeToolsConfig.cmake index 67030aef..13fe6a49 100644 --- a/cmake-tools/MBCMakeToolsConfig.cmake +++ b/cmake-tools/MBCMakeToolsConfig.cmake @@ -9,19 +9,27 @@ cmake_minimum_required(VERSION 3.1) # we manually set them so that the build system devs can use them. # I'm not setting all of them, because some don't seem to have any # bearing on us. -if(${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 1) - # strict break() - cmake_policy(SET CMP0055 NEW) -elseif(${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 2) - # Use COMPILE_DEFINITIONS not DEFINITIONS directory property - cmake_policy(SET CMP0059 NEW) - # CTest does not by default tell make to ignore errors - cmake_policy(SET CMP0061 NEW) - # Disallow install() of export() result. - cmake_policy(SET CMP0062 NEW) - cmake_policy(SET CMP0057 NEW) +if (${CMAKE_MAJOR_VERSION} EQUAL 3) + + if(${CMAKE_MINOR_VERSION} GREATER 1) + # strict break() + cmake_policy(SET CMP0055 NEW) + endif() + + if(${CMAKE_MINOR_VERSION} GREATER 2) + # Allow use of ALL over lists in IF + cmake_policy(SET CMP0057 NEW) + # Use COMPILE_DEFINITIONS not DEFINITIONS directory property + cmake_policy(SET CMP0059 NEW) + # CTest does not by default tell make to ignore errors + cmake_policy(SET CMP0061 NEW) + # Disallow install() of export() result. + cmake_policy(SET CMP0062 NEW) + endif() + endif() + # Make makefiles show each command line as it is used. set(CMAKE_VERBOSE_MAKEFILE TRUE) From eba4e5cd27d44b2f03e149123435e79dc4424a45 Mon Sep 17 00:00:00 2001 From: scottsha Date: Tue, 24 Oct 2023 19:34:53 -0400 Subject: [PATCH 05/11] increase err levels --- cmake-tools/python34.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-tools/python34.cmake b/cmake-tools/python34.cmake index f670520e..4be0ab86 100644 --- a/cmake-tools/python34.cmake +++ b/cmake-tools/python34.cmake @@ -118,7 +118,7 @@ macro(add_python34) endif() endif() if(NOT PYTHON34_EXECUTABLE) - message(STATUS "Python 3.4 not found") + message(FATAL_ERROR "Python executable not found") endif() # Store the basic command for calling python 34 in PYTHON34_COMMAND From b885d053f134eb2bad36eb2ed0ac991d30cf4081 Mon Sep 17 00:00:00 2001 From: scottsha Date: Wed, 25 Oct 2023 15:09:39 -0400 Subject: [PATCH 06/11] rm unreachable cmake policies; fix annoying cmake enfunction warning; listify toolchain_sources --- build_tools/common.py | 5 +++-- cmake-tools/MBCMakeToolsConfig.cmake | 8 +------- cmake-tools/utils.cmake | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/build_tools/common.py b/build_tools/common.py index 3f977192..9e48a1ed 100644 --- a/build_tools/common.py +++ b/build_tools/common.py @@ -334,8 +334,9 @@ def source_match(s): return s.name == source.name toolchain_sources = filter(source_match, saved_toolchain) if toolchain_sources: - assert(len(toolchain_sources) == 1) - source = toolchain_sources[0] + toolchain_sources_list = list(toolchain_sources) + assert(len(toolchain_sources_list) == 1) + source = toolchain_sources_list[0] TOOLCHAIN = toolchain.Toolchain('custom', [source]) diff --git a/cmake-tools/MBCMakeToolsConfig.cmake b/cmake-tools/MBCMakeToolsConfig.cmake index 13fe6a49..7a880b88 100644 --- a/cmake-tools/MBCMakeToolsConfig.cmake +++ b/cmake-tools/MBCMakeToolsConfig.cmake @@ -17,14 +17,8 @@ if (${CMAKE_MAJOR_VERSION} EQUAL 3) endif() if(${CMAKE_MINOR_VERSION} GREATER 2) - # Allow use of ALL over lists in IF + # Allow use of ALL over lists in IF, used in never boost cmake_policy(SET CMP0057 NEW) - # Use COMPILE_DEFINITIONS not DEFINITIONS directory property - cmake_policy(SET CMP0059 NEW) - # CTest does not by default tell make to ignore errors - cmake_policy(SET CMP0061 NEW) - # Disallow install() of export() result. - cmake_policy(SET CMP0062 NEW) endif() endif() diff --git a/cmake-tools/utils.cmake b/cmake-tools/utils.cmake index 12ad65d8..2cc4829f 100644 --- a/cmake-tools/utils.cmake +++ b/cmake-tools/utils.cmake @@ -1160,4 +1160,4 @@ function(get_git_hash in_git_hash) OUTPUT_STRIP_TRAILING_WHITESPACE) set(${in_git_hash} ${GIT_HASH} PARENT_SCOPE) -endfunction(()) +endfunction() From 8f4c471cbbc0c06b69e927152302d443979ac24a Mon Sep 17 00:00:00 2001 From: scottsha Date: Fri, 27 Oct 2023 15:29:21 -0400 Subject: [PATCH 07/11] restore some readme --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index acc34bb6..22725804 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,12 @@ If only building toolpath: sudo apt update sudo apt install -y build-essential cmake git ninja-build libboost-dev-all libyajl-dev python2.7 npm ``` -The update script still requires python2: +Note that Scripts may still require python2. +You make need additional package beyond the following, install them as "missing package" errors arise, +but be sure to use the package `dohq-artifactory` and not `artifactory`. ```bash python3 -m pip install -U pip -python3 -m pip install jsonschema dohq-artifactory wheel +python3 -m pip install jsonschema dohq-artifactory wheel distro ``` The build can be invoked with ```bash @@ -48,6 +50,55 @@ python3 update-repos.py -t=toolpather python3 build-repos.py ``` +### Mac-specific Tools Setup + +[Setup instructions for 10.10](https://github.com/makerbot/Toolchain-Release/blob/develop/Bundle-Mac/OSX_10_10_setup.md). +These instructions are up to date as of August 2016, and are probably still more correct +than anything else even for different OSX versions. + +Once setup is done you should be able to run any of the following, +depending on what you want to build: + +```bash +./update-repos.py --toolchain=penguin # dependencies for makerbot print +./update-repos.py --toolchain=sliceconfig +./update-repos.py --toolchain=toolpathviz2 +``` + +and then run `./build-repos.py` to actually build. You may even be able to build the `desktop` +toolchain (i.e. makerbot desktop 3.x), although in all likelihood there is still something +missing from the setup instructions. + +### Windows-specific Tools Setup. +* Install Microsoft Visual Studio 2015 (Professional with Update 3 should work fine): https://my.visualstudio.com/Downloads?q=visual%20studio%202015 +* Install CMake v3.4 from http://www.cmake.org/download/ (add it to the path for all users) + * Note that CMake v3.5 and up will cause boost library link errors, since the FindBoost module has changed and our current adapter no longer works +* Install Git from https://git-scm.com/download/win (check the 'use Git and optional Unix tools from the Windows command prompt' when the option comes up and 'checkout as-is, commit unix-style line endings') + +The following instructions assume you're doing a 64 bit build, substitute the 32 bit versions of any of the following: + +* Install latest version of Python 2. At the time of writing, 2.7.18 was the latest version. + * preferably the 64-bit version at https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi +* Install Boost(again ask for an updated version, 1.61 at time of writing) + 64bit: https://sourceforge.net/projects/boost/files/boost-binaries/1.61.0/boost_1_61_0-msvc-14.0-64.exe/download +* Now we need to set up the environment and install some python modules from pip + * Run `pip install requests urllib3` + * Run `pip install http://y.soft.makerbot.net/files/artifactory-0.1.11-py2-none-any.whl`. It installs our custom artifactory python 2 module to your system. Functions like `get_dependencies.py` use it to communicate with our artifactory server +* Install nvm: https://github.com/coreybutler/nvm-windows +* Install node (right now we're using 14.15.3) + * Run `nvm install 14.15.3` + + +* Open a command prompt, create a directory called `Toolchain` and cd into it. Run `git clone git@y.soft.makerbot.net:third-party-win.git`. Enter the password when prompted. If you don't know the password, ask your team lead or authorized personnel. + +* While in Toolchain directory run `git clone git@github.com:makerbot/Toolchain-Release.git` to download Toolchain-Release repo + +* `cd` into `Toolchain/third-party-win` and run `./setup_devtools.bat` +then close and re-open command prompt to make the changes take + +* (Optional) Install NSIS so you can build the installer http://nsis.sourceforge.net/Download + + ### Getting our sources & building * At the root of the Toolchain-Release repo run `update-repos.py`. This will run a bunch of git commands to pull down additional repositories and their submodules into the "Toolchain" subdirectory. It also installs a set of git-hooks that do style checking and other things. You can run this again at any time to pull down the latest updates for everything. From 412c9e4ac49c927d49eacc5e5fc5452171cde008 Mon Sep 17 00:00:00 2001 From: scottshaloo Date: Tue, 14 Nov 2023 16:53:43 -0500 Subject: [PATCH 08/11] python3.8+ identification of Ubuntu distro versions --- README.md | 6 +++--- build_tools/platforms.py | 12 +++++++----- jenkins-build.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 22725804..69d0dc3e 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ Other firmware development links If only building toolpath: ```bash sudo apt update -sudo apt install -y build-essential cmake git ninja-build libboost-dev-all libyajl-dev python2.7 npm +sudo apt install -y build-essential cmake git ninja-build libboost-all-dev libyajl-dev npm python2.7-dev ``` -Note that Scripts may still require python2. +Note that some scripts may still require python2. You make need additional package beyond the following, install them as "missing package" errors arise, but be sure to use the package `dohq-artifactory` and not `artifactory`. ```bash @@ -46,7 +46,7 @@ python3 -m pip install jsonschema dohq-artifactory wheel distro ``` The build can be invoked with ```bash -python3 update-repos.py -t=toolpather +python3 update-repos.py -t=toolpather; python3 build-repos.py ``` diff --git a/build_tools/platforms.py b/build_tools/platforms.py index cc4104f6..42b0c691 100644 --- a/build_tools/platforms.py +++ b/build_tools/platforms.py @@ -111,12 +111,14 @@ def find_platform(Win32=False): platform_string = 'Windows_MSVC14_' + bitness elif utils.is_linux: try: - (distro, version, codename) = platform.linux_distribution() - platform_string = distro + "_" - platform_string += str.replace(version, '.', '') + "_" - platform_string += bitness + import distro + distro_str = distro.name() + version_str = distro.major_version() + distro.minor_version() except AttributeError: - platform_string = "Ubuntu_1804_64" + (distro_str, version_str, _codename) = platform.linux_distribution() + platform_string = distro_str + "_" + platform_string += version_str + "_" + platform_string += bitness else: raise ValueError(sys.platform) if valid_platform(platform_string): diff --git a/jenkins-build.py b/jenkins-build.py index 8dacc983..ffbfec36 100755 --- a/jenkins-build.py +++ b/jenkins-build.py @@ -357,7 +357,7 @@ def run(args=[]): if len(repos_failing_tests) > 0: for r in repos_failing_tests: - print r + " is failing unit tests" + print(r + " is failing unit tests") return 0 From 45ad1cef1f097dc2ff68f0bbe28cac9290ffe224 Mon Sep 17 00:00:00 2001 From: scottshaloo Date: Fri, 17 Nov 2023 17:19:35 -0500 Subject: [PATCH 09/11] use distro module as fallback to linux_distribution --- build_tools/platforms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build_tools/platforms.py b/build_tools/platforms.py index 42b0c691..d748d5a0 100644 --- a/build_tools/platforms.py +++ b/build_tools/platforms.py @@ -111,15 +111,16 @@ def find_platform(Win32=False): platform_string = 'Windows_MSVC14_' + bitness elif utils.is_linux: try: + (distro_str, version_str, _codename) = platform.linux_distribution() + except AttributeError: import distro distro_str = distro.name() version_str = distro.major_version() + distro.minor_version() - except AttributeError: - (distro_str, version_str, _codename) = platform.linux_distribution() platform_string = distro_str + "_" platform_string += version_str + "_" platform_string += bitness else: + import sys raise ValueError(sys.platform) if valid_platform(platform_string): return platform_string From 67d4c7ee3a60a612e012bb469667e4b98f7d41e5 Mon Sep 17 00:00:00 2001 From: scottshaloo Date: Mon, 20 Nov 2023 13:48:25 -0500 Subject: [PATCH 10/11] rm . from platform str --- build_tools/platforms.py | 1 + 1 file changed, 1 insertion(+) diff --git a/build_tools/platforms.py b/build_tools/platforms.py index d748d5a0..c783ae66 100644 --- a/build_tools/platforms.py +++ b/build_tools/platforms.py @@ -118,6 +118,7 @@ def find_platform(Win32=False): version_str = distro.major_version() + distro.minor_version() platform_string = distro_str + "_" platform_string += version_str + "_" + platform_string.replace('.', '') platform_string += bitness else: import sys From c58df84a3afd083e61f1cb0c7d07c7a18a9c6f29 Mon Sep 17 00:00:00 2001 From: scottshaloo Date: Mon, 20 Nov 2023 13:56:21 -0500 Subject: [PATCH 11/11] rm . from platform str --- build_tools/platforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/platforms.py b/build_tools/platforms.py index c783ae66..9396f87c 100644 --- a/build_tools/platforms.py +++ b/build_tools/platforms.py @@ -118,8 +118,8 @@ def find_platform(Win32=False): version_str = distro.major_version() + distro.minor_version() platform_string = distro_str + "_" platform_string += version_str + "_" - platform_string.replace('.', '') platform_string += bitness + platform_string = platform_string.replace('.', '') else: import sys raise ValueError(sys.platform)