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

无法编译使用bzip2 #5355

Open
firesxp opened this issue Sep 27, 2024 · 9 comments
Open

无法编译使用bzip2 #5355

firesxp opened this issue Sep 27, 2024 · 9 comments
Labels

Comments

@firesxp
Copy link

firesxp commented Sep 27, 2024

Xmake 版本

xmake v2.9.5+20240925

操作系统版本和架构

Ubuntu 24.04.1 LTS

描述问题

无法编译使用bzip2库

期待的结果

正常编译使用bzip2库

工程配置

xmake.lua配置

add_rules("mode.debug", "mode.release")
set_warnings("all", "error")
add_rules("plugin.compile_commands.autoupdate", {outputdir = ".vscode"})

add_requires("bzip2")

target("learn-asio1")
    set_languages("c++20")
    set_kind("binary")
    add_packages("bzip2") 
    add_files("src/*.cpp")

源代码

#include <bzlib.h>

#include <fstream>
#include <iostream>
#include <string>

int main() {
    std::string inputFile = "input.txt";
    std::string compressedFile = "compressed.bz2";
    std::string decompressedFile = "decompressed.txt";

    // Compression
    std::ifstream input(inputFile, std::ios::binary);
    std::ofstream output(compressedFile, std::ios::binary);

    BZFILE* bzf = BZ2_bzWriteOpen(&output, 9, 0, 0);
    char buffer[4096];
    while (input.good()) {
        input.read(buffer, sizeof(buffer));
        auto bytesRead = input.gcount();
        BZ2_bzWrite(&output, buffer, bytesRead);
    }
    BZ2_bzWriteClose(&output, 0, NULL, NULL);
    input.close();
    output.close();

    // Decompression
    input.open(compressedFile, std::ios::binary);
    std::ofstream decompressed(decompressedFile, std::ios::binary);

    bzf = BZ2_bzReadOpen(NULL, &input, 0, 0, NULL, 0);
    while (true) {
        char buffer[4096];
        auto bytesRead = BZ2_bzRead(&input, buffer, sizeof(buffer));
        if (bytesRead == BZ_STREAM_END) break;
        decompressed.write(buffer, bytesRead);
    }
    BZ2_bzReadClose(&input);
    input.close();
    decompressed.close();

    return 0;
}

附加信息和错误日志

⬢ [Docker] ❯ xmake -vD 
checking for gcc ... /usr/bin/gcc
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
finding bzip2 from xmake ..
checking for xmake::bzip2 ... no
finding bzip2 from pacman ..
checkinfo: cannot runv(pacman --version), No such file or directory
checking for pacman ... no
checking for pacman::bzip2 ... no
finding libbz2-dev from apt ..
checking for dpkg ... /usr/bin/dpkg
checking for apt::libbz2-dev ... no
checkinfo: cannot runv(emerge --version), No such file or directory
checking for emerge ... no
finding bzip2 from brew ..
checking for brew ... no
finding bzip2 from vcpkg ..
finding bzip2 from conan ..
finding bzip2 from pkgconfig ..
checking for pkg-config ... /usr/bin/pkg-config
finding bzip2 from system ..
checking for /usr/bin/clang ... ok
checking for the c compiler (cc) ... clang
checking for /usr/bin/clang ... ok
checking for flags (-fPIC) ... ok
> clang "-fPIC" "-Qunused-arguments" "-m64"
> /usr/bin/clang -c -Qunused-arguments -m64 -o /tmp/.xmake0/240927/_96892C0ED7884A108F1FAAAA8057B320.o /tmp/.xmake0/240927/_775FB00633BC4F66BF87D39CCDE5CF30.c
checking for flags (-fdiagnostics-color=always) ... ok
> clang "-fdiagnostics-color=always" "-Qunused-arguments" "-m64"
checking for /usr/bin/clang++ ... ok
checking for the linker (ld) ... clang++
checking for /usr/bin/clang++ ... ok
checking for flags (-fPIC) ... ok
> clang++ "-fPIC" "-m64" "-m64"
> /usr/bin/clang++ -o /tmp/.xmake0/240927/_96892C0ED7884A108F1FAAAA8057B320.b /tmp/.xmake0/240927/_96892C0ED7884A108F1FAAAA8057B320.o -m64 -lbzip2
/usr/bin/ld: cannot find -lbzip2: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
> checking for c links(bzip2)
> checking for c snippet(find_package/bzip2)
checkinfo: ...gramdir/core/sandbox/modules/import/core/tool/linker.lua:75: @programdir/core/sandbox/modules/os.lua:378: execv(/usr/bin/clang++ -o /tmp/.xmake0/240927/_96892C0ED7884A108F1FAAAA8057B320.b /tmp/.xmake0/240927/_96892C0ED7884A108F1FAAAA8057B320.o -m64 -lbzip2) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1004]:
    [@programdir/core/sandbox/modules/os.lua:378]: in function 'execv'
    [@programdir/modules/core/tools/gcc.lua:586]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:241]:
    [@programdir/core/tool/linker.lua:222]: in function 'link'
    [...gramdir/core/sandbox/modules/import/core/tool/linker.lua:73]: in function 'link'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:249]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:241]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
    [@programdir/modules/package/manager/system/find_package.lua:73]:
    [@programdir/modules/package/manager/find_package.lua:84]: in function '_find_package_with_builtin_rule'
    [@programdir/modules/package/manager/find_package.lua:130]: in function '_find_package'
    [@programdir/modules/package/manager/find_package.lua:194]:
    [@programdir/modules/lib/detect/find_package.lua:86]:
    [@programdir/core/package/package.lua:1875]: in function '_fetch_library'
    [@programdir/core/package/package.lua:2045]: in function 'fetch'
    [...modules/private/action/require/impl/install_packages.lua:340]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:241]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/async/runjobs.lua:223]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

checking for bzip2 ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> bzip2 1.0.8 
please input: y (y/n/m)
y
checkinfo: @programdir/core/sandbox/modules/os.lua:264: cannot runv(ping -c 1 -W 1 127.0.0.1), No such file or directory
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1004]:
    [@programdir/core/sandbox/modules/os.lua:264]: in function 'run'
    [@programdir/modules/detect/tools/find_ping.lua:41]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:241]:
    [.../core/sandbox/modules/import/lib/detect/find_program.lua:65]: in function '_do_check'
    [.../core/sandbox/modules/import/lib/detect/find_program.lua:89]: in function '_check'
    [.../core/sandbox/modules/import/lib/detect/find_program.lua:243]: in function '_find'
    [.../core/sandbox/modules/import/lib/detect/find_program.lua:329]:
    [@programdir/modules/lib/detect/find_tool.lua:31]: in function '_find_from_modules'
    [@programdir/modules/lib/detect/find_tool.lua:42]: in function '_find_tool'
    [@programdir/modules/lib/detect/find_tool.lua:88]:
    [@programdir/modules/net/ping.lua:60]:
    [@programdir/modules/net/fasturl.lua:48]: in function 'sort'
    [...modules/private/action/require/impl/install_packages.lua:47]: in function '_sort_packages_urls'
    [...modules/private/action/require/impl/install_packages.lua:797]: in function '_install_packages'
    [...modules/private/action/require/impl/install_packages.lua:824]:
    [@programdir/modules/private/action/require/install.lua:85]:
    [@programdir/actions/config/main.lua:391]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:241]:
    [@programdir/core/base/task.lua:491]: in function 'run'
    [@programdir/core/sandbox/modules/import/core/base/task.lua:63]: in function 'run'
    [@programdir/actions/build/main.lua:191]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:241]:
    [@programdir/core/base/task.lua:491]: in function 'run'
    [@programdir/core/main.lua:327]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

checking for ping ... no
/usr/bin/tar -xf /workspaces/learn-asio/.deps/.xmake/cache/packages/2409/b/bzip2/1.0.8/bzip2-1.0.8.tar.gz -C source.tmp
/root/.local/bin/xmake f --diagnosis --verbose -y -c --plat=linux --arch=x86_64 --mode=release --kind=static --cxflags=-fPIC --buildir=build_8db6bd46 --enable_tools=true
xmake v2.9.5+20240925, A cross-platform build utility based on Lua
Copyright (C) 2015-present Ruki Wang, tboox.org, xmake.io
                         _
    __  ___ __  __  __ _| | ______
    \ \/ / |  \/  |/ _  | |/ / __ \
     >  <  | \__/ | /_| |   <  ___/
    /_/\_\_|_|  |_|\__ \|_|\_\____|
                         by ruki, xmake.io
    
    👉  Manual: https://xmake.io/#/getting_started
    🙏  Donate: https://xmake.io/#/sponsor
    

Usage: $xmake config|f [options] [target]

Configure the project.

Common options:
    -q, --quiet                            Quiet operation.
    -y, --yes                              Input yes by default if need user confirm.
        --confirm=CONFIRM                  Input the given result if need user confirm.
                                               - yes
                                               - no
                                               - def
    -v, --verbose                          Print lots of verbose information for users.
        --root                             Allow to run xmake as root.
    -D, --diagnosis                        Print lots of diagnosis information (backtrace, check info ..) only for developers.
                                           And we can append -v to get more whole information.
                                               e.g. $ xmake -vD
    -h, --help                             Print this help message and exit.

    -F FILE, --file=FILE                   Read a given xmake.lua file.
    -P PROJECT, --project=PROJECT          Change to the given project directory.
                                           Search priority:
                                               1. The Given Command Argument
                                               2. The Envirnoment Variable: XMAKE_PROJECT_DIR
                                               3. The Current Directory

Command options (config):
    -c, --clean                            Clean the cached user configs and detection cache.
        --check                            Just ignore detection cache and force to check all, it will reserve the cached user configs.
        --export=EXPORT                    Export the current configuration to the given file.
                                               e.g.
                                               - xmake f -m debug -xxx=y --export=build/config.txt
        --import=IMPORT                    Import configs from the given file.
                                               e.g.
                                               - xmake f -import=build/config.txt
        --menu                             Configure project with a menu-driven user interface.

    -p PLAT, --plat=PLAT                   Compile for the given platform. (default: auto)
                                               - applexros
                                               - linux
                                               - android
                                               - wasm
                                               - haiku
                                               - iphoneos
                                               - cross
                                               - msys
                                               - bsd
                                               - appletvos
                                               - watchos
                                               - harmony
                                               - macosx
                                               - cygwin
                                               - mingw
                                               - windows
    -a ARCH, --arch=ARCH                   Compile for the given architecture. (default: auto)
                                               - applexros: arm64 armv7 armv7s i386 x86_64
                                               - linux: i386 x86_64 armv7 armv7s arm64-v8a mips mips64 mipsel mips64el loong64
                                               - android: armeabi armeabi-v7a arm64-v8a x86 x86_64 mips mip64
                                               - wasm: wasm32 wasm64
                                               - haiku: i386 x86_64
                                               - iphoneos: arm64 x86_64
                                               - cross: i386 x86_64 arm arm64 mips mips64 riscv riscv64 loong64 s390x ppc ppc64 sh4
                                               - msys: i386 x86_64
                                               - bsd: i386 x86_64
                                               - appletvos: arm64 armv7 armv7s i386 x86_64
                                               - watchos: armv7k i386
                                               - harmony: armeabi-v7a arm64-v8a x86 x86_64
                                               - macosx: x86_64 arm64
                                               - cygwin: i386 x86_64
                                               - mingw: i386 x86_64 arm arm64
                                               - windows: x86 x64 arm arm64 arm64ec
    -m MODE, --mode=MODE                   Compile for the given mode. (default: auto)
                                               - debug
                                               - release
    -k KIND, --kind=KIND                   Compile for the given target kind. (default: static)
                                               - static
                                               - shared
                                               - binary
        --host=HOST                        Set the current host environment. (default: linux)
        --policies=POLICIES                Set the project policies.
                                               e.g.
                                               - xmake f --policies=package.fetch_only
                                               - xmake f --policies=package.precompiled:n,package.install_only

Command options (Package Configuration):
        --require=REQUIRE                  Require all dependent packages?
                                               - yes
                                               - no
        --pkg_searchdirs=PKG_SEARCHDIRS    The search directories of the remote package.
                                               e.g.
                                               - xmake f --pkg_searchdirs=/dir1:/dir2

Command options (Cross Complation Configuration):
        --cross=CROSS                      Set cross toolchains prefix
                                           e.g.
                                               - i386-mingw32-
                                               - arm-linux-androideabi-
        --target_os=TARGET_OS              Set target os only for cross-complation
        --bin=BIN                          Set cross toolchains bin directory
                                           e.g.
                                               - sdk/bin (/arm-linux-gcc ..)
        --sdk=SDK                          Set cross SDK directory
                                           e.g.
                                               - sdk/bin
                                               - sdk/lib
                                               - sdk/include
        --toolchain=TOOLCHAIN              Set toolchain name
                                           e.g. 
                                               - xmake f --toolchain=clang
                                               - xmake f --toolchain=[cross|llvm|sdcc ..] --sdk=/xxx
                                               - run `xmake show -l toolchains` to get all toolchains
        --runtimes=RUNTIMES                Set the compiler runtime library.
                                           e.g. 
                                               - xmake f --runtimes=MTd
                                               - xmake f --runtimes=MT,c++_static
                                               - MT
                                               - MTd
                                               - MD
                                               - MDd
                                               - c++_static
                                               - c++_shared
                                               - stdc++_static
                                               - stdc++_shared
                                               - gnustl_static
                                               - gnustl_shared
                                               - stlport_static
                                               - stlport_shared
        --cu=CU                            The Cuda Compiler
        --cu-ccbin=CU-CCBIN                The Cuda Host C++ Compiler
        --culd=CULD                        The Cuda Linker
        --cuflags=CUFLAGS                  The Cuda Compiler Flags
        --culdflags=CULDFLAGS              The Cuda Linker Flags
        --links=LINKS                      The Link Libraries
        --syslinks=SYSLINKS                The System Link Libraries
        --linkdirs=LINKDIRS                The Link Search Directories
        --includedirs=INCLUDEDIRS          The Include Search Directories
        --cxx=CXX                          The C++ Compiler
        --cpp=CPP                          The C/C++ Preprocessor
        --ld=LD                            The Linker
        --ar=AR                            The Static Library Linker
        --sh=SH                            The Shared Library Linker
        --ranlib=RANLIB                    The Static Library Index Generator
        --cxflags=CXFLAGS                  The C/C++ compiler Flags
        --cxxflags=CXXFLAGS                The C++ Compiler Flags
        --ldflags=LDFLAGS                  The Binary Linker Flags
        --arflags=ARFLAGS                  The Static Library Linker Flags
        --shflags=SHFLAGS                  The Shared Library Linker Flags
        --frameworks=FRAMEWORKS            The Frameworks
        --frameworkdirs=FRAMEWORKDIRS      The Frameworks Search Directories
        --nc=NC                            The Nim Compiler
        --ncld=NCLD                        The Nim Linker
        --ncar=NCAR                        The Nim Static Library Archiver
        --ncsh=NCSH                        The Nim Shared Library Linker
        --rc=RC                            The Rust Compiler
        --rcld=RCLD                        The Rust Linker
        --rcar=RCAR                        The Rust Static Library Archiver
        --rcsh=RCSH                        The Rust Shared Library Linker
        --cc=CC                            The C Compiler
        --cflags=CFLAGS                    The C Compiler Flags
        --mm=MM                            The Objc Compiler
        --mxx=MXX                          The Objc++ Compiler
        --mflags=MFLAGS                    The Objc Compiler Flags
        --mxflags=MXFLAGS                  The Objc/c++ Compiler Flags
        --mxxflags=MXXFLAGS                The Objc++ Compiler Flags
        --mrc=MRC                          The Microsoft Resource Compiler
        --mrcflags=MRCFLAGS                The Microsoft Resource Flags
        --pc=PC                            The Pascal Compiler
        --pcld=PCLD                        The Pascal Linker
        --pcsh=PCSH                        The Pascal Shared Library Linker
        --as=AS                            The Assembler
        --asflags=ASFLAGS                  The Assembler Flags
        --zc=ZC                            The Zig Compiler
        --zcld=ZCLD                        The Zig Linker
        --zcar=ZCAR                        The Zig Static Library Archiver
        --zcsh=ZCSH                        The Zig Shared Library Linker
        --fc=FC                            The Fortran Compiler
        --fcld=FCLD                        The Fortran Linker
        --fcsh=FCSH                        The Fortran Shared Library Linker
        --sc=SC                            The Swift Compiler
        --scld=SCLD                        The Swift Linker
        --scsh=SCSH                        The Swift Shared Library Linker
        --dc=DC                            The Dlang Compiler
        --dcld=DCLD                        The Dlang Linker
        --dcar=DCAR                        The Dlang Static Library Archiver
        --dcsh=DCSH                        The Dlang Shared Library Linker
        --go=GO                            The Golang Compiler
        --gcld=GCLD                        The Golang Linker
        --go-ar=GO-AR                      The Golang Static Library Linker

Command options (Cuda SDK Configuration):
        --cuda=CUDA                        The Cuda SDK Directory (default: auto)

Command options (Qt SDK Configuration):
        --qt=QT                            The Qt SDK Directory (default: auto)
        --qt_sdkver=QT_SDKVER              The Qt SDK Version (default: auto)

Command options (Vcpkg Configuration):
        --vcpkg=VCPKG                      The Vcpkg Directory (default: auto)

Command options (Android Configuration):
        --ndk=NDK                          The NDK Directory
        --ndk_sdkver=NDK_SDKVER            The SDK Version for NDK (default: auto)
        --android_sdk=ANDROID_SDK          The Android SDK Directory
        --build_toolver=BUILD_TOOLVER      The Build Tool Version of Android SDK
        --ndk_stdcxx=[y|n]                 Use stdc++ library for NDK (default: y)
        --ndk_cxxstl=NDK_CXXSTL            The stdc++ stl library for NDK, (deprecated, please use --runtimes)
                                               - c++_static
                                               - c++_shared
                                               - gnustl_static
                                               - gnustl_shared
                                               - stlport_shared
                                               - stlport_static

Command options (Emscripten Configuration):
        --emsdk=EMSDK                      The emsdk directory

Command options (MingW Configuration):
        --mingw=MINGW                      The MingW SDK Directory

Command options (Other Configuration):
        --debugger=DEBUGGER                Set debugger (default: auto)
        --ccache=[y|n]                     Enable or disable the c/c++ compiler cache. (default: y)
        --ccachedir=CCACHEDIR              Set the ccache directory.
        --trybuild=TRYBUILD                Enable try-build mode and set the third-party buildsystem tool.
                                           e.g.
                                               - xmake f --trybuild=auto; xmake
                                               - xmake f --trybuild=autoconf -p android --ndk=xxx; xmake
                                           
                                           the third-party buildsystems:
                                               - auto
                                               - make
                                               - autoconf
                                               - cmake
                                               - scons
                                               - meson
                                               - bazel
                                               - ninja
                                               - msbuild
                                               - xcodebuild
                                               - ndkbuild
                                               - xrepo
        --tryconfigs=TRYCONFIGS            Set the extra configurations of the third-party buildsystem for the try-build mode.
                                           e.g.
                                               - xmake f --trybuild=autoconf --tryconfigs='--enable-shared=no'
    -o BUILDIR, --buildir=BUILDIR          Set build directory. (default: build)

error: Invalid option: --enable_tools=true
error: @programdir/core/sandbox/modules/os.lua:378: execv(/root/.local/bin/xmake f --diagnosis --verbose -y -c --plat=linux --arch=x86_64 --mode=release --kind=static --cxflags=-fPIC --buildir=build_8db6bd46 --enable_tools=true) failed(255)
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1004]:
    [@programdir/core/sandbox/modules/os.lua:378]:
    [@programdir/core/sandbox/modules/os.lua:291]: in function 'vrunv'
    [@programdir/modules/package/tools/xmake.lua:511]: in function 'install'
    [...xmake/repositories/xmake-repo/packages/b/bzip2/xmake.lua:24]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:392]:

  => install bzip2 1.0.8 .. failed
error: @programdir/core/main.lua:329: @programdir/core/sandbox/modules/import/core/base/task.lua:65: @programdir/modules/async/runjobs.lua:325: .../modules/private/action/require/impl/actions/install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1004]:
    [.../modules/private/action/require/impl/actions/install.lua:494]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:361]:
    [...modules/private/action/require/impl/install_packages.lua:496]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:1004: in function 'os.raiselevel'
        (...tail calls...)
        @programdir/core/main.lua:329: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
@firesxp firesxp added the bug label Sep 27, 2024
@waruqi waruqi transferred this issue from xmake-io/xmake Sep 27, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: Cannot compile using bzip2

@xmake-io xmake-io deleted a comment from Issues-translate-bot Sep 27, 2024
@star-hengxing
Copy link
Contributor

star-hengxing commented Sep 27, 2024

本地 Ubuntu 无法复现,可能是包仓库文件有缺失。用 xmake show 找到 packagedir 目录删了,然后再试一次

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It cannot be reproduced on local Ubuntu. It may be that the package warehouse file is missing. Use xmake show to delete all packagedir and try again

@firesxp
Copy link
Author

firesxp commented Sep 27, 2024

[Docker] ❯ xmake show
The information of xmake:
version: 2.9.5+20240925
host: linux/x86_64
programdir: /root/.local/share/xmake
programfile: /root/.local/bin/xmake
globaldir: .deps/.xmake
tmpdir: /tmp/.xmake0/240927
workingdir: /workspaces/learn
packagedir: .deps/.xmake/packages
packagedir(cache): .deps/.xmake/cache/packages/2409

The information of project: learn
plat: linux
arch: x86_64
mode: debug
buildir: build
configdir: /workspaces/learn/.xmake/linux/x86_64
projectdir: /workspaces/learn
projectfile: /workspaces/learn/xmake.lua

/workspaces/learn via 🌙
[Docker] ❯ rm -rf .deps/.xmake/cache/packages/2409

⬢ [Docker] ❯ xmake -vD
@star-hengxing 还是报上面一样的错误

error: Invalid option: --enable_tools=true
error: @programdir/core/sandbox/modules/os.lua:378: execv(/root/.local/bin/xmake f --diagnosis --verbose -y -c --plat=linux --arch=x86_64 --mode=release --kind=static --cxflags=-fPIC --buildir=build_8db6bd46 --enable_tools=true) failed(255)
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:1004]:
[@programdir/core/sandbox/modules/os.lua:378]:
[@programdir/core/sandbox/modules/os.lua:291]: in function 'vrunv'
[@programdir/modules/package/tools/xmake.lua:511]: in function 'install'
[...xmake/repositories/xmake-repo/packages/b/bzip2/xmake.lua:24]: in function 'script'
[...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
[.../modules/private/action/require/impl/actions/install.lua:392]:

=> install bzip2 1.0.8 .. failed
error: @programdir/core/main.lua:329: @programdir/core/sandbox/modules/import/core/base/task.lua:65: @programdir/modules/async/runjobs.lua:325: .../modules/private/action/require/impl/actions/install.lua:494: install failed!
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:1004]:
[.../modules/private/action/require/impl/actions/install.lua:494]: in function 'catch'
[@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
[.../modules/private/action/require/impl/actions/install.lua:361]:
[...modules/private/action/require/impl/install_packages.lua:496]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:241]:

stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:1004: in function 'base/os.raiselevel'
(...tail calls...)
@programdir/core/main.lua:329: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>

@firesxp
Copy link
Author

firesxp commented Sep 27, 2024

这个好像和重新指定XMAKE_GLOBALDIR位置有关(通过环境变量将XMAKE_GLOBALDIR设置为当前目录.deps)。还原XMAKE_GLOBALDIR,这个“error: Invalid option: --enable_tools=true”错误消失了

@waruqi
Copy link
Member

waruqi commented Sep 27, 2024

XMAKE_GLOBALDIR设置为当前目录.deps)

不要指向当前目录。.deps/.xmake/cache/packages/2409 里面的 xmake.lua port 构建,可能会被根目录 xmake.lua 干扰

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


XMAKE_GLOBALDIR is set to the current directory.deps)

Do not point to the current directory. The xmake.lua port build in .deps/.xmake/cache/packages/2409 may be interfered by the root directory xmake.lua

@firesxp
Copy link
Author

firesxp commented Sep 27, 2024

之前是指向当前目录的子目录(XMAKE_GLOBALDIR=.deps),如果这也不行的话,XMAKE_GLOBALDIR岂不是没有存在的意义 @waruqi

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It used to point to a subdirectory of the current directory (XMAKE_GLOBALDIR=.deps). If this doesn't work, wouldn't XMAKE_GLOBALDIR have no meaning? @waruqi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants