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

[bug] alpine not use lsb_release but use /etc/os-release #9452

Closed
hsz1273327 opened this issue Aug 19, 2021 · 3 comments · Fixed by #9462
Closed

[bug] alpine not use lsb_release but use /etc/os-release #9452

hsz1273327 opened this issue Aug 19, 2021 · 3 comments · Fixed by #9462
Milestone

Comments

@hsz1273327
Copy link

Environment Details (include every applicable attribute)

  • alpine linux 3.13 in arm64
  • gcc 10
  • Conan 1.39.0
  • Python 3.9

Steps to reproduce (Include if Applicable)

when run conan remote add throw exception

Logs (Executed commands with output) (Include/Attach if Applicable)

#9 32.64 ERROR: Error detecting os_info

#9 34.69 Traceback (most recent call last):

#9 34.70   File "/usr/bin/conan", line 33, in <module>

#9 34.70     sys.exit(load_entry_point('conan==1.39.0', 'console_scripts', 'conan')())

#9 34.70   File "/usr/bin/conan", line 25, in importlib_load_entry_point

#9 34.70     return next(matches).load()

#9 34.70   File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load

#9 34.71     module = import_module(match.group('module'))

#9 34.71   File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module

#9 34.71     return _bootstrap._gcd_import(name[level:], package, level)

#9 34.71   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import

#9 34.71   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load

#9 34.72   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked

#9 34.72   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked

#9 34.72   File "<frozen importlib._bootstrap_external>", line 855, in exec_module

#9 34.72   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed

#9 34.72   File "/usr/lib/python3.9/site-packages/conans/conan.py", line 7, in <module>

#9 34.73     from conans.client.command import main

#9 34.73   File "/usr/lib/python3.9/site-packages/conans/client/command.py", line 16, in <module>

#9 34.73     from conans.client.conan_api import Conan, default_manifest_folder, _make_abs_path, ProfileData

#9 34.73   File "/usr/lib/python3.9/site-packages/conans/client/conan_api.py", line 11, in <module>

#9 34.74     from conans.client.cache.cache import ClientCache

#9 34.74   File "/usr/lib/python3.9/site-packages/conans/client/cache/cache.py", line 23, in <module>

#9 34.74     from conans.paths.package_layouts.package_cache_layout import PackageCacheLayout

#9 34.74   File "/usr/lib/python3.9/site-packages/conans/paths/package_layouts/package_cache_layout.py", line 39, in <module>

#9 34.74     class PackageCacheLayout(object):

#9 34.74   File "/usr/lib/python3.9/site-packages/conans/paths/package_layouts/package_cache_layout.py", line 65, in PackageCacheLayout

#9 34.75     def export_sources(self):

#9 34.75   File "/usr/lib/python3.9/site-packages/conans/paths/package_layouts/package_cache_layout.py", line 27, in short_path

#9 34.75     if platform.system() == "Windows" or OSInfo().is_cygwin:  # Not for other subsystems

#9 34.75   File "/usr/lib/python3.9/site-packages/conans/client/tools/oss.py", line 159, in __init__

#9 34.75     self._get_linux_distro_info()

#9 34.75   File "/usr/lib/python3.9/site-packages/conans/client/tools/oss.py", line 179, in _get_linux_distro_info

#9 34.76     self.os_version = Version(distro.version())

#9 34.76   File "/usr/lib/python3.9/site-packages/distro.py", line 287, in version

#9 34.76     return _distro.version(pretty, best)

#9 34.76   File "/usr/lib/python3.9/site-packages/distro.py", line 741, in version

#9 34.78     self.lsb_release_attr('release'),

#9 34.78   File "/usr/lib/python3.9/site-packages/distro.py", line 903, in lsb_release_attr

#9 34.79     return self._lsb_release_info.get(attribute, '')

#9 34.79   File "/usr/lib/python3.9/site-packages/distro.py", line 556, in __get__

#9 34.80     ret = obj.__dict__[self._fname] = self._f(obj)

#9 34.80   File "/usr/lib/python3.9/site-packages/distro.py", line 1014, in _lsb_release_info

#9 34.82     stdout = subprocess.check_output(cmd, stderr=devnull)

#9 34.82   File "/usr/lib/python3.9/subprocess.py", line 424, in check_output

#9 34.83     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,

#9 34.83   File "/usr/lib/python3.9/subprocess.py", line 528, in run

#9 34.83     raise CalledProcessError(retcode, process.args,

#9 34.84 subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
@hsz1273327
Copy link
Author

and I found that this is fixed in distro 1.6.0,please update this requirement

@memsharded
Copy link
Member

Actually, there are 2 things here:

  • Update distro 1.6.0 if not risk of breaking
  • Fix OSInfo().is_cygwin if possible so it doesn't raise in this way for this platform.

@memsharded
Copy link
Member

#9462 is upgrading the distro version, this will be released in 1.40

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

Successfully merging a pull request may close this issue.

2 participants