[MacOS] error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Metadata
Current evaluation
Build failed on macOS and Ubuntu due to missing x86_64-linux-gnu-gcc during charmcraft pack. A workaround adding build-essential to charmcraft.yaml was provided. The issue was closed after a maintainer confirmed the bug and implemented a fix.
Suggested action: —
No scores available.
Issue body
Hi Team,
running on macOS 12.2.1 (Intel CPU) the charmcraft 1.4.0 and multipass 1.8.1
```
charmcraft init
charmcraft pack
```
see the following errors
```
2022-03-10 15:54:04.722 :: 2022-03-10 15:53:45.348 :: Collecting PyYAML
2022-03-10 15:54:04.722 :: 2022-03-10 15:53:45.389 :: Downloading PyYAML-6.0.tar.gz (124 kB)
2022-03-10 15:54:04.722 :: 2022-03-10 15:53:45.657 :: Installing build dependencies: started
2022-03-10 15:54:04.722 :: 2022-03-10 15:54:03.286 :: Installing build dependencies: finished with status 'error'
2022-03-10 15:54:04.722 :: 2022-03-10 15:54:03.286 :: ERROR: Command errored out with exit status 1:
2022-03-10 15:54:04.722 :: 2022-03-10 15:54:03.286 :: command: /root/parts/charm/build/staging-venv/bin/python3 /root/parts/charm/build/staging-venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-nedyydq_/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Cython
...
2022-03-10 15:54:04.724 :: 2022-03-10 15:54:03.342 :: x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/root/parts/charm/build/staging-venv/include -I/usr/include/python3.8 -c /tmp/pip-install-q6ivu611/Cython/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-3.8/tmp/pip-install-q6ivu611/Cython/Cython/Plex/Scanners.o
2022-03-10 15:54:04.724 :: 2022-03-10 15:54:03.342 :: unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
2022-03-10 15:54:04.724 :: 2022-03-10 15:54:03.342 :: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
```
charmcraft 1.4.0 and multipass 1.8.1 was installed with homebrew help
```
brew install charmcraft multipass
```
### Workaround
install build-essential as build dependency, it is needed to add the following section into `charmcraft.yaml`
```
parts:
charm:
build-packages:
- build-essential
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Build failed on macOS and Ubuntu due to missing x86_64-linux-gnu-gcc during charmcraft pack. A workaround adding build-essential to charmcraft.yaml was provided. The issue was closed after a maintainer confirmed the bug and implemented a fix. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after a maintainer confirmed the issue and volunteered to fix it. The author provided a workaround adding build-essential to charmcraft.yaml to resolve the missing compiler error. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed after maintainer acknowledged the issue. Resolved via a provided workaround: adding build-essential to charmcraft.yaml build-packages to fix the missing gcc error in multipass containers. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed after the author shared a workaround adding build-essential to charmcraft.yaml. A maintainer confirmed the issue and volunteered to implement a fix. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #708 fix "charmcraft pack" on macOS | charmcraft | closed | Superseded by PR #718, which fixes the root cause of the macOS charmcraft pack build failure involving missing Linux GCC tools. | |
| #1104 charmcraft pack on Ubuntu 23.04 (Lunar) fails. | charmcraft | closed | Charmcraft pack failed on Ubuntu 23.04 due to unavailable build environments. PR #1130 addressed the issue but was blocked by an external cloud-images bug. The issue was closed pending upstream resolution. |