Advertisement
Guest User

duckdb-builder.jl

a guest
Jun 5th, 2019
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 313.70 KB | None | 0 0
  1. julia> using Revise; include("./build_tarballs.jl")
  2. <-------------
  3. echo "WORKSPACE=$WORKSPACE"
  4. echo "target$target"
  5. echo "prefix=$prefix"
  6.  
  7. cd $WORKSPACE/srcdir
  8.  
  9. sed -i 's|add_subdirectory(tools)||' CMakeLists.txt
  10. sed -i 's|add_subdirectory(benchmark)||' CMakeLists.txt
  11. sed -i 's|add_subdirectory(test)||' CMakeLists.txt
  12. sed -i 's|add_subdirectory(sqlsmith)||' third_party/CMakeLists.txt
  13.  
  14. mkdir build
  15. cd build
  16. cmake -DCMAKE_BUILD_TYPE=Release ..
  17. if [ $target = "x86_64-apple-darwin14" ]; then
  18.   sed -i 's|-soname,libduckdb.so -o libduckdb.so|-install_name,libduckdb.dylib -o libduckdb.dylib|' ./src/CMakeFiles/duckdb.dir/link.txt
  19. fi
  20. make -j$(nproc)
  21. mkdir $prefix/lib
  22. cp -R src/libduckdb.* $prefix/lib/
  23. cp -R $WORKSPACE/srcdir/src/include $prefix/include
  24.  
  25. ------------->
  26. name = "duckdb"
  27. version = v"0.0.2"
  28. sources = ["/Users/dashti/Dropbox/workspaces/RelationalAI/duckdb-builder.jl/duckdb""/workspace/srcdir"
  29. [22:26:08] Parsed --workspace as "9p/workspace0" -> "/workspace"
  30. [22:26:08] Parsed --workspace as "9p/workspace1" -> "/meta"
  31. [22:26:08] Parsed --map as "/dev/vdb" -> "/opt/x86_64-apple-darwin14/BaseCompilerShard-2018.11.11"
  32. [22:26:08] Parsed --map as "/dev/vdc" -> "/opt/x86_64-apple-darwin14/GCC-4.8.5"
  33. [22:26:08] Parsed --map as "/dev/vdd" -> "/opt/x86_64-linux-gnu/LLVM-6.0.1-0"
  34. [22:26:08] Parsed --map as "/dev/vde" -> "/opt/x86_64-linux-gnu/BaseCompilerShard-2018.11.11"
  35. [22:26:08] Parsed --map as "/dev/vdf" -> "/opt/x86_64-linux-gnu/GCC-4.8.5"
  36. [22:26:08] Reading 81 environment mappings
  37. [22:26:08] --> Creating overlay workdir at /proc
  38. [22:26:08] --> Mounting overlay of / at /tmp (modifications in /proc/upper/rootfs, workspace in /proc/work/rootfs)
  39. [22:26:08] --> mapping /dev/vdf to /tmp/opt/x86_64-linux-gnu/GCC-4.8.5
  40. [22:26:08] --> mapping /dev/vde to /tmp/opt/x86_64-linux-gnu/BaseCompilerShard-2018.11.11
  41. [22:26:08] --> mapping /dev/vdd to /tmp/opt/x86_64-linux-gnu/LLVM-6.0.1-0
  42. [22:26:08] --> mapping /dev/vdc to /tmp/opt/x86_64-apple-darwin14/GCC-4.8.5
  43. [22:26:08] --> mapping /dev/vdb to /tmp/opt/x86_64-apple-darwin14/BaseCompilerShard-2018.11.11
  44. [22:26:08] --> Mounting overlay of /tmp/opt/x86_64-apple-darwin14/BaseCompilerShard-2018.11.11:/tmp/opt/x86_64-apple-darwin14/GCC-4.8.5 at /tmp/opt/x86_64-apple-darwin14 (modifications in /proc/upper/x86_64-apple-darwin14, workspace in /p[22:26:08] 6_64-apple-darwin14)
  45. [22:26:08] --> Mounting overlay of /tmp/opt/x86_64-linux-gnu/LLVM-6.0.1-0:/tmp/opt/x86_64-linux-gnu/BaseCompilerShard-2018.11.11:/tmp/opt/x86_64-linux-gnu/GCC-4.8.5 at /tmp/opt/x86_64-linux-gnu (modifications in /proc/upper/x86_64-linux-g[22:26:08] ce in /proc/work/x86_64-linux-gnu)
  46. [22:26:08] --> Mounting procfs at /tmp/proc
  47. [22:26:08] --> Mounting /dev at /tmp/dev
  48. [22:26:08] --> workspacing 9p/workspace1 to /tmp/meta
  49. [22:26:08] --> workspacing 9p/workspace0 to /tmp/workspace
  50. [22:26:08] --> Mounting procfs at /proc
  51. [22:26:08] About to run `/bin/bash` `-c` `alias ll='ls -la'
  52. [22:26:08]
  53. [22:26:08] vecho() {
  54. [22:26:08]     if [[ "true" == "true" ]]; then
  55. [22:26:08]         echo "$@"
  56. [22:26:08]     fi
  57. [22:26:08] }
  58. [22:26:08] vecho_red() {
  59. [22:26:08]     (vecho "$@" >&2)
  60. [22:26:08] }
  61. [22:26:08]
  62. [22:26:08] # Save bash history (and optionally echo it out as it happens)
  63. [22:26:08] save_history() {
  64. [22:26:08]     vecho_red " ---> $BASH_COMMAND"
  65. [22:26:08]     history -s "$BASH_COMMAND"
  66. [22:26:08]     history -a
  67. [22:26:08] }
  68. [22:26:08]
  69. [22:26:08] # Save our environment into `/meta/.env`, eliminating read-only variables
  70. [22:26:08] # so that this file can be sourced upon entering a debug shell.
  71. [22:26:08] save_env() {
  72. [22:26:08]     set +x
  73. [22:26:08]     set > /meta/.env
  74. [22:26:08]     # Ignore read-only variables
  75. [22:26:08]     for l in BASHOPTS BASH_VERSINFO UID EUID PPID SHELLOPTS; do
  76. [22:26:08]         grep -v "^$l=" /meta/.env > /meta/.env2
  77. [22:26:08]         mv /meta/.env2 /meta/.env
  78. [22:26:08]     done
  79. [22:26:08]     echo "cd $(pwd)" >> /meta/.env
  80. [22:26:08] }
  81. [22:26:08]
  82. [22:26:08] # We do a little sleight-of-hand here; we want to build inside of a tmpfs
  83. [22:26:08] # because `srcdir` might be mapped in through a networked filesystem, which
  84. [22:26:08] # totally wrecks our I/O performance.  So what we do instead is bind-mount
  85. [22:26:08] # `srcdir` to another location so that we can always get at it, copy its
  86. [22:26:08] # contents to a new tmpfs we mount at the location of `srcdir`, then when
  87. [22:26:08] # we exit on an error, we copy everything back over again
  88. [22:26:08] tmpify_srcdir() {
  89. [22:26:08]     vecho "Copying srcdir to tmpfs..."
  90. [22:26:08]     mkdir -p $WORKSPACE/.true_srcdir
  91. [22:26:08]     mount --bind $WORKSPACE/srcdir $WORKSPACE/.true_srcdir
  92. [22:26:08]     mount -t tmpfs tmpfs $WORKSPACE/srcdir
  93. [22:26:08]     echo "rsync -rlptD $WORKSPACE/.true_srcdir/ $WORKSPACE/srcdir"
  94. [22:26:08]     ls -al $WORKSPACE
  95. [22:26:08]     rsync -rlptD $WORKSPACE/.true_srcdir/ $WORKSPACE/srcdir
  96. [22:26:08]
  97. [22:26:08]     # We may have changed what pwd() means out from underneath ourselves
  98. [22:26:08]     cd $(pwd)
  99. [22:26:08] }
  100. [22:26:08]
  101. [22:26:08] # Copy our tmpfs version of `srcdir` back onto disk.
  102. [22:26:08] save_srcdir() {
  103. [22:26:08]     vecho_red "Saving srcdir due to previous error..."
  104. [22:26:08]     rsync -rlptD $WORKSPACE/srcdir/ $WORKSPACE/.true_srcdir --delete
  105. [22:26:08] }
  106. [22:26:08]
  107. [22:26:08] # If /meta is mounted, then we want to save history and environment
  108. [22:26:08] if [[ -d /meta ]]; then
  109. [22:26:08]     trap save_history DEBUG
  110. [22:26:08]     trap "save_env" EXIT
  111. [22:26:08]     trap "save_env; save_srcdir" INT TERM ERR
  112. [22:26:08] fi
  113. [22:26:08]
  114. [22:26:08] # Stop if we hit any errors.
  115. [22:26:08] set -e
  116. [22:26:08]
  117. [22:26:08] # Swap out srcdir from underneath our feet
  118. [22:26:08] tmpify_srcdir
  119. [22:26:08]
  120. [22:26:08] echo "WORKSPACE=$WORKSPACE"
  121. [22:26:08] echo "target$target"
  122. [22:26:08] echo "prefix=$prefix"
  123. [22:26:08]
  124. [22:26:08] cd $WORKSPACE/srcdir
  125. [22:26:08]
  126. [22:26:08] sed -i 's|add_subdirectory(tools)||' CMakeLists.txt
  127. [22:26:08] sed -i 's|add_subdirectory(benchmark)||' CMakeLists.txt
  128. [22:26:08] sed -i 's|add_subdirectory(test)||' CMakeLists.txt
  129. [22:26:08] sed -i 's|add_subdirectory(sqlsmith)||' third_party/CMakeLists.txt
  130. [22:26:08]
  131. [22:26:08] mkdir build
  132. [22:26:08] cd build
  133. [22:26:08] cmake -DCMAKE_BUILD_TYPE=Release ..
  134. [22:26:08] if [ $target = "x86_64-apple-darwin14" ]; then
  135. [22:26:08]   sed -i 's|-soname,libduckdb.so -o libduckdb.so|-install_name,libduckdb.dylib -o libduckdb.dylib|' ./src/CM[22:26:08] ckdb.dir/link.txt
  136. [22:26:08] fi
  137. [22:26:08] make -j$(nproc)
  138. [22:26:08] mkdir $prefix/lib
  139. [22:26:08] cp -R src/libduckdb.* $prefix/lib/
  140. [22:26:08] cp -R $WORKSPACE/srcdir/src/include $prefix/include
  141. [22:26:08]
  142. [22:26:08] `
  143. [22:26:09]  ---> trap "save_env" EXIT
  144. [22:26:09]  ---> trap "save_env; save_srcdir" INT TERM ERR
  145. [22:26:09]  ---> set -e
  146. [22:26:09]  ---> tmpify_srcdir
  147. [22:26:09] Copying srcdir to tmpfs...
  148. [22:26:09] rsync -rlptD /workspace/.true_srcdir/ /workspace/srcdir
  149. [22:26:09] total 0
  150. [22:26:09] drwxr-xr-x    6 root     root           160 Jun  5 05:26 .
  151. [22:26:09] drwxr-xr-x    1 root     root             0 Jun  5 05:26 ..
  152. [22:26:09] drwxr-xr-x   23 root     root           736 Jun  5 05:26 .true_srcdir
  153. [22:26:09] drwxr-xr-x    2 root     root            64 Jun  5 05:26 destdir
  154. [22:26:09] drwxr-xr-x    3 root     root            96 Jun  5 05:26 metadir
  155. [22:26:09] drwxr-xr-x    2 root     root             0 Jun  5 05:26 srcdir
  156. [22:26:09] rsync: pipe: Address family not supported by protocol (97)
  157. [22:26:09] rsync error: error in IPC code (code 14) at pipe.c(122) [sender=3.1.3]
  158. [22:26:09] reboot: Power down
  159. ERROR: LoadError: Build for duckdb on x86_64-apple-darwin14 did not complete successfully
  160.  
  161. Stacktrace:
  162.  [1] error(::String) at ./error.jl:33
  163.  [2] #build#184(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Array{String,1}, ::Bool, ::Function, ::BinaryBuilder.QemuRunner, ::String, ::Array{LibraryProduct,1}, ::String, ::MacOS, ::Prefix) at /Users/dashti/.julia/packages/BinaryBuilder/vkHhH/src/AutoBuild.jl:567
  164.  [3] (::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, ::MacOS, ::Prefix) at ./none:0
  165.  [4] (::getfield(BinaryBuilder, Symbol("##173#179")){Bool,Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:debug,),Tuple{Bool}}},String,String,VersionNumber,String,Array{MacOS,1},typeof(products),Array{Any,1}})(::String) at /Users/dashti/.julia/packages/BinaryBuilder/vkHhH/src/AutoBuild.jl:391
  166.  [5] mktempdir(::getfield(BinaryBuilder, Symbol("##173#179")){Bool,Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:debug,),Tuple{Bool}}},String,String,VersionNumber,String,Array{MacOS,1},typeof(products),Array{Any,1}}, ::String) at ./file.jl:581
  167.  [6] mktempdir at ./file.jl:579 [inlined]
  168.  [7] #autobuild#171(::Bool, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:debug,),Tuple{Bool}}}, ::Function, ::String, ::String, ::VersionNumber, ::Array{String,1}, ::String, ::Array{MacOS,1}, ::typeof(products), ::Array{Any,1}) at /Users/dashti/.julia/packages/BinaryBuilder/vkHhH/src/AutoBuild.jl:279
  169.  [8] (::getfield(BinaryBuilder, Symbol("#kw##autobuild")))(::NamedTuple{(:verbose, :debug),Tuple{Bool,Bool}}, ::typeof(autobuild), ::String, ::String, ::VersionNumber, ::Array{String,1}, ::String, ::Array{MacOS,1}, ::typeof(products), ::Array{Any,1}) at ./none:0
  170.  [9] #build_tarballs#160(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{String,1}, ::String, ::VersionNumber, ::Array{String,1}, ::String, ::Array{MacOS,1}, ::typeof(products), ::Array{Any,1}) at /Users/dashti/.julia/packages/BinaryBuilder/vkHhH/src/AutoBuild.jl:117
  171.  [10] build_tarballs(::Array{String,1}, ::String, ::VersionNumber, ::Array{String,1}, ::String, ::Array{MacOS,1}, ::Function, ::Array{Any,1}) at /Users/dashti/.julia/packages/BinaryBuilder/vkHhH/src/AutoBuild.jl:21
  172.  [11] top-level scope at none:0
  173.  [12] include at ./boot.jl:326 [inlined]
  174.  [13] include_relative(::Module, ::String) at ./loading.jl:1038
  175.  [14] include(::Module, ::String) at ./sysimg.jl:29
  176.  [15] include(::String) at ./client.jl:403
  177.  [16] top-level scope at none:0
  178. in expression starting at /Users/dashti/Dropbox/workspaces/RelationalAI/duckdb-builder.jl/build_tarballs.jl:67
  179.  
  180. julia>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement