planck-repl / planck

Stand-alone ClojureScript REPL
https://planck-repl.org
Eclipse Public License 1.0
1.03k stars 68 forks source link

building planck-c hangs #387

Closed velkyel closed 7 years ago

velkyel commented 7 years ago

$ script/build-c

### Building ClojureScript
Leiningen 2.7.0 on Java 1.8.0_111 OpenJDK 64-Bit Server VM
Cloning into 'clojurescript'...
remote: Counting objects: 30002, done.        
remote: Total 30002 (delta 0), reused 0 (delta 0), pack-reused 30002        
Receiving objects: 100% (30002/30002), 10.85 MiB | 2.49 MiB/s, done.
Resolving deltas: 100% (14229/14229), done.
Checking connectivity... done.
~/tmp/planck/planck-cljs/clojurescript ~/tmp/planck/planck-cljs
HEAD is now at 01c1a86 1.9.293
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   912  100   912    0     0   3247      0 --:--:-- --:--:-- --:--:--  3245
Fetching Clojure...
Copying clojure-1.9.0-alpha7/clojure-1.9.0-alpha7.jar to lib/clojure.jar...
Cleaning up Clojure directory...
Cleaning up Clojure archive...
Fetching data.json...
Copying data.json-0.2.6.jar to lib/data.json-0.2.6.jar...
Cleaning up data.json...
Fetching transit-clj...
Copying transit-cjl-0.8.285.jar to lib/transit-clj-0.8.285.jar...
Cleaning up data.json...
Fetching Google Closure library...
Fetching Google Closure third party library...
Fetching Google Closure compiler...
Cleaning up Google Closure compiler archive...
Fetching Rhino...
Copying rhino1_7R5/js.jar to lib/js.jar...
Cleaning up Rhino directory...
Cleaning up Rhino archive...
Copying closure/compiler/compiler.jar to lib/compiler.jar
Fetching tools.reader 1.0.0-beta3 ...
Moving tools.reader.jar to lib/tools.reader.jar
Fetching test.check 0.9.0 ...
Moving test.check.jar to lib/test.check.jar
[Bootstrap Completed]
+ MAJOR=1
+ MINOR=9
++ git --no-replace-objects describe --match v1.9
+ REVISION=v1.9-293-g01c1a86
+ REVISION=293-g01c1a86
+ REVISION=293
+ REVISION=293
++ mktemp /tmp/compiler.clj.XXXXXXXXXXX
+ COMP_FILE=/tmp/compiler.clj.Ios7HhVTisu
+ sed -e 's/^.def ^:dynamic \*clojurescript-version\*.*$/(def ^:dynamic *clojurescript-version* {:major 1, :minor 9, :qualifier 293})/' src/main/clojure/cljs/util.cljc
+ mv /tmp/compiler.clj.Ios7HhVTisu src/main/clojure/cljs/util.cljc
++ mktemp /tmp/core.cljs.XXXXXXXXXXX
+ CLJS_FILE=/tmp/core.cljs.RhWdkQhuAoX
+ sed -e 's/^.def \*clojurescript-version\*.*$/(def *clojurescript-version* "1.9.293")/' src/main/cljs/cljs/core.cljs
+ mv /tmp/core.cljs.RhWdkQhuAoX src/main/cljs/cljs/core.cljs
+ rm -f src/main/cljs/cljs/core.aot.js
+ rm -f src/main/cljs/cljs/core.aot.js.map
+ rm -f src/main/cljs/cljs/core.cljs.cache.aot.edn
+ rm -f src/main/cljs/cljs/core.cljs.cache.aot.json
+ ./script/aot_core
++ mktemp /tmp/cljs_cp.txt.XXXXXXXXXXX
+ CP_FILE=/tmp/cljs_cp.txt.rF3qgpOTpma
+ mvn -f pom.template.xml dependency:build-classpath -Dmdep.outputFile=/tmp/cljs_cp.txt.rF3qgpOTpma
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ClojureScript CLOJURESCRIPT_VERSION
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:build-classpath (default-cli) @ clojurescript ---
[INFO] Wrote classpath file '/tmp/cljs_cp.txt.rF3qgpOTpma'.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.539 s
[INFO] Finished at: 2016-10-29T11:04:31+02:00
[INFO] Final Memory: 16M/165M
[INFO] ------------------------------------------------------------------------
++ cat /tmp/cljs_cp.txt.rF3qgpOTpma
+ CLJS_CP=/home/el/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar:/home/el/.m2/repository/com/google/javascript/closure-compiler-unshaded/v20160911/closure-compiler-unshaded-v20160911.jar:/home/el/.m2/repository/com/google/javascript/closure-compiler-externs/v20160911/closure-compiler-externs-v20160911.jar:/home/el/.m2/repository/args4j/args4j/2.0.26/args4j-2.0.26.jar:/home/el/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar:/home/el/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar:/home/el/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/el/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/home/el/.m2/repository/com/google/jsinterop/jsinterop-annotations/1.0.0/jsinterop-annotations-1.0.0.jar:/home/el/.m2/repository/org/clojure/google-closure-library/0.0-20160609-f42b4a24/google-closure-library-0.0-20160609-f42b4a24.jar:/home/el/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20160609-f42b4a24/google-closure-library-third-party-0.0-20160609-f42b4a24.jar:/home/el/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar:/home/el/.m2/repository/org/mozilla/rhino/1.7R5/rhino-1.7R5.jar:/home/el/.m2/repository/org/clojure/tools.reader/1.0.0-beta3/tools.reader-1.0.0-beta3.jar:/home/el/.m2/repository/org/clojure/test.check/0.9.0/test.check-0.9.0.jar:/home/el/.m2/repository/com/cognitect/transit-clj/0.8.285/transit-clj-0.8.285.jar:/home/el/.m2/repository/com/cognitect/transit-java/0.8.311/transit-java-0.8.311.jar:/home/el/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.3.2/jackson-core-2.3.2.jar:/home/el/.m2/repository/org/msgpack/msgpack/0.6.10/msgpack-0.6.10.jar:/home/el/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar:/home/el/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/home/el/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
+ '[' '' = true ']'
+ java -server -cp /home/el/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar:/home/el/.m2/repository/com/google/javascript/closure-compiler-unshaded/v20160911/closure-compiler-unshaded-v20160911.jar:/home/el/.m2/repository/com/google/javascript/closure-compiler-externs/v20160911/closure-compiler-externs-v20160911.jar:/home/el/.m2/repository/args4j/args4j/2.0.26/args4j-2.0.26.jar:/home/el/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar:/home/el/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar:/home/el/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/el/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/home/el/.m2/repository/com/google/jsinterop/jsinterop-annotations/1.0.0/jsinterop-annotations-1.0.0.jar:/home/el/.m2/repository/org/clojure/google-closure-library/0.0-20160609-f42b4a24/google-closure-library-0.0-20160609-f42b4a24.jar:/home/el/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20160609-f42b4a24/google-closure-library-third-party-0.0-20160609-f42b4a24.jar:/home/el/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar:/home/el/.m2/repository/org/mozilla/rhino/1.7R5/rhino-1.7R5.jar:/home/el/.m2/repository/org/clojure/tools.reader/1.0.0-beta3/tools.reader-1.0.0-beta3.jar:/home/el/.m2/repository/org/clojure/test.check/0.9.0/test.check-0.9.0.jar:/home/el/.m2/repository/com/cognitect/transit-clj/0.8.285/transit-clj-0.8.285.jar:/home/el/.m2/repository/com/cognitect/transit-java/0.8.311/transit-java-0.8.311.jar:/home/el/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.3.2/jackson-core-2.3.2.jar:/home/el/.m2/repository/org/msgpack/msgpack/0.6.10/msgpack-0.6.10.jar:/home/el/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar:/home/el/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/home/el/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar:src/main/clojure:src/main/cljs clojure.main script/aot.clj
++ mktemp /tmp/core.aot.js.XXXXXXXXXXX
+ AOT_FILE=/tmp/core.aot.js.vkKkWWSriOX
+ sed -e s/0.0.0000/1.9.293/ src/main/cljs/cljs/core.aot.js
+ mv /tmp/core.aot.js.vkKkWWSriOX src/main/cljs/cljs/core.aot.js
++ mktemp /tmp/core.cljs.cache.aot.edn.XXXXXXXXXXX
+ AOT_CACHE_FILE=/tmp/core.cljs.cache.aot.edn.8KT9PTHPXlJ
+ sed -e s/0.0.0000/1.9-293/ src/main/cljs/cljs/core.cljs.cache.aot.edn
+ mv /tmp/core.cljs.cache.aot.edn.8KT9PTHPXlJ src/main/cljs/cljs/core.cljs.cache.aot.edn
+ lein uberjar clojure.main
Compiling cljs.core
Compiling cljs.repl
Compiling cljs.repl.server
Compiling cljs.repl.nashorn
Compiling cljs.repl.browser
Compiling cljs.repl.rhino
Compiling cljs.repl.reflect
Compiling cljs.repl.node
Compiling cljs.env
Compiling cljs.analyzer
Compiling cljs.source-map.base64
Compiling cljs.source-map.base64-vlq
Compiling cljs.js-deps
Compiling cljs.util
Compiling cljs.tagged-literals
Compiling cljs.analyzer.macros
Compiling cljs.analyzer.api
Compiling cljs.analyzer.utils
Compiling cljs.build.api
Compiling cljs.compiler.macros
Compiling cljs.compiler.api
Compiling cljs.support
Compiling cljs.compiler
Compiling cljs.env.macros
Compiling cljs.source-map
Compiling cljs.closure
Compiling cljs.core.macros
Compiling cljs.stacktrace
Compiling cljs.test
Compiling cljs.js
Compiling cljs.spec.test
Compiling cljs.spec.impl.gen
Compiling cljs.spec
Compiling cljs.pprint
Warning: skipped duplicate file: clojure/zip.cljs
Warning: skipped duplicate file: clojure/browser/repl/preload.cljs
Warning: skipped duplicate file: clojure/browser/net.cljs
Warning: skipped duplicate file: clojure/browser/event.cljs
Warning: skipped duplicate file: clojure/browser/dom.cljs
Warning: skipped duplicate file: clojure/browser/repl.cljs
Warning: skipped duplicate file: clojure/set.cljs
Warning: skipped duplicate file: clojure/reflect.cljs
Warning: skipped duplicate file: clojure/data.cljs
Warning: skipped duplicate file: clojure/walk.cljs
Warning: skipped duplicate file: clojure/string.cljs
Warning: skipped duplicate file: clojure/core/reducers.cljs
Warning: skipped duplicate file: cljs/externs.js
Warning: skipped duplicate file: cljs/core.aot.js
Warning: skipped duplicate file: cljs/stacktrace.cljc
Warning: skipped duplicate file: cljs/core.aot.js.map
Warning: skipped duplicate file: cljs/test.cljc
Warning: skipped duplicate file: cljs/js.clj
Warning: skipped duplicate file: cljs/source_map/base64.cljs
Warning: skipped duplicate file: cljs/source_map/base64_vlq.cljs
Warning: skipped duplicate file: cljs/pprint.cljs
Warning: skipped duplicate file: cljs/core.cljs.cache.aot.json
Warning: skipped duplicate file: cljs/nodejs_externs.js
Warning: skipped duplicate file: cljs/source_map.cljs
Warning: skipped duplicate file: cljs/core.cljs
Warning: skipped duplicate file: cljs/spec/test.cljc
Warning: skipped duplicate file: cljs/spec/test.cljs
Warning: skipped duplicate file: cljs/spec/impl/gen.cljc
Warning: skipped duplicate file: cljs/spec/impl/gen.cljs
Warning: skipped duplicate file: cljs/reader.cljs
Warning: skipped duplicate file: cljs/test.cljs
Warning: skipped duplicate file: cljs/bootstrap_node.js
Warning: skipped duplicate file: cljs/spec.cljc
Warning: skipped duplicate file: cljs/nodejscli.cljs
Warning: skipped duplicate file: cljs/imul.js
Warning: skipped duplicate file: cljs/js.cljs
Warning: skipped duplicate file: cljs/nodejs.cljs
Warning: skipped duplicate file: cljs/pprint.clj
Warning: skipped duplicate file: cljs/core.cljs.cache.aot.edn
Warning: skipped duplicate file: cljs/spec.cljs
Warning: skipped duplicate file: cljs/repl.cljs
Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method, or the namespace has not been AOT-compiled.
Created /home/el/tmp/planck/planck-cljs/clojurescript/target/clojurescript-0.0-SNAPSHOT.jar
Created /home/el/tmp/planck/planck-cljs/clojurescript/target/clojurescript-0.0-SNAPSHOT-standalone.jar
+ mv target/clojurescript-0.0-SNAPSHOT-standalone.jar target/cljs.jar
+ rm -f src/main/cljs/cljs/core.aot.js
+ rm -f src/main/cljs/cljs/core.aot.js.map
+ rm -f src/main/cljs/cljs/core.cljs.cache.aot.edn
+ rm -f src/main/cljs/cljs/core.cljs.cache.aot.json
~/tmp/planck/planck-cljs
Building
Done building
### Bundling 1st Stage ClojureScript
### Copying over linenoise source
### Building 1st Stage Binary
-- The C compiler identification is Clang 3.8.1
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Checking for module 'libzip'
--   Found libzip, version 1.1.2
-- Checking for module 'javascriptcoregtk-4.0'
--   Found javascriptcoregtk-4.0, version 2.14.0
-- Checking for module 'icu-uc'
--   Found icu-uc, version 57.1
-- Checking for module 'icu-io'
--   Found icu-io, version 57.1
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/el/tmp/planck/planck-c/build
Scanning dependencies of target planck
[  5%] Building C object CMakeFiles/planck.dir/archive.c.o
[ 11%] Building C object CMakeFiles/planck.dir/bundle.c.o
[ 17%] Building C object CMakeFiles/planck.dir/cljs.c.o
[ 23%] Building C object CMakeFiles/planck.dir/file.c.o
[ 29%] Building C object CMakeFiles/planck.dir/functions.c.o
[ 35%] Building C object CMakeFiles/planck.dir/http.c.o
[ 41%] Building C object CMakeFiles/planck.dir/io.c.o
[ 47%] Building C object CMakeFiles/planck.dir/jsc_utils.c.o
[ 52%] Building C object CMakeFiles/planck.dir/legal.c.o
[ 58%] Building C object CMakeFiles/planck.dir/linenoise.c.o
[ 64%] Building C object CMakeFiles/planck.dir/main.c.o
[ 70%] Building C object CMakeFiles/planck.dir/repl.c.o
[ 76%] Building C object CMakeFiles/planck.dir/shell.c.o
[ 82%] Building C object CMakeFiles/planck.dir/str.c.o
[ 88%] Building C object CMakeFiles/planck.dir/theme.c.o
[ 94%] Building C object CMakeFiles/planck.dir/timers.c.o
[100%] Linking C executable planck
[100%] Built target planck
### Compiling Macro Namespaces

attaching planck in gdb shows that it's waiting in block_until_engine_ready():

(gdb) bt
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x0000000000429e89 in block_until_engine_ready ()
#2  0x000000000042a432 in evaluate_source ()
#3  0x00000000004346ce in main ()

running on: Linux 4.7.0-1-amd64 #1 SMP Debian 4.7.8-1 (2016-10-19) x86_64 GNU/Linux

mfikes commented 7 years ago

See workaround in #329

velkyel commented 7 years ago

after commenting out these two lines https://github.com/mfikes/planck/blob/9ab737e78d9e04577dfaafe29ffa29bbc5c96fd8/planck-c/cljs.c#L431-L432 and recompile planck still hangs same way.

fstamour commented 7 years ago

P.S. I had the exact same issue at the beginning of the month on NixOS. I didn't had any time to try again though.

mfikes commented 7 years ago

@velkyel I had success on Debian GNU Linux 8 (and have updated the README.md).

uname -a for this box gives

Linux debian-gnu-linux-8 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ctk25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux

Which distro are you running?

velkyel commented 7 years ago

Linux el-desktop 4.7.0-1-amd64 #1 SMP Debian 4.7.8-1 (2016-10-19) x86_64 GNU/Linux

mfikes commented 7 years ago

@velkyel I suspect this issue is now resolved with https://github.com/mfikes/planck/commit/0aae22c6428aac15e4bf87ad49c7b4ae0dbf4dec

If you get a chance, please confirm that you can build fresh from Planck master without having any issues.

fstamour commented 7 years ago

Commenting the 2 lines as velkyel said fixed it for me too.

mfikes commented 7 years ago

@fstamour Thank you! If you clone Planck master, there should no longer be a need to comment lines. (In fact, those lines no longer exist.) It would be interesting to know if things work for you with master.

fstamour commented 7 years ago

That's what I am trying right now. I was still building with the master from the first time I tried.

fstamour commented 7 years ago

I wasn't able to compile planck on nixos, I made an issue just for that: #401.

velkyel commented 7 years ago

@mfikes it works now. Thank you!