JuliaPackaging / BinaryBuilder.jl

Binary Dependency Builder for Julia
https://binarybuilder.org
Other
392 stars 101 forks source link

qemu linking #352

Closed rofinn closed 6 years ago

rofinn commented 6 years ago

There appears to be an issue with the qemu linking.

[ Info: Building for i686-linux-gnu, x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabihf, powerpc64le-linux-gnu, i686-linux-musl, x86_64-linux-musl, aarch64-linux-musl, arm-linux-musleabihf, x86_64-apple-darwin14, x86_64-unknown-freebsd11.1, i686-w64-mingw32, x86_64-w64-mingw32
dyld: Library not loaded: @rpath/../lib/libintl.9.dylib
  Referenced from: /Users/rory/.julia/dev/BinaryBuilder/deps/qemu/bin/qemu-system-x86_64
  Reason: image not found
┌ Warning: QEMU failed to run
└ @ BinaryBuilder ~/.julia/dev/BinaryBuilder/src/QemuRunner.jl:238
dyld: Library not loaded: @rpath/../lib/libintl.9.dylib
  Referenced from: /Users/rory/.julia/dev/BinaryBuilder/deps/qemu/bin/qemu-system-x86_64
  Reason: image not found
┌ Warning: QEMU failed to run
└ @ BinaryBuilder ~/.julia/dev/BinaryBuilder/src/QemuRunner.jl:238
ERROR: LoadError: Build for MbedTLS on i686-linux-gnu did not complete successfully

Stacktrace:
 [1] error(::String[ Info: Unable to establish communication with QEMU, does /tmp/tmp5zvYxu/qemu_comm.socket exist?
) at ./error.jl:33
 [2] macro expansion at ./logging.jl:318 [inlined]
 [3] #build#160(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Array{String,1}, ::Bool, ::Function, ::BinaryBuilder.QemuRunner, ::String, ::Array{LibraryProduct,1}, ::String, ::Linux, ::Prefix) at /Users/rory/.julia/dev/BinaryBuilder/src/AutoBuild.jl:478
 [4] (::getfield(BinaryBuilder, Symbol("#kw##build")))(::NamedTuple{(:verbose, :ignore_manifests, :debug),Tuple{Bool,Array{String,1},Bool}}, ::typeof(build), ::BinaryBuilder.QemuRunner, ::String, ::Array{LibraryProduct,1}, ::String, ::Linux, ::Prefix) at ./none:0
 [5] (::getfield(BinaryBuilder, Symbol("##149#155")){Bool,Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:debug,),Tuple{Bool}}},String,String,VersionNumber,String,Array{Platform,1},typeof(products),Array{Any,1}})(::String) at /Users/rory/.julia/dev/BinaryBuilder/src/AutoBuild.jl:391
 [6] mktempdir(::getfield(BinaryBuilder, Symbol("##149#155")){Bool,Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:debug,),Tuple{Bool}}},String,String,VersionNumber,String,Array{Platform,1},typeof(products),Array{Any,1}}, ::String) at ./file.jl:597
 [7] mktempdir at ./file.jl:595 [inlined]
 [8] macro expansion at ./task.jl:266 [inlined]
 [9] #autobuild#147(::Bool, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:debug,),Tuple{Bool}}}, ::Function, ::String, ::String, ::VersionNumber, ::Array{Pair{String,String},1}, ::String, ::Array{Platform,1}, ::typeof(products), ::Array{Any,1}) at /Users/rory/.julia/dev/BinaryBuilder/src/AutoBuild.jl:265
 [10] (::getfield(BinaryBuilder, Symbol("#kw##autobuild")))(::NamedTuple{(:verbose, :debug),Tuple{Bool,Bool}}, ::typeof(autobuild), ::String, ::String, ::VersionNumber, ::Array{Pair{String,String},1}, ::String, ::Array{Platform,1}, ::typeof(products), ::Array{Any,1}) at ./none:0
 [11] macro expansion at ./logging.jl:307 [inlined]
 [12] #build_tarballs#136(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{String,1}, ::String, ::VersionNumber, ::Array{Pair{String,String},1}, ::String, ::Array{Platform,1}, ::typeof(products), ::Array{Any,1}) at /Users/rory/.julia/dev/BinaryBuilder/src/AutoBuild.jl:114
 [13] build_tarballs(::Array{String,1}, ::String, ::VersionNumber, ::Array{Pair{String,String},1}, ::String, ::Array{Platform,1}, ::Function, ::Array{Any,1}) at /Users/rory/.julia/dev/BinaryBuilder/src/AutoBuild.jl:21
 [14] top-level scope at none:0
 [15] include at ./boot.jl:317 [inlined]
 [16] include_relative(::Module, ::String) at ./loading.jl:1038
 [17] include(::Module, ::String) at ./sysimg.jl:29
 [18] exec_options(::Base.JLOptions) at ./client.jl:239
 [19] _start() at ./client.jl:432
in expression starting at /Users/rory/repos/MbedTLSBuilder/build_tarballs.jl:42

The rpath for Users/rory/.julia/dev/BinaryBuilder/deps/qemu/bin/qemu-system-x86_64 appears to be using a relative ../lib:

julia> using BinaryBuilder

julia> BinaryBuilder.rpaths("/Users/rory/.julia/dev/BinaryBuilder/deps/qemu/bin/qemu-system-x86_64")
1-element Array{String,1}:
 "../lib"
rofinn commented 6 years ago

NOTE: I also tried using BinaryBuilder in a linux VM and ran into #351

bjarthur commented 6 years ago

i'm having a similar problem. did you find a solution?

bjarthur commented 6 years ago

steps to reproduce:

  1. start julia 0.7 on OS X

  2. ]dev BinaryBuilder

  3. using BinaryBuilder

  4. BinaryBuilder.run_wizard()

  5. Start from scratch

  6. All supported architectures

  7. Please enter a URL (git repository or compressed archive) containing the source code to build:

    http://ftp.acc.umu.se/pub/gnome/sources/glib/2.58/glib-2.58.1.tar.xz

  8. Would you like to download additional sources? [y/N]: N

  9. Do you require any (binary) dependencies? [y/N]: N

output:

You will now be dropped into the cross-compilation environment.
Please compile the library. Your initial compilation target is Linux(:x86_64, libc=:glibc).
The $prefix environment variable contains the target directory.
Once you are done, exit by typing `exit` or `^D`

You have the following contents in your working directory:
  - glib-2.58.1
Hints:
  - glib-2.58.1/configure.ac

    This file is likely input to GNU Autoconf. 
     The recommended options for GNU Autoconf are `./configure --prefix=$prefix --host=$target`
    followed by `make` and `make install`. Since the prefix environment
    variable is set already, this will automatically perform the installation
    into the correct directory.

Setting parent shell interrupt to ^] (use ^C as usual, ^] to interrupt Julia)
dyld: Library not loaded: @rpath/../lib/libgthread-2.0.0.dylib
  Referenced from: /Users/arthurb/.julia/dev/BinaryBuilder/deps/qemu/bin/qemu-system-x86_64
  Reason: image not found
failed process: Process(`/Users/arthurb/.julia/dev/BinaryBuilder/deps/qemu/bin/qemu-system-x86_64 -kernel /Users/arthurb/.julia/dev/BinaryBuilder/deps/qemu/bzImage -m 12288M -cpu host -smp 2 -M accel=hvf -nographic -nodefaults -rtc base=utc,driftfix=slew -device virtio-serial -chardev stdio,id=charconsole0 -device virtconsole,chardev=charconsole0,id=console0 -device virtserialport,chardev=charcomm0,id=comm0 -device virtio-net-pci,netdev=networking -netdev user,id=networking -drive if=virtio,file=/Users/arthurb/.julia/dev/BinaryBuilder/deps/downloads/Rootfs.v2018.9.18.x86_64-linux-gnu.squashfs,format=raw -fsdev local,security_model=none,id=fsdev0,path=/var/folders/x6/gf97mhtj7kd967vg252ygy4nmsxs4y/T/juliahPzSsX/607Q3rAy -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=workspace0 -fsdev local,security_model=none,id=fsdev1,path=/var/folders/x6/gf97mhtj7kd967vg252ygy4nmsxs4y/T/juliahPzSsX/607Q3rAy/metadir -device virtio-9p-pci,id=fs1,fsdev=fsdev1,mount_tag=workspace1 -drive if=virtio,file=/Users/arthurb/.julia/dev/BinaryBuilder/deps/downloads/BaseCompilerShard-x86_64-linux-gnu.v2018.9.18.x86_64-linux-gnu.squashfs,format=raw -drive if=virtio,file=/Users/arthurb/.julia/dev/BinaryBuilder/deps/downloads/GCC-x86_64-linux-gnu.v4.8.5.x86_64-linux-gnu.squashfs,format=raw -drive if=virtio,file=/Users/arthurb/.julia/dev/BinaryBuilder/deps/downloads/LLVM.v6.0.1.x86_64-linux-gnu.squashfs,format=raw -device virtio-serial -chardev socket,path=/tmp/tmpSLZfwh/qemu_comm.socket,server,nowait,id=charcomm0 -append 'quiet console=hvc0 root=/dev/vda rootflags=ro rootfstype=squashfs noinitrd init=/sandbox'`, ProcessSignaled(6)) [0]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:712 [inlined]
 [3] #run#509(::Bool, ::Function, ::Base.CmdRedirect) at ./process.jl:670
 [4] run(::Base.CmdRedirect) at ./process.jl:668
 [5] (::getfield(BinaryBuilder, Symbol("##136#138")){Base.TTY,Base.TTY,BinaryBuilder.QemuRunner})(::Prefix) at /Users/arthurb/.julia/dev/BinaryBuilder/src/QemuRunner.jl:306
 [6] (::getfield(BinaryProvider, Symbol("##120#122")){getfield(BinaryBuilder, Symbol("##136#138")){Base.TTY,Base.TTY,BinaryBuilder.QemuRunner}})(::String) at /Users/arthurb/.julia/packages/BinaryProvider/zp4zb/src/Prefix.jl:60
 [7] mktempdir(::getfield(BinaryProvider, Symbol("##120#122")){getfield(BinaryBuilder, Symbol("##136#138")){Base.TTY,Base.TTY,BinaryBuilder.QemuRunner}}, ::String) at ./file.jl:597
 [8] temp_prefix at /Users/arthurb/.julia/packages/BinaryProvider/zp4zb/src/Prefix.jl:56 [inlined]
 [9] #run_interactive#135(::Base.TTY, ::Base.TTY, ::Base.TTY, ::Function, ::BinaryBuilder.QemuRunner, ::Cmd) at /Users/arthurb/.julia/dev/BinaryBuilder/src/QemuRunner.jl:282
 [10] #run_interactive at ./none:0 [inlined]
 [11] #runshell#140(::Base.Iterators.Pairs{Symbol,Base.TTY,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:stdin, :stdout, :stderr),Tuple{Base.TTY,Base.TTY,Base.TTY}}}, ::Function, ::BinaryBuilder.QemuRunner) at /Users/arthurb/.julia/dev/BinaryBuilder/src/QemuRunner.jl:326
 [12] (::getfield(BinaryBuilder, Symbol("#kw##runshell")))(::NamedTuple{(:stdin, :stdout, :stderr),Tuple{Base.TTY,Base.TTY,Base.TTY}}, ::typeof(BinaryBuilder.runshell), ::BinaryBuilder.QemuRunner) at ./none:0
 [13] #interactive_build#252(::typeof(string), ::Function, ::BinaryBuilder.WizardState, ::Prefix, ::BinaryBuilder.QemuRunner, ::String) at /Users/arthurb/.julia/dev/BinaryBuilder/src/wizard/interactive_build.jl:131
 [14] interactive_build at /Users/arthurb/.julia/dev/BinaryBuilder/src/wizard/interactive_build.jl:130 [inlined]
 [15] step3_interactive(::BinaryBuilder.WizardState, ::Prefix, ::Linux, ::BinaryBuilder.QemuRunner, ::String) at /Users/arthurb/.julia/dev/BinaryBuilder/src/wizard/interactive_build.jl:179
 [16] (::getfield(BinaryBuilder, Symbol("##259#260")){BinaryBuilder.WizardState,Linux,String})() at /Users/arthurb/.julia/dev/BinaryBuilder/src/wizard/interactive_build.jl:300
 [17] cd(::getfield(BinaryBuilder, Symbol("##259#260")){BinaryBuilder.WizardState,Linux,String}, ::String) at ./file.jl:96
 [18] step34(::BinaryBuilder.WizardState) at /Users/arthurb/.julia/dev/BinaryBuilder/src/wizard/interactive_build.jl:284
 [19] run_wizard(::Nothing) at /Users/arthurb/.julia/dev/BinaryBuilder/src/Wizard.jl:88
 [20] run_wizard() at /Users/arthurb/.julia/dev/BinaryBuilder/src/Wizard.jl:63
 [21] top-level scope at none:0
 [22] eval(::Module, ::Any) at ./boot.jl:319
 [23] eval_user_input(::Any, ::REPL.REPLBackend) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:85
 [24] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:117 [inlined]
 [25] (::getfield(REPL, Symbol("##28#29")){REPL.REPLBackend})() at ./task.jl:262

WizardState [step3]

julia> ┌ Warning: Unable to establish communication with QEMU on /tmp/tmpSLZfwh/qemu_comm.socket; quitting QEMU comms task
└ @ BinaryBuilder ~/.julia/dev/BinaryBuilder/src/QemuRunner.jl:189
julia> 
staticfloat commented 6 years ago

New QEMU builder release fixes this, which is included in the newest BinaryBuilder release currently making its way through METADATA. Thanks for the reports!

bjarthur commented 6 years ago

i still get the exact same error after pulling the latest BinaryBuilder#master. is there something else i need to do to get QemuBuilder?

staticfloat commented 6 years ago

It is possible that the downloaded version of qemu is not being invalidated properly. Try deleting the “qemu” folder inside of the “deps” folder inside of the binary builder package location.

On Thu, Oct 4, 2018 at 09:47 Ben Arthur notifications@github.com wrote:

i still get the exact same error after pulling the latest BinaryBuilder#master. is there something else i need to do to get QemuBuilder?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/352#issuecomment-426858624, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH_aGmXa-AKxkMkq-jGeDSosiSwgRwgks5uhWikgaJpZM4Wu4cP .

bjarthur commented 6 years ago

bingo. deleting BinaryBuilder/deps/qemu fixed it. does that mean there's a bug somewhere to be fixed? thanks.

staticfloat commented 6 years ago

Yes, luckily that bug is going to be quashed as part of a separate effort. :)