msys: Drop support for building in an MSYS environment

MSYS support was added as a stop-gap while native windows support was
unsupported. Now that Native windows support is stable we can drop
support for MSYS.

Dropping support for MSYS fixes #11260 and allows us to spend more
resources on native windows support.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-11-09 09:49:58 +01:00 committed by Carles Cufí
commit 5a2ddf37d9
4 changed files with 4 additions and 141 deletions

View file

@ -14,19 +14,6 @@
# modified by the entry point ${APPLICATION_SOURCE_DIR}/CMakeLists.txt
# that was specified when cmake was called.
# Determine if we are using MSYS.
#
# We don't use project() because it would take some time to rewrite
# the build scripts to be compatible with everything project() does.
execute_process(
COMMAND
uname
OUTPUT_VARIABLE uname_output
)
if(uname_output MATCHES "MSYS")
set(MSYS 1)
endif()
# CMake version 3.8.2 is the real minimum supported version.
#
# Unfortunately CMake requires the toplevel CMakeLists.txt file to
@ -115,18 +102,6 @@ add_custom_target(
# Equivalent to rm -rf build/*
)
# Must be run before kconfig.cmake
if(MSYS)
execute_process(
COMMAND
${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/check_host_is_ok.py
RESULT_VARIABLE ret
)
if(NOT "${ret}" STREQUAL "0")
message(FATAL_ERROR "command failed with return code: ${ret}")
endif()
endif()
# The BOARD can be set by 3 sources. Through environment variables,
# through the cmake CLI, and through CMakeLists.txt.
#

View file

@ -66,17 +66,6 @@ foreach(file_name include include-fixed)
)
string(REGEX REPLACE "\n" "" _OUTPUT "${_OUTPUT}")
if(MSYS)
# TODO: Remove this when
# https://github.com/zephyrproject-rtos/zephyr/issues/4687 is
# resolved
execute_process(
COMMAND cygpath -u ${_OUTPUT}
OUTPUT_VARIABLE _OUTPUT
)
string(REGEX REPLACE "\n" "" _OUTPUT ${_OUTPUT})
endif()
list(APPEND NOSTDINC ${_OUTPUT})
endforeach()

View file

@ -33,19 +33,16 @@ Install Requirements and Dependencies
introduction of LaTeX->PDF support for the docs, as the texlive footprint is
massive and not needed by users not building PDF documentation.)
There are 3 different ways of developing for Zephyr on Microsoft Windows:
There are 2 different ways of developing for Zephyr on Microsoft Windows:
#. :ref:`windows_install_native`
#. :ref:`windows_install_wsl`
#. :ref:`windows_install_msys2`
The first option is fully Windows native; the rest require emulation layers
that may result in slower build times. All three are included for completeness,
The first option is fully Windows native; the other requires emulation layers
that may result in slower build times. Both are included for completeness,
but unless you have a particular requirement for a UNIX tool that is not
available on Windows, we strongly recommend you use the Windows Command Prompt
option for performance and minimal dependency set. If you have a Unix tool
requirement, then we recommend trying the Windows Subsystem for Linux instead of
MSYS2.
option for performance and minimal dependency set.
.. _windows_install_native:
@ -126,91 +123,9 @@ command-prompt. This allows you to use software such as the :ref:`Zephyr SDK
#. Follow the Ubuntu instructions in the :ref:`installation_linux` document.
.. NOTE FOR DOCS AUTHORS: as a reminder, do *NOT* put dependencies for building
the documentation itself here.
.. _windows_install_msys2:
Option 3: MSYS2
===============
Alternatively, one can set up the Zephyr development environment with
MSYS2, a modern UNIX environment for Windows. Follow the steps below
to set it up:
#. Download and install :program:`MSYS2`. Download the appropriate (32 or
64-bit) MSYS2 installer from the `MSYS2 website`_ and execute it. On the
final installation screen, check the "Run MSYS2 now." box to start up an
MSYS2 shell when installation is complete. Follow the rest of the
installation instructions on the MSYS2 website to update the package
database and core system packages. You may be advised to "terminate MSYS2
without returning to shell and check for updates again". If so, simply
close the ``MSYS2 MSYS Shell`` desktop app and run it again to complete the update.)
#. Launch the ``MSYS2 MSYS Shell`` desktop app from your start menu (if it's not still open).
.. note::
Make sure you start ``MSYS2 MSYS Shell``, not ``MSYS2 MinGW Shell``.
.. note::
If you need to inherit the existing Windows environment variables into
MSYS2 you will need to create a **Windows** environment variable like so::
``MSYS2_PATH_TYPE=inherit``.
.. note::
There are multiple ``export`` statements in this tutorial. You can avoid
typing them every time by placing them at the bottom of your
``~/.bash_profile`` file.
#. If you're behind a corporate firewall, you'll likely need to specify a
proxy to get access to internet resources::
export http_proxy=http://proxy.mycompany.com:123
export https_proxy=$http_proxy
#. Update MSYS2's packages and install the dependencies required to build
Zephyr (you may need to restart the MSYS2 shell):
.. code-block:: console
pacman -Syu
pacman -S git cmake make gcc dtc diffutils ncurses-devel python3 gperf tar
#. Compile :program:`Ninja` from source (Ninja is not available as
an MSYS2 package) and install it:
.. code-block:: console
git clone git://github.com/ninja-build/ninja.git && cd ninja
git checkout release
./configure.py --bootstrap
cp ninja.exe /usr/bin/
#. Install pip and the required Python modules::
curl -O 'https://bootstrap.pypa.io/get-pip.py'
./get-pip.py
rm get-pip.py
You're now almost ready to continue with the rest of the getting started guide.
Since you're using MSYS2, when you're cloning Zephyr in the next step of the
guide, use this command line instead (i.e. add the ``--config
core.autocrlf=false`` option).
.. code-block:: console
git clone --config core.autocrlf=false https://github.com/zephyrproject-rtos/zephyr
Furthermore, when you start installing Python dependencies, you'll want to add
the ``--user`` option as is recommended on Linux.
.. NOTE FOR DOCS AUTHORS: as a reminder, do *NOT* put dependencies for building
the documentation itself here.
.. _Chocolatey: https://chocolatey.org/
.. _Chocolatey install: https://chocolatey.org/install
.. _MSYS2 website: http://www.msys2.org/
.. _Install the Windows Subsystem for Linux (WSL): https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

View file

@ -1,16 +0,0 @@
import os
def crash_if_zephyr_was_cloned_with_wrong_line_endings():
f = open('{}/Kconfig'.format(os.environ["ZEPHYR_BASE"]), 'U')
f.readline()
error_msg = "Re-clone with autocrlf false. $ git config --global core.autocrlf false"
assert f.newlines == '\n', error_msg
def main():
crash_if_zephyr_was_cloned_with_wrong_line_endings()
if __name__ == "__main__":
main()