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

gcc FileNotFoundError #130

Closed
baszalmstra opened this issue Oct 26, 2021 · 0 comments · Fixed by #159
Closed

gcc FileNotFoundError #130

baszalmstra opened this issue Oct 26, 2021 · 0 comments · Fixed by #159

Comments

@baszalmstra
Copy link

When building in an environment where gcc is not named gcc but something different like x86_64-conda-linux-gnu-cc. colcon-ros errors with this error at the end of a build:

Traceback (most recent call last):
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/site-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/site-packages/colcon_core/task/__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/site-packages/colcon_ros/task/catkin/build.py", line 98, in build
    additional_hooks += create_pkg_config_path_environment_hooks(
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/site-packages/colcon_ros/task/cmake/__init__.py", line 24, in create_pkg_config_path_environment_hooks
    multiarch = get_multiarch()
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/site-packages/colcon_ros/task/cmake/__init__.py", line 46, in get_multiarch
    output = subprocess.check_output(['gcc', '-print-multiarch'])
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/builds/.workspace-aa0dc32c/.env/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'gcc'

An error is caught here but not the FileNotFound error.

I don't know exactly what the best approach is. We could either use the $CC variable but that might not refer to a GCC compiler, or catch the FileNotFoundError and rely on the backup of using dpkg-architecture.

@baszalmstra baszalmstra changed the title gcc FileNotFound gcc FileNotFoundError Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant