Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observing a Python path Issue with Git based Compile #12066

Closed
vikramuk opened this issue Dec 13, 2018 · 7 comments · Fixed by #12095
Closed

Observing a Python path Issue with Git based Compile #12066

vikramuk opened this issue Dec 13, 2018 · 7 comments · Fixed by #12095
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@vikramuk
Copy link

vikramuk commented Dec 13, 2018

Describe the bug
environment variables are sourced but Python version is different when/with cmake runs

To Reproduce
Steps to reproduce the behavior:
using Gitbash to set environment and start build.

$ cmake -GNinja -DBOARD=stm32_min_dev
CMake Error at C:/ProgApps/cmake-3.13.1-win64-x64/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find PythonInterp: Found unsuitable version "1.4", but required

is at least "3.4" (found C:/ProgApps/Anaconda/python.exe)
Call Stack (most recent call first):
C:/ProgApps/cmake-3.13.1-win64-x64/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
C:/ProgApps/Zephyr/cmake/backports/FindPythonInterp.cmake:165 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
C:/ProgApps/Zephyr/cmake/app/boilerplate.cmake:95 (include)
CMakeLists.txt:3 (include)

-- Configuring incomplete, errors occurred!

$ bash --version
GNU bash, version 4.4.19(2)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ where python
C:\ProgApps*Py37*\python.exe

Expected behavior
Able to compile and generate binary for STM32 similar to https://docs.zephyrproject.org/latest/boards/arm/stm32_min_dev/doc/stm32_min_dev.html

Impact
not able to compile on windows.

Screenshots or console output

Environment (please complete the following information):

  • OS: Windows 10 Enterprise
  • Toolchain
    VERSION_MAJOR = 1
    VERSION_MINOR = 13
    PATCHLEVEL = 99
    VERSION_TWEAK = 0
    EXTRAVERSION = d62e861

Additional context
Unable to configure the Python environment for Build to complete.
![gitbasherror](https://user-images.githubusercontent.com/4569591/49938156-08a5cf80-feff-11e8-8d77-0e1393a38e
samples-hello_world.zip
c4.png)

@vikramuk vikramuk added the bug The issue is a bug, or the PR is fixing a bug label Dec 13, 2018
@carlescufi
Copy link
Member

@vikramuk can you please describe what the issue is?

@vikramuk
Copy link
Author

I know it might be a configuration issue.. but just want someone to update if there have been similar issues during start-up.

@SebastianBoe
Copy link
Collaborator

I don't think using 'bash' (MSYS) on Windows is supported. Can you reproduce the issue with cmd.exe?

@carlescufi
Copy link
Member

carlescufi commented Dec 13, 2018

@SebastianBoe bash is indeed not supported, only cmd.exe.

@vikramuk if you want to discuss the relevant forums are the mailing lists and Slack channels. Unless you have a clear description please close this issue and ask for help in the places mentioned.
Sorry, I now see you described the issue. Unfortunately Git bash is currently not supported in Zephyr. Can you please try using cmd.exe and then verify if the issue is still present? You can also open a new ticket with a feature request to support building from Git Bash.

@vikramuk
Copy link
Author

Hi,
I still see the Error after running Zephyr-env.cmd

C:\ProgApps\Zephyr\samples\hello_world>cmake -GNinja -DBOARD=stm32_min_dev
CMake Error at C:/ProgApps/cmake-3.13.1-win64-x64/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find PythonInterp: Found unsuitable version "1.4", but required
is at least "3.4" (found C:/ProgApps/Anaconda/python.exe)
Call Stack (most recent call first):
C:/ProgApps/cmake-3.13.1-win64-x64/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
C:/ProgApps/Zephyr/cmake/backports/FindPythonInterp.cmake:165 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
C:/ProgApps/Zephyr/cmake/app/boilerplate.cmake:95 (include)
CMakeLists.txt:3 (include)

-- Configuring incomplete, errors occurred!

@SebastianBoe
Copy link
Collaborator

SebastianBoe commented Dec 14, 2018

could you run "C:> where python" ? And "--version" on each of the programs found.

And do the same for 'python3'.

We need to prove that it should be possible for FindPythonInterp.cmake to find an appropriate version.

EDIT: Nevermind, I found the bug. Will fix.

@vikramuk
Copy link
Author

vikramuk commented Dec 14, 2018

I ran the same with Qemu ..
Directory of C:\ProgApps\Zephyr\samples\synchronization

12/06/2018 04:47 PM

.
12/06/2018 04:47 PM ..
12/06/2018 04:47 PM 175 CMakeLists.txt
12/06/2018 04:47 PM 75 prj.conf
12/06/2018 04:47 PM 1,015 README.rst
12/06/2018 04:47 PM 696 sample.yaml
12/06/2018 04:47 PM src
4 File(s) 1,961 bytes
3 Dir(s) 435,901,440,000 bytes free

C:\ProgApps\Zephyr\samples\synchronization>mkdir build

C:\ProgApps\Zephyr\samples\synchronization>cmake -GNinja -DBOARD=qemu_x86
-- Found PythonInterp: C:/ProgApps/Py37/python.exe (found suitable version "3.7.1", minimum required is "3.4")
CMake Error at C:/ProgApps/Zephyr/cmake/app/boilerplate.cmake:102 (message):
Source directory equals build directory. In-source builds are not
supported. Please specify a build directory, e.g. cmake -Bbuild -H.
Call Stack (most recent call first):
CMakeLists.txt:3 (include)

-- Configuring incomplete, errors occurred!

_C:\ProgApps\Zephyr\samples\synchronization>where python
C:\ProgApps\Py37\python.exe

C:\ProgApps\Zephyr\samples\synchronization>where python3
INFO: Could not find files for the given pattern(s)._

SebastianBoe added a commit to SebastianBoe/zephyr that referenced this issue Dec 20, 2018
Fixed a bug where an old version of python on path would break the
python detection mechanism.

This fixes zephyrproject-rtos#12066

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
carlescufi pushed a commit that referenced this issue Dec 21, 2018
Fixed a bug where an old version of python on path would break the
python detection mechanism.

This fixes #12066

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants