V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
amiwrong123
V2EX  ›  程序员

为什么 make 输出 make: Entering directory 时,后面跟的路径的两边的字符不一样,是反引号和单引号?

  •  
  •   amiwrong123 · Aug 24, 2024 · 1569 views
    This topic created in 615 days ago, the information mentioned may be changed or developed.

    我在使用 compiledb 执行 make 的时候,我在使用 compiledb 执行 make 的时候会有类似这种错误提示( https://github.com/nickdiego/compiledb/issues/96 , 这个网页里面也提到了):

    ## Processing build commands from <fdopen>
    Line 1: Failed to parse build command [Details: (<class 'bashlex.tokenizer.MatchedPairError'>) unexpected EOF while looking for matching '`' (position 78)]. Ignoring: 'make: Entering directory `/c/sw_package/sources/iot/hello/src''
    New command: C:\tools\MinGW\bin\gcc.exe -IC:\tools\MinGW\i686-w64-mingw32\include hello.c -v --debug -o hello.exe
    Line 3: Failed to parse build command [Details: (<class 'bashlex.tokenizer.MatchedPairError'>) unexpected EOF while looking for matching '`' (position 77)]. Ignoring: 'make: Leaving directory `/c/sw_package/sources/iot/hello/src''
    ## Loaded compilation database with 0 entries from compile_commands.json
    ## Writing compilation database with 0 entries to compile_commands.json
    ## Done.
    

    很明显,compiledb 因为这个路径两边的字符不一样而报错了。进而导致生成的compile_commands.json是一个空文件。

    我又单独执行了 make ,发现确实是这样的,就是 make 时,出现 make: Entering directory 时,那个路径的两边字符就是不一样的,分别是反引号和单引号。

    make: Entering directory `/c/sw_package/sources/iot/hello/src'
    
    • 请问各位大佬,这是 make 的问题吗?
    • 还是说,make 的输出就是对的没有问题,但是我得自己 特殊处理一下 make 的输出,再给到 compiledb ?
    4 replies    2024-08-25 10:45:19 +08:00
    julyclyde
        1
    julyclyde  
       Aug 24, 2024
    Make 的输出大体上是给人类看的东西
    用文本内容做跨系统集成通常就会遇到你今天这种问题

    看看有没有可以越过命令行直接调底层库的方法,把通信手段从文本解析改为 API 调用,试试?
    agagega
        2
    agagega  
       Aug 25, 2024 via iPhone   ❤️ 3
    vk42
        3
    vk42  
       Aug 25, 2024
    @agagega 这是英语国家普遍都有的习惯吧,LaTeX 里面一般也这样用
    amiwrong123
        4
    amiwrong123  
    OP
       Aug 25, 2024 via Android
    破案了,我自己 特殊处理了 make 的输出,替换反引号为单引号,再给到 compiledb 。生成的 compile_commands.json 还是一个空文件。

    看来和这个路径字符没有关系。

    但问题还是没解决。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2601 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 06:11 · PVG 14:11 · LAX 23:11 · JFK 02:11
    ♥ Do have faith in what you're doing.