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

can't run in fakeroot #140

Closed
71e6fd52 opened this Issue Aug 20, 2017 · 13 comments

Comments

Projects
None yet
2 participants
@71e6fd52
Contributor

71e6fd52 commented Aug 20, 2017

在 makepkg 的 package 阶段出错

==> 正在进入 fakeroot 环境...                
==> 正在开始 package()...                    
[00%]: ccache compiling.release src/exist.cpp
error: /usr/share/xmake/core/base/os.lua:640: /usr/share/xmake/core/base/os.lua:640: /usr/share/xmake/core/base/os.lua:640: /usr/share/xmake/core/base/os.lua:640:                   
stack traceback:                             
    [C]: in function 'error'                 
    [/usr/share/xmake/core/base/os.lua:640]: in function 'raise'                          
    [/usr/share/xmake/modules/core/tools/gcc.lua:440]: in function 'catch'                
    [/usr/share/xmake/core/sandbox/modules/try.lua:104]: in function 'try'                
    [/usr/share/xmake/modules/core/tools/gcc.lua:411]: in function '_compile1'            
    [/usr/share/xmake/modules/core/tools/gcc.lua:478]:                                    
    [C]: in function 'compile'               
    [/usr/share/xmake/actions/build/kinds/object.lua:187]: in function '_build_object'    
    [/usr/share/xmake/actions/build/kinds/object.lua:213]:                                

stack traceback:                             
        [C]: in function 'error'             
        /usr/share/xmake/core/base/os.lua:640: in function 'raise'                        
        /usr/share/xmake/core/sandbox/modules/utils.lua:128: in function 'assert'         
        /usr/share/xmake/actions/build/kinds/object.lua:187: in function '_build_object'  
        /usr/share/xmake/actions/build/kinds/object.lua:213: in function </usr/share/xmake/actions/build/kinds/object.lua:207>                                                       
stack traceback:                             
    [C]: in function 'error'                 
    [/usr/share/xmake/core/base/os.lua:640]: in function 'raise'                          
    [/usr/share/xmake/actions/build/main.lua:58]: in function 'catch'                     
    [/usr/share/xmake/core/sandbox/modules/try.lua:104]: in function 'try'                
    [/usr/share/xmake/actions/build/main.lua:47]:                                         
    [C]: in function 'load'                  
    [/usr/share/xmake/core/base/task.lua:434]: in function 'run'                          
    [...are/xmake/core/sandbox/modules/import/core/base/task.lua:59]: in function 'run'   
    [/usr/share/xmake/actions/install/main.lua:40]:                                       
    [C]: in function 'load'                  
    [/usr/share/xmake/core/base/task.lua:434]: in function 'run'                          
    [/usr/share/xmake/core/main.lua:236]:    

stack traceback:                             
    [C]: in function 'error'                 
    [/usr/share/xmake/core/base/os.lua:640]: in function 'raise'                          
    [...are/xmake/core/sandbox/modules/import/core/base/task.lua:61]: in function 'run'   
    [/usr/share/xmake/actions/install/main.lua:40]:                                       
    [C]: in function 'load'                  
    [/usr/share/xmake/core/base/task.lua:434]: in function 'run'                          
    [/usr/share/xmake/core/main.lua:236]:    

==> 错误: 在 package() 中发生一个错误。     
    正在放弃...

详细:http://fars.ee/t/lXRZ

@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 20, 2017

Member

这边用 http://fars.ee/t/lXRZ 里面的 demo,我这原样模拟测试了下,archlinux上makepkg能够正常通过,请尝试更新到2.1.6最新版本试下

==> Making package: a r74-1 (Sun Aug 20 12:14:27 UTC 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found a.tar
==> Validating source files with sha256sums...
    a.tar ... Skipped
==> Extracting sources...
  -> Extracting a.tar with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
installing to /tmp/test/pkg/a/usr ...
install ok!
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "a"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: a r74-1 (Sun Aug 20 12:14:28 UTC 2017)
Member

waruqi commented Aug 20, 2017

这边用 http://fars.ee/t/lXRZ 里面的 demo,我这原样模拟测试了下,archlinux上makepkg能够正常通过,请尝试更新到2.1.6最新版本试下

==> Making package: a r74-1 (Sun Aug 20 12:14:27 UTC 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found a.tar
==> Validating source files with sha256sums...
    a.tar ... Skipped
==> Extracting sources...
  -> Extracting a.tar with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
installing to /tmp/test/pkg/a/usr ...
install ok!
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "a"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: a r74-1 (Sun Aug 20 12:14:28 UTC 2017)
@71e6fd52

This comment has been minimized.

Show comment
Hide comment
@71e6fd52

71e6fd52 Aug 20, 2017

Contributor

xmake --version : xmake v2.1.6.201708201841
pacaur -Qi xmake-git : 2.1.6.r12-1

Contributor

71e6fd52 commented Aug 20, 2017

xmake --version : xmake v2.1.6.201708201841
pacaur -Qi xmake-git : 2.1.6.r12-1

@71e6fd52

This comment has been minimized.

Show comment
Hide comment
@71e6fd52

71e6fd52 Aug 20, 2017

Contributor

makepkg.conf 为默认


如果把 --backtrace 去掉:

==> 正在开始 package()...
checking for the architecture ... x86_64
error: 
==> 错误: 在 package() 中发生一个错误。
Contributor

71e6fd52 commented Aug 20, 2017

makepkg.conf 为默认


如果把 --backtrace 去掉:

==> 正在开始 package()...
checking for the architecture ... x86_64
error: 
==> 错误: 在 package() 中发生一个错误。
@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 20, 2017

Member

看提示应该是编译错误,但是没有正常显示错误信息,可以加上-v编译后,直接copy编译命令行 运行下,看看有没有显示编译错误。。

==> 正在开始 package()...
[00%]: ccache compiling.release src/exist.cpp

你可以手动执行下xmake -r -v --backtrace,看看是否编译通过,如果不通过,可以贴下错误信息

详细:http://fars.ee/t/lXRZ

这个我这边测试ok,你可以xmake install的时候,加上 -v,把完整错误信息帖我下,视频里面我看不到开头的完整错误栈。。

Member

waruqi commented Aug 20, 2017

看提示应该是编译错误,但是没有正常显示错误信息,可以加上-v编译后,直接copy编译命令行 运行下,看看有没有显示编译错误。。

==> 正在开始 package()...
[00%]: ccache compiling.release src/exist.cpp

你可以手动执行下xmake -r -v --backtrace,看看是否编译通过,如果不通过,可以贴下错误信息

详细:http://fars.ee/t/lXRZ

这个我这边测试ok,你可以xmake install的时候,加上 -v,把完整错误信息帖我下,视频里面我看不到开头的完整错误栈。。

@71e6fd52

This comment has been minimized.

Show comment
Hide comment
@71e6fd52

71e6fd52 Aug 20, 2017

Contributor

我因为其他原因重启了系统,就通过了。
有什么可能的原因吗?

Contributor

71e6fd52 commented Aug 20, 2017

我因为其他原因重启了系统,就通过了。
有什么可能的原因吗?

@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 20, 2017

Member

暂时不太清楚原因。。

Member

waruqi commented Aug 20, 2017

暂时不太清楚原因。。

@71e6fd52 71e6fd52 closed this Aug 20, 2017

@71e6fd52 71e6fd52 reopened this Aug 24, 2017

@71e6fd52

This comment has been minimized.

Show comment
Hide comment
@71e6fd52

71e6fd52 Aug 24, 2017

Contributor

我不想重启。。。


我之前的范例视频不太准确,
build (在 build())完了,install (在 package())的时候 重新编译 ,出错
http://fars.ee/GZv5

Contributor

71e6fd52 commented Aug 24, 2017

我不想重启。。。


我之前的范例视频不太准确,
build (在 build())完了,install (在 package())的时候 重新编译 ,出错
http://fars.ee/GZv5

@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 24, 2017

Member

能否给个能重现的 demo 例子吗?我这边试下。另外 xmake install -v里面能否再加个 --backtrace我看下详细栈信息。。

Member

waruqi commented Aug 24, 2017

能否给个能重现的 demo 例子吗?我这边试下。另外 xmake install -v里面能否再加个 --backtrace我看下详细栈信息。。

@71e6fd52

This comment has been minimized.

Show comment
Hide comment
@71e6fd52

71e6fd52 Aug 25, 2017

Contributor

demo 不一定能重现吧


http://fars.ee/KuTr

Contributor

71e6fd52 commented Aug 25, 2017

demo 不一定能重现吧


http://fars.ee/KuTr

@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 25, 2017

Member

看着像是在fakeroot里面,编译任何代码都失败了,可能是编译的时候 写文件失败了,文件和目录权限导致问题的可能性比较高。。具体我还得在分析下。。

Member

waruqi commented Aug 25, 2017

看着像是在fakeroot里面,编译任何代码都失败了,可能是编译的时候 写文件失败了,文件和目录权限导致问题的可能性比较高。。具体我还得在分析下。。

@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 25, 2017

Member

我大概知道原因了,xmake会在/tmp/下创建一个临时目录用于维护一些编译过程中的临时文件,root用户临时目录为/tmp/.xmake0, 其他用户临时目录为:/tmp/.xmake[uid],例如:/tmp/.xmake5,这样每个用户操作的临时目录都是独立的,互不冲突。

但是你这在正常编译的时候,默认就是root用户操作,/tmp/.xmake0已经被创建,但是在fakeroot里面,用的也是/tmp/.xmake0,但跟系统root用户还是有区别的,因此导致在fakeroot里面写入文件到/tmp/.xmake0失败,编译也就失败了,系统重启后文件清空,所以打包ok

我后两天会想办法解决这个问题,请稍等。

Member

waruqi commented Aug 25, 2017

我大概知道原因了,xmake会在/tmp/下创建一个临时目录用于维护一些编译过程中的临时文件,root用户临时目录为/tmp/.xmake0, 其他用户临时目录为:/tmp/.xmake[uid],例如:/tmp/.xmake5,这样每个用户操作的临时目录都是独立的,互不冲突。

但是你这在正常编译的时候,默认就是root用户操作,/tmp/.xmake0已经被创建,但是在fakeroot里面,用的也是/tmp/.xmake0,但跟系统root用户还是有区别的,因此导致在fakeroot里面写入文件到/tmp/.xmake0失败,编译也就失败了,系统重启后文件清空,所以打包ok

我后两天会想办法解决这个问题,请稍等。

@waruqi

This comment has been minimized.

Show comment
Hide comment
@waruqi

waruqi Aug 25, 2017

Member

我改进了下,加上了对 fakeroot的检测,你更新下试试?

Member

waruqi commented Aug 25, 2017

我改进了下,加上了对 fakeroot的检测,你更新下试试?

@71e6fd52

This comment has been minimized.

Show comment
Hide comment
@71e6fd52

71e6fd52 Aug 25, 2017

Contributor

行了

Contributor

71e6fd52 commented Aug 25, 2017

行了

@71e6fd52 71e6fd52 closed this Aug 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment