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

conan-center hook always reports "pre_export(): could not get source code" on WIndows #157

Closed
tt4g opened this issue Feb 16, 2020 · 17 comments

Comments

@tt4g
Copy link

tt4g commented Feb 16, 2020

I tried to build after enabling conan-center hook on Windows 10 but I get error message "ERROR: [HOOK - conan-center.py] pre_export(): could not get source code".
This recipe can build on docker container conanio/gcc7.

Is conan-center hook not supported Windows 10?

@tt4g
Copy link
Author

tt4g commented Feb 16, 2020

I'm using conan installed by Windows installer, that is bad?

@uilianries
Copy link
Member

Hi @tt4g which Conan client version are you running? Where did you install conan hook files (system path e.g. C:/Users/foobar/.conan)?

@tt4g
Copy link
Author

tt4g commented Feb 17, 2020

I'm using 1.22.2:

$ conan --version
Conan version 1.22.2

Hooks installed here: C:\Users\tt\.conan\hooks, and list:

$ ls -lha
total 89K
drwxr-xr-x 1 tt 197611    0  2月 16 14:55 ./
drwxr-xr-x 1 tt 197611    0  2月 16 15:50 ../
-rw-r--r-- 1 tt 197611  421  2月 16 15:50 attribute_checker.py
-rwxr-xr-x 1 tt 197611 9.1K  2月 16 15:50 binary_linter.py*
-rw-r--r-- 1 tt 197611  11K  2月 16 15:50 bintray_updater.py
-rw-r--r-- 1 tt 197611  31K  2月 16 15:50 conan-center.py
-rw-r--r-- 1 tt 197611 3.2K  2月 16 15:50 export_metadata.py
-rwxr-xr-x 1 tt 197611 6.6K  2月 16 15:50 github_updater.py*
-rw-r--r-- 1 tt 197611 1.2K  2月 16 15:50 members_typo_checker.py
-rw-r--r-- 1 tt 197611 3.4K  2月 16 15:50 recipe_linter.py
-rw-r--r-- 1 tt 197611  920  2月 16 15:50 spdx_checker.py

conan Installed: C:\Program Files\Conan
conan executable file: C:\Program Files\Conan\conan\conan.exe

@tt4g
Copy link
Author

tt4g commented Feb 17, 2020

I challenged by disabling the Windows application alias. However, I got the same message as the issue.

@memsharded
Copy link
Member

Yes, the Windows installers bundles a python interpreter in it, so it might be an issue. If you could try to run in Windows with the pip-installed Conan, that would help to isolate the issue.

@tt4g
Copy link
Author

tt4g commented Feb 17, 2020

@memsharded Right. conan installed by pip is works for me.

I was uninstalling python because Windows application alias often do bad when calling python3. That was bad.

@tt4g tt4g closed this as completed Feb 17, 2020
@memsharded
Copy link
Member

Thanks @tt4g for following up!

@uilianries
Copy link
Member

@memsharded should we investigate Windows installer?

@memsharded
Copy link
Member

@uilianries yes, better. Please do a quick check if the hooks work for the Windows installer. Thanks!

@steinerthomas
Copy link

steinerthomas commented Oct 31, 2020

The hooks still doesn't work for the Windows installer. I also had to install conan via pip.
@uilianries any updates?

@claremacrae
Copy link

The same error occurs when running conan installed via choco.

@alejandro-colomar
Copy link

alejandro-colomar commented May 19, 2021

CC @SpaceIm
I got this problem using the Debian installer on Debian Sid

@alejandro-colomar
Copy link

alejandro-colomar commented May 19, 2021

~/src/conan/conan-center-index$ conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks
Trying to clone repo: https://github.com/conan-io/hooks.git
Repo cloned!
Copying file conan-center.py to /home/alx/.conan/hooks/.
Copying file export_metadata.py to /home/alx/.conan/hooks/.
Copying file spdx_checker.py to /home/alx/.conan/hooks/.
Copying file members_typo_checker.py to /home/alx/.conan/hooks/.
Copying file recipe_linter.py to /home/alx/.conan/hooks/.
Copying file attribute_checker.py to /home/alx/.conan/hooks/.
Copying file binary_linter.py to /home/alx/.conan/hooks/.
Copying file github_updater.py to /home/alx/.conan/hooks/.
~/src/conan/conan-center-index$ conan config set hooks.conan-center
~/src/conan/conan-center-index$ cd recipes/libavrocpp/all/
~/src/conan/conan-center-index/recipes/libavrocpp/all$ conan create . libavrocpp/1.10.2@
ERROR: [HOOK - conan-center.py] pre_export(): could not get source code
~/src/conan/conan-center-index/recipes/libavrocpp/all$ conan create . libavrocpp/1.10.3@
ERROR: [HOOK - conan-center.py] pre_export(): could not get source code
~/src/conan/conan-center-index/recipes/libavrocpp/all$ conan create . libavrocpp/1.10.1@
ERROR: [HOOK - conan-center.py] pre_export(): could not get source code

@uilianries
Copy link
Member

I think this problem deserves further investigation, but one issue per package manager/platform. I'll check for Debian first

@refactorTractor
Copy link

refactorTractor commented Jul 21, 2021

TLDR: Attribute checker could be the problem

Here's my two cents: I have conan installed with the windows installer. I had upgraded versions, and as someone who has been contributing to the conan-center once in a while, I had some hooks. I had been getting the "could not get source code" error. I eventually looked into my hook config to take them out. I noticed I had the attribute-checker and the conan-center hooks. Out of curiosity, I removed only the attribute checker, and now it works...

I don't know whether this is a problem with the attribute checker, or it's because of trying to use multiple hooks, or that it is only between attribute checker and conan center hooks that a conflict emerges.

@chausner
Copy link

I am running into this issue on Windows. I installed Conan via winget.

@HappySeaFox
Copy link

HappySeaFox commented Apr 15, 2022

I also face the issue both on Windows 7 x64 and LUbuntu 21.04 64-bit. I installed conan from the Downloads page on both the systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants