openwrt / openwrt/packages

meson issues with glib2?

Open
#17,308 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

release/21.02 stale
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Name:meson
Maintainer: @Andre Heider
Openwrt branch : 21.02.1
host: Ubuntu 20.04

Question: may i know how to fix this issue? I tried "make clean" after error happened first time then "make -j1 V=sc" again.
same issue, so that i tried :

make -j1 package/feeds/packages/glib2/compile V=sc

same error copied below:

make[2]: Entering directory '/home/ouzy/kiddin9/openwrt/feeds/packages/libs/glib2'
mkdir -p /home/ouzy/kiddin9/openwrt/dl
SHELL= flock /home/ouzy/kiddin9/openwrt/tmp/.glib-2.66.4.tar.xz.flock -c '      /home/ouzy/kiddin9/openwrt/scripts/download.pl "/home/ouzy/kiddin9/openwrt/dl" "glib-2.66.4.tar.xz" "97df8670e32f9fd4f7392b0980e661dd625012015d58350da1e58e343f4af984" "" "@GNOME/glib/2.66"    '
rm -f /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/.configured_*
rm -f /home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/stamp/.glib2_installed
/home/ouzy/kiddin9/openwrt/staging_dir/host/bin/sed -e "s|@CC@|'ccache', 'gcc',|" -e "s|@CXX@|'ccache', 'g++',|" -e "s|@PKGCONFIG@|/home/ouzy/kiddin9/openwrt/staging_dir/host/bin/pkg-config|" -e "s|@CFLAGS@|'-O2', '-I/home/ouzy/kiddin9/openwrt/staging_dir/host/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/host/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/host/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/host/include',|" -e "s|@CXXFLAGS@|'-I/home/ouzy/kiddin9/openwrt/staging_dir/host/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/host/include',|" -e "s|@LDFLAGS@|'-L/home/ouzy/kiddin9/openwrt/staging_dir/host/lib', '-L/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib', '-L/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/host/lib', '-liconv', '-Wl,-rpath,/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib',|" -e "s|@PREFIX@|/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg|" < /home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib/meson/openwrt-native.txt.in > /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/openwrt-native.txt
/home/ouzy/kiddin9/openwrt/staging_dir/host/bin/sed -e "s|@CC@|'ccache_cc',|" -e "s|@CXX@|'ccache_cxx',|" -e "s|@AR@|x86_64-openwrt-linux-musl-gcc-ar|" -e "s|@STRIP@|x86_64-openwrt-linux-musl-strip|" -e "s|@NM@|x86_64-openwrt-linux-musl-gcc-nm|" -e "s|@PKGCONFIG@|/home/ouzy/kiddin9/openwrt/staging_dir/host/bin/pkg-config|" -e "s|@CFLAGS@|'-O2', '-pipe', '-fno-caller-saves', '-fno-plt', '-fhonour-copts', '-Wno-error=unused-but-set-variable', '-Wno-error=unused-result', '-fmacro-prefix-map=/home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4=glib-2.66.4', '-Wformat', '-Werror=format-security', '-fstack-protector', '-D_FORTIFY_SOURCE=1', '-Wl,-z,now', '-Wl,-z,relro', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/include', '-ffunction-sections', '-fdata-sections', '-I/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/usr/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/fortify', '-I/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/include',|" -e "s|@CXXFLAGS@|'-O2', '-pipe', '-fno-caller-saves', '-fno-plt', '-fhonour-copts', '-Wno-error=unused-but-set-variable', '-Wno-error=unused-result', '-fmacro-prefix-map=/home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4=glib-2.66.4', '-Wformat', '-Werror=format-security', '-fstack-protector', '-D_FORTIFY_SOURCE=1', '-Wl,-z,now', '-Wl,-z,relro', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/include', '-ffunction-sections', '-fdata-sections', '-I/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/usr/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include/fortify', '-I/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/include', '-I/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/include',|" -e "s|@LDFLAGS@|'-L/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/usr/lib', '-L/home/ouzy/kiddin9/openwrt/staging_dir/toolchain-x86_64_gcc-8.4.0_musl/lib', '-znow', '-zrelro', '-L/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/lib', '-Wl,-rpath-link=/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libiconv-stub/lib', '-L/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/lib', '-Wl,-rpath-link=/home/ouzy/kiddin9/openwrt/staging_dir/target-x86_64_musl/usr/lib/libintl-stub/lib', '-Wl,--gc-sections',|" -e "s|@ARCH@|"x86_64"|" -e "s|@CPU@|"64"|" -e "s|@ENDIAN@|little|" < /home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib/meson/openwrt-cross.txt.in > /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/openwrt-cross.txt
/home/ouzy/kiddin9/openwrt/staging_dir/host/bin/python /home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib/meson/meson.py  --buildtype plain --native-file /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/openwrt-native.txt --cross-file /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/openwrt-cross.txt -Ddefault_library=both -Diconv=external -Dselinux=disabled -Dlibmount=disabled -Dinternal_pcre=true -Dman=false -Ddtrace=false -Dsystemtap=false -Dgtk_doc=false -Dbsymbolic_functions=true -Dforce_posix_threads=true -Dfam=false -Dinstalled_tests=false -Dnls=disabled -Doss_fuzz=disabled -Dglib_assert=false -Dglib_checks=false -Dxattr=true -Db_lto=true /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/openwrt-build /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/openwrt-build/..
Traceback (most recent call last):
  File "/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib/meson/meson.py", line 18, in <module>
    from mesonbuild._pathlib import Path
  File "/home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib/meson/mesonbuild/_pathlib.py", line 38
    def resolve(self, strict: bool = False) -> 'Path':
                            ^
SyntaxError: invalid syntax
make[2]: *** [Makefile:133: /home/ouzy/kiddin9/openwrt/build_dir/target-x86_64_musl/glib-2.66.4/.configured_efb2d3cf01c707184fb77fd0fe149f94] Error 1
make[2]: Leaving directory '/home/ouzy/kiddin9/openwrt/feeds/packages/libs/glib2'
time: package/feeds/packages/glib2/compile#0.54#0.25#0.67
    ERROR: package/feeds/packages/glib2 failed to build.
make[1]: *** [package/Makefile:114: package/feeds/packages/glib2/compile] Error 1
make[1]: Leaving directory '/home/ouzy/kiddin9/openwrt'
make: *** [/home/ouzy/kiddin9/openwrt/include/toplevel.mk:230: package/feeds/packages/glib2/compile] Error 2

nano /home/ouzy/kiddin9/openwrt/staging_dir/hostpkg/lib/meson/meson.py

#!/usr/bin/env python3

# Copyright 2016 The Meson development team

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
from mesonbuild._pathlib import Path

# If we're run uninstalled, add the script directory to sys.path to ensure that
# we always import the correct mesonbuild modules even if PYTHONPATH is mangled
meson_exe = Path(sys.argv[0]).resolve()
if (meson_exe.parent / 'mesonbuild').is_dir():
    sys.path.insert(0, str(meson_exe.parent))

from mesonbuild import mesonmain

if __name__ == '__main__':
    sys.exit(mesonmain.main())

nano ./build_dir/hostpkg/pypi/meson-0.56.0/mesonbuild/_pathlib.py

# Copyright 2020 The Meson development team

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
import typing as T

# Python 3.5 does not have the strict kwarg for resolve and always
# behaves like calling resolve with strict=True in Python 3.6+
#
# This module emulates the behavior of Python 3.6+ by in Python 3.5 by
# overriding the resolve method with a bit of custom logic
#
# TODO: Drop this module as soon as Python 3.5 support is dropped

if T.TYPE_CHECKING:
    from pathlib import Path
else:
    if sys.version_info.major <= 3 and sys.version_info.minor <= 5:

        # Inspired by https://codereview.stackexchange.com/questions/162426/subclassing-pathlib-path
        import pathlib
        import os

        # Can not directly inherit from pathlib.Path because the __new__
        # operator of pathlib.Path() returns a {Posix,Windows}Path object.
        class Path(type(pathlib.Path())):
            def resolve(self, strict: bool = False) -> 'Path':
                try:
                    return super().resolve()
                except FileNotFoundError:
                    if strict:
                        raise
                    return Path(os.path.normpath(str(self)))

    else:
        from pathlib import Path

from pathlib import PurePath, PureWindowsPath, PurePosixPath


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the glib2 package Makefile and the Meson entry points at staging_dir/hostpkg/lib/meson/meson.py and build_dir/hostpkg/pypi/meson-0.56.0/mesonbuild/_pathlib.py. Re-run the shown package/feeds/packages/glib2/compile command in the reported environment; done means the Meson configuration step completes without the displayed SyntaxError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.