问题描述
我想在Yocto(Zeus分支)上构建perf,以获取没有python2的图像。食谱是这样的: https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/perf/perf.bb?h=zeus-22.0.4
运行此配方会产生此错误:
| ERROR: Execution of '/home/yocto/poseidon-build/tmp/work/imx6dl_poseidon_revb-poseidon-linux-gnueabi/perf/1.0-r9/temp/run.do_compile.19113' Failed with exit code 1:
| make: Entering directory '/home/yocto/poseidon-build/tmp/work/imx6dl_poseidon_revb-poseidon-linux-gnueabi/perf/1.0-r9/perf-1.0/tools/perf'
| BUILD: Doing 'make -j4' parallel build
| Warning: arch/x86/include/asm/disabled-features.h differs from kernel
| Warning: arch/x86/include/asm/required-features.h differs from kernel
| Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
| Warning: arch/arm/include/uapi/asm/perf_regs.h differs from kernel
| Warning: arch/arm64/include/uapi/asm/perf_regs.h differs from kernel
| Warning: arch/powerpc/include/uapi/asm/perf_regs.h differs from kernel
| Warning: arch/x86/include/uapi/asm/perf_regs.h differs from kernel
| Warning: arch/x86/include/uapi/asm/kvm.h differs from kernel
| Warning: arch/x86/include/uapi/asm/kvm_perf.h differs from kernel
| Warning: arch/x86/include/uapi/asm/svm.h differs from kernel
| Warning: arch/x86/include/uapi/asm/vmx.h differs from kernel
| Warning: arch/powerpc/include/uapi/asm/kvm.h differs from kernel
| Warning: arch/s390/include/uapi/asm/kvm.h differs from kernel
| Warning: arch/s390/include/uapi/asm/kvm_perf.h differs from kernel
| Warning: arch/s390/include/uapi/asm/sie.h differs from kernel
| Warning: arch/arm/include/uapi/asm/kvm.h differs from kernel
| Warning: arch/arm64/include/uapi/asm/kvm.h differs from kernel
| Warning: arch/x86/lib/memcpy_64.S differs from kernel
| Warning: arch/x86/lib/memset_64.S differs from kernel
|
| Auto-detecting system features:
| ... dwarf: [ on ]
| ... dwarf_getlocations: [ on ]
| ... glibc: [ on ]
| ... gtk2: [ OFF ]
| ... libaudit: [ OFF ]
| ... libbfd: [ on ]
| ... libelf: [ on ]
| ... libnuma: [ OFF ]
| ... numa_num_possible_cpus: [ OFF ]
| ... libperl: [ OFF ]
| ... libpython: [ on ]
| ... libslang: [ on ]
| ... libcrypto: [ on ]
| ... libunwind: [ on ]
| ... libdw-dwarf-unwind: [ on ]
| ... zlib: [ on ]
| ... lzma: [ on ]
| ... get_cpuid: [ OFF ]
| ... bpf: [ on ]
|
| Makefile.config:352: DWARF support is off,BPF prologue is disabled
| Makefile.config:547: Missing perl devel files. disabling perl scripting support,please install perl-ExtUtils-Embed/libperl-dev
| Makefile.config:594: Python 3 is not yet supported; please set
| Makefile.config:595: PYTHON and/or PYTHON_CONfig appropriately.
| Makefile.config:596: If you also have Python 2 installed,then
| Makefile.config:597: try something like:
| Makefile.config:598:
| Makefile.config:599: make PYTHON=python2
| Makefile.config:600:
| Makefile.config:601: Otherwise,disable Python support entirely:
| Makefile.config:602:
| Makefile.config:603: make NO_LibpyTHON=1
| Makefile.config:604:
| Makefile.config:605: *** . Stop.
| Makefile.perf:205: recipe for target 'sub-make' Failed
| make[1]: *** [sub-make] Error 2
| Makefile:68: recipe for target 'all' Failed
| make: *** [all] Error 2
| make: Leaving directory '/home/yocto/poseidon-build/tmp/work/imx6dl_poseidon_revb-poseidon-linux-gnueabi/perf/1.0-r9/perf-1.0/tools/perf'
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/yocto/sources/poky/Meta/recipes-kernel/perf/perf.bb:do_compile) Failed with exit code '1'
NOTE: Tasks Summary: Attempted 1947 tasks of which 1946 didn't need to be rerun and 1 Failed.
看看食谱,似乎设置了libpython?:
PACKAGECONfig ??= "scripting tui libunwind"
PACKAGECONfig[dwarf] = ",NO_DWARF=1"
PACKAGECONfig[scripting] = ",NO_LIBPERL=1 NO_LibpyTHON=1,perl python3"
# gui support was added with kernel 3.6.35
# since 3.10 libnewt was replaced by slang
# to cover a wide range of kernel we add both dependencies
PACKAGECONfig[tui] = ",NO_NEWT=1,libnewt slang"
PACKAGECONfig[libunwind] = ",NO_libunwind=1 NO_LIBDW_DWARF_UNWIND=1,libunwind"
PACKAGECONfig[libnuma] = ",NO_LIBNUMA=1"
PACKAGECONfig[systemtap] = ",NO_SDT=1,systemtap"
PACKAGECONfig[jvmti] = ",NO_jvmti=1"
# libaudit support would need scripting to be enabled
PACKAGECONfig[audit] = ",NO_LIBAUDIT=1,audit"
PACKAGECONfig[manpages] = ",xmlto-native asciidoc-native"
为什么不拿起旗帜?
解决方法
PACKAGECONFIG
默认包含scripting
。
PACKAGECONFIG
选项的定义如下:
PACKAGECONFIG[f1] = "--with-f1,\
--without-f1,\
build-deps-for-f1,\
runtime-deps-for-f1,\
runtime-recommends-for-f1,\
packageconfig-conflicts-for-f1 \
"
PACKAGECONFIG[scripting]
设置为",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python3"
。在这里看到第一个逗号?这意味着在之后定义的是未选择{strong> 的scripting
。
因此,如果您不希望提取python依赖性,只需将PACKAGECONFIG
设置为其中没有scripting
的值。
尽管实际上我很惊讶默认值没有建立,但这绝对是由自动构建器测试过的。可能还有其他情况吗?
c.f .: https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-PACKAGECONFIG