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

xmake将xmake test程序的stdout输出存入/tmp导致/tmp目录被塞满 #5450

Closed
ZtRXR opened this issue Aug 9, 2024 · 13 comments
Closed
Labels
Milestone

Comments

@ZtRXR
Copy link

ZtRXR commented Aug 9, 2024

Xmake 版本

xmake v2.9.4+20240729

操作系统版本和架构

Linux archlinux 6.10.3-arch1-2 #1 SMP PREEMPT_DYNAMIC Tue, 06 Aug 2024 07:21:19 +0000 x86_64 GNU/Linux

描述问题

xmake test时程序输出stdout内容过多导致/tmp被塞满,导致其他程序无法使用/tmp
而且xmake报error中没有有关/tmp储存空间不足的报错信息,导致排错困难
谢谢你对C++开发构建工具的支持

期待的结果

我希望能把程序输出存入xmake.lua所在目录下
更好的报错信息支持
谢谢你对C++开发构建工具的支持

工程配置

target("stdout_test")
    set_kind("binary")
    add_files("./src/*.cpp")
    add_tests("1")

附加信息和错误日志

$ xmake b -vD
checking for the c++ compiler (cxx) ... gcc
[ 28%]: cache compiling.debug day5/RMQ/st_done.cpp
/usr/bin/gcc -c -m64 -g -O0 -DOIPRINT -o build/.objs/st_done/linux/x86_64/debug/day5/RMQ/st_done.cpp.o day5/RMQ/st_done.cpp
[ 32%]: cache compiling.debug day6/pre88/pre88.cpp
/usr/bin/gcc -c -m64 -g -O0 -DOIPRINT -o build/.objs/pre88/linux/x86_64/debug/day6/pre88/pre88.cpp.o day6/pre88/pre88.cpp
[ 35%]: cache compiling.debug day5/RMQ/st_raw.cpp
/usr/bin/gcc -c -m64 -g -O0 -DOIPRINT -o build/.objs/st_raw/linux/x86_64/debug/day5/RMQ/st_raw.cpp.o day5/RMQ/st_raw.cpp
[ 39%]: cache compiling.debug test.cpp
/usr/bin/gcc -c -m64 -g -O0 -DOIPRINT -o build/.objs/test/linux/x86_64/debug/test.cpp.o test.cpp
[ 42%]: cache compiling.debug day5/perfect/fix.cpp
/usr/bin/gcc -c -m64 -g -O0 -DOIPRINT -o build/.objs/fperfect/linux/x86_64/debug/day5/perfect/fix.cpp.o day5/perfect/fix.cpp
[ 46%]: cache compiling.debug day6/binaryExponentiation/binaryExponentiation.cpp
/usr/bin/gcc -c -m64 -g -O0 -DOIPRINT -o build/.objs/binExp/linux/x86_64/debug/day6/binaryExponentiation/binaryExponentiation.cpp.o day6/binaryExponentiation/binaryExponentiation.cpp
error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:325: @programdir/modules/private/action/build/object.lua:91: @programdir/modules/core/tools/gcc.lua:919: 
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [@programdir/modules/core/tools/gcc.lua:919]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [@programdir/modules/core/tools/gcc.lua:860]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/tool/compiler.lua:278]: in function 'compile'
    [@programdir/modules/private/action/build/object.lua:91]: in function 'script'
    [@programdir/modules/private/action/build/object.lua:122]: in function 'build_object'
    [@programdir/modules/private/action/build/object.lua:147]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: 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]:

stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:973: 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>

同时df -h信息

$ df -h
tmpfs           952M  952M     0 100% /tmp
@ZtRXR ZtRXR added the bug label Aug 9, 2024
@Issues-translate-bot
Copy link

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


Title: xmake will store the stdout output of the xmake test program into /tmp, causing the /tmp directory to be filled up

@ZtRXR ZtRXR changed the title xmake将xmake test程序将stdout输出存入/tmp导致/tmp目录被塞满 xmake将xmake test程序的stdout输出存入/tmp导致/tmp目录被塞满 Aug 9, 2024
@waruqi
Copy link
Member

waruqi commented Aug 9, 2024

按理,不管 test 是否执行成功,tmpfile 都会自动删了的,不会无限增长才对。。你可以调下这里。。

os.tryrm(outfile)

@Issues-translate-bot
Copy link

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


It stands to reason that regardless of whether test is executed successfully, tmpfile will be automatically deleted and will not grow indefinitely. . You can adjust it here. .

os.tryrm(outfile)

@ZtRXR
Copy link
Author

ZtRXR commented Aug 9, 2024

可能是因为程序死循环输出我手动CTRL+C了导致没有执行成功?
那该如何解决

@Issues-translate-bot
Copy link

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


Maybe it's because the program outputs in an infinite loop and I manually CTRL+C, causing the execution to fail?
How to solve it

@ZtRXR
Copy link
Author

ZtRXR commented Aug 9, 2024

写代码时我经常使用stdout输出,有时候逻辑有问题容易死循环输出,tmp就满了,麻烦作者修复下,这很重要

@Issues-translate-bot
Copy link

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


When writing code, I often use stdout output. Sometimes there is a problem with the logic and it is easy to output in an infinite loop. The tmp will be full. I would like the author to fix it. This is very important.

@ZtRXR
Copy link
Author

ZtRXR commented Aug 9, 2024

或者保证他不会占用过大空间,或者下次运行xmake任何命令时清空tmp占用,都可以

@Issues-translate-bot
Copy link

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


Or make sure it doesn't take up too much space, or clear the tmp space when you run any xmake command next time.

waruqi added a commit that referenced this issue Aug 15, 2024
@waruqi waruqi added this to the v2.9.5 milestone Aug 15, 2024
@waruqi
Copy link
Member

waruqi commented Aug 15, 2024

可以了,xmake update -s dev

@waruqi waruqi closed this as completed Aug 15, 2024
@Issues-translate-bot
Copy link

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


That’s it, xmake update -s dev

@ZtRXR
Copy link
Author

ZtRXR commented Aug 16, 2024

感谢您修复

@Issues-translate-bot
Copy link

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


Thanks for fixing

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

3 participants