Build failed on old branch

209 views
Skip to first unread message

Egor Ruban

unread,
May 29, 2025, 4:38:48 AM5/29/25
to sonicproject
Hi!

I'm trying to build 202305 branch, because my switch doesn't work on newer versions

Build envionment is virtual machine with ubuntu 20.04, 20Gb RAM and 16 cores 

Commands:
1) git clone https://github.com/sonic-net/sonic-buildimage
2) git checkout 202305
3) git submodule update --init --recursive
4) make init
5) make PLATFORM=broadcom configure
6) make SONIC_BUILD_JOBS=4 target/sonic-broadcom.bin

Then, after several hours of building I got tese logs:

*lots of lines*
3559f76cb8d79
  Stored in directory: /root/.cache/pip/wheels/91/e5/47/8d489718d63c88c6ca05ed6e3c0118324e3780c4d383d363bb
Successfully built pycairo
Installing collected packages: pycairo
Successfully installed pycairo-1.26.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
+ sudo https_proxy= LANG=C chroot ./fsroot-broadcom pip3 install --no-build-isolation pygobject
Collecting pygobject
  Downloading pygobject-3.52.3.tar.gz (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 4.1 MB/s eta 0:00:00
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
    status = _inner_run()
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
    return self.run(options, args)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/cli/req_command.py", line 68, in wrapper
    return func(self, options, args)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/commands/install.py", line 387, in run
    requirement_set = resolver.resolve(
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/resolver.py", line 96, in resolve
    result = self._result = resolver.resolve(
  File "/usr/local/lib/python3.9/dist-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 515, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/local/lib/python3.9/dist-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 388, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/local/lib/python3.9/dist-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 141, in _add_to_criteria
    if not criterion.candidates:
  File "/usr/local/lib/python3.9/dist-packages/pip/_vendor/resolvelib/structs.py", line 194, in __bool__
    return bool(self._sequence)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 163, in __bool__
    self._bool = any(self)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 147, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 37, in _iter_built
    candidate = func()
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/factory.py", line 187, in _make_candidate_from_link
    base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/factory.py", line 233, in _make_base_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 306, in __init__
    super().__init__(
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 159, in __init__
    self.dist = self._prepare()
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 236, in _prepare
    dist = self._prepare_distribution()
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 317, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/operations/prepare.py", line 532, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/operations/prepare.py", line 647, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/operations/prepare.py", line 71, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/distributions/sdist.py", line 69, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/req/req_install.py", line 575, in prepare_metadata
    self.metadata_directory = generate_metadata(
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/operations/build/metadata.py", line 34, in generate_metadata
    distinfo_dir = backend.prepare_metadata_for_build_wheel(metadata_dir)
  File "/usr/local/lib/python3.9/dist-packages/pip/_internal/utils/misc.py", line 723, in prepare_metadata_for_build_wheel
    return super().prepare_metadata_for_build_wheel(
  File "/usr/local/lib/python3.9/dist-packages/pip/_vendor/pyproject_hooks/_impl.py", line 224, in prepare_metadata_for_build_wheel
    return self._call_hook(
  File "/usr/local/lib/python3.9/dist-packages/pip/_vendor/pyproject_hooks/_impl.py", line 402, in _call_hook
    raise BackendUnavailable(
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Cannot import 'mesonpy'
+ clean_sys
+ sudo chroot ./fsroot-broadcom umount /sys/fs/cgroup/blkio /sys/fs/cgroup/cpu /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuacct /sys/fs/cgroup/cpuset /sys/fs/cgroup/devices /sys/fs/cgroup/freezer /sys/fs/cgroup/hugetlb /sys/fs/cgroup/memory /sys/fs/cgroup/misc /sys/fs/cgroup/net_cls /sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/net_prio /sys/fs/cgroup/perf_event /sys/fs/cgroup/pids /sys/fs/cgroup/rdma /sys/fs/cgroup/systemd /sys/fs/cgroup /sys
umount: /sys/fs/cgroup/cpu: no mount point specified.
umount: /sys/fs/cgroup/cpu,cpuacct: no mount point specified.
umount: /sys/fs/cgroup/cpuacct: no mount point specified.
umount: /sys/fs/cgroup/net_cls: no mount point specified.
umount: /sys/fs/cgroup/net_cls,net_prio: no mount point specified.
umount: /sys/fs/cgroup/net_prio: no mount point specified.
umount: /sys/fs/cgroup/systemd: no mount point specified.
+ true
+ true
+ sudo LANG=C chroot ./fsroot-broadcom umount /proc
+ true
[  FAIL LOG END  ] [ target/sonic-broadcom.bin ]
make: *** [slave.mk:1275: target/sonic-broadcom.bin] Error 1
make[1]: *** [Makefile.work:608: target/sonic-broadcom.bin] Error 2
make[1]: Leaving directory '/home/og/sonic-buildimage'
make: *** [Makefile:41: target/sonic-broadcom.bin] Error 2

Is it possible to fix or better try to figure out why my switch dowsn't work on newer versions?

Btw, switch is  AS7726-32X with ASIC Broadcom Trident III (BCM56870)

Aslam Mangaonkar

unread,
May 29, 2025, 6:59:15 AM5/29/25
to Egor Ruban, sonicproject
Hi ,

If you are not using host-services , you can build by applying following patch

diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2
index 020ebd81d..6f58a13ef 100644
--- a/files/build_templates/sonic_debian_extension.j2
+++ b/files/build_templates/sonic_debian_extension.j2
@@ -245,7 +245,7 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install system
 SONIC_HOST_SERVICES_PY3_WHEEL_NAME=$(basename {{sonic_host_services_py3_wheel_path}})
 sudo cp {{sonic_host_services_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME
 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install pycairo==1.26.0
-sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install --no-build-isolation pygobject
+#sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install --no-build-isolation pygobject
 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SONIC_HOST_SERVICES_PY3_WHEEL_NAME
 sudo rm -rf $FILESYSTEM_ROOT/$SONIC_HOST_SERVICES_PY3_WHEEL_NAME

diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk
index 9aa9c84a9..f982137cb 100755
--- a/platform/broadcom/rules.mk
+++ b/platform/broadcom/rules.mk
@@ -34,6 +34,19 @@ include $(PLATFORM_PATH)/../components/docker-gbsyncd-credo.mk
 include $(PLATFORM_PATH)/../components/docker-gbsyncd-broncos.mk
 endif
+export SONIC_BROADCOM_INSTALL_PYTHON_HOOK = y
+
+define broadcom_install_python_hook
+       @echo ">>> Installing meson, mesonpy, and ninja inside fsroot-broadcom..."
+       #sudo LANG=C chroot $(FSROOT) pip3 install meson mesonpy ninja
+       sudo LANG=C chroot ./fsroot-broadcom pip3 install meson mesonpy ninja
+endef


Pygobject is broken in ubuntu 20.04 because of mesonpy . 

If need host-service and do not want play with make files it is better to move to recent branchs.

Thanks
Aslam

--
You received this message because you are subscribed to the Google Groups "sonicproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonicproject...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sonicproject/5e5ff75e-8381-4e99-8eab-82e62e399e62n%40googlegroups.com.

tsado...@gmail.com

unread,
May 29, 2025, 7:37:54 AM5/29/25
to Egor Ruban, sonicproject

Hey Egor,

 

May I know what issue have you met with AS7326-54X and SONiC?

 

--

Tomasz Sadowski

Building SONiC & Linux Expertise in Network Engineering Teams

🔗 linkedin.com/in/tomasz-sadowski-it | Active in SONiC momentum

🌍 Open Networking Enthusiast

--

Egor Ruban

unread,
May 30, 2025, 6:06:22 AM5/30/25
to sonicproject
thank you, but didn't help..

Collecting PyGObject (from sonic-host-services==1.0)
  Downloading pygobject-3.52.3.tar.gz (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 4.7 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
 
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      + meson setup /tmp/pip-install-v6j0k35x/pygobject_f1795824e0474d81b63f134d4bfed0a5 /tmp/pip-install-v6j0k35x/pygobject_f1795824e0474d81b63f134d4bfed0a5/.mesonpy-rxski2o0 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dtests=false -Dwheel=true --wrap-mode=nofallback --native-file=/tmp/pip-install-v6j0k35x/pygobject_f1795824e0474d81b63f134d4bfed0a5/.mesonpy-rxski2o0/meson-python-native-file.ini
      The Meson build system
      Version: 1.8.1
      Source dir: /tmp/pip-install-v6j0k35x/pygobject_f1795824e0474d81b63f134d4bfed0a5
      Build dir: /tmp/pip-install-v6j0k35x/pygobject_f1795824e0474d81b63f134d4bfed0a5/.mesonpy-rxski2o0
      Build type: native build
      Project name: pygobject
      Project version: 3.52.3
      C compiler for the host machine: cc (gcc 10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
      C linker for the host machine: cc ld.bfd 2.35.2
      Host machine cpu family: x86_64
      Host machine cpu: x86_64
      Program python3 found: YES (/usr/bin/python3)
      Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
      Run-time dependency python found: YES 3.9
      Did not find CMake 'cmake'
      Found CMake: NO
      Run-time dependency girepository-2.0 found: NO (tried pkgconfig and cmake)
      Not looking for a fallback subproject for the dependency girepository-2.0 because:
      Use of fallback dependencies is disabled.
     
      ../meson.build:31:9: ERROR: Dependency 'girepository-2.0' is required but not found.
     
      A full log can be found at /tmp/pip-install-v6j0k35x/pygobject_f1795824e0474d81b63f134d4bfed0a5/.mesonpy-rxski2o0/meson-logs/meson-log.txt
      [end of output]
 
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
Reply all
Reply to author
Forward
0 new messages