Closed clembu closed 4 years ago
@facelesspanda I did some changes. It seems that a META for executable should exist and I remove it.
Please, check new version, I want more feedback.
will try to update tonight and check again. Thanks.
just tried to pin to master and update fails with
dune build @install
Error: exception Sys_error("_build/log: Read-only file system")
Backtrace:
Raised by primitive operation at file "stdlib.ml", line 324, characters 29-55
Called from file "src/stdune/log.ml", line 23, characters 11-61
Called from file "bin/common.ml", line 73, characters 2-28
Called from file "bin/common.ml" (inlined), line 97, characters 2-39
Called from file "bin/main.ml", line 46, characters 4-37
Called from file "vendor/cmdliner/src/cmdliner_term.ml", line 25, characters 19-24
Called from file "vendor/cmdliner/src/cmdliner.ml", line 146, characters 9-16
Called from file "vendor/cmdliner/src/cmdliner.ml", line 176, characters 18-36
Called from file "vendor/cmdliner/src/cmdliner.ml", line 312, characters 20-46
Called from file "bin/main.ml", line 198, characters 10-51
I must not segfault. Uncertainty is the mind-killer. Exceptions are
the little-death that brings total obliteration. I will fully express
my cases. Execution will pass over me and through me. And when it
has gone past, I will unwind the stack along its path. Where the
cases are handled there will be nothing. Only I will remain.
make: *** [Makefile:29: install] Error 1
(content of the opam install log pertaining to lablqml)
Pinning work for me though. But your error seems quite mysterious (and hardly googlable). Do you use any non-trivial sandboxing software which can mess with access rights?
nope, just opam. I'll see about gaining more info tonight. For some reason this package is the only one that seems to make dune angry for me.
so I tried building locally.
cd lablqml
opam switch create . 4.08.1
There opam tries to install the existing local package because there's a lablqml.opam
file at the root, and I have this output
### output ###
# dune build @install
# Error: mkdir: _build: Read-only file system
# make: *** [Makefile:29: install] Error 1
eval $(opam env)
to have the environment in the shelldune build @install
That works fineWhen I run opam install .
from the lablqml repo, I have that error again about _build
being read only and dune failing with a huge backtrace.
Must come from opam's sandboxing probably?
I don't know. I tried the same but it compiles fine. https://gist.github.com/Kakadu/ddfa3d11a159f364ee74998bca13726a
If it is indeed about sanboxing, then you can try to comment out last lines in ~/.opam/config
to disable sandboxing
wrap-build-commands:
["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"}
wrap-install-commands:
["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"}
wrap-remove-commands:
["%{hooks}%/sandbox.sh" "remove"] {os = "linux" | os = "macos"}
hmm. the verbose mode helped me figuring out something that was kinda obvious: there's a build step before the install step
+ /home/odd/.opam/opam-init/hooks/sandbox.sh "build" "dune" "build" "-p" "lablqml" "-j" "3" (CWD=/home/odd/dev/lablqml/_opam/.opam-switch/build/lablqml.0.6.2)
- discover lib/c_flags.sexp,lib/c_library_flags.sexp,lib/moc.sexp,lib/rcc.sexp
- /usr/bin/moc-qt5
- /usr/bin/rcc-qt5
- gcc lib/object_ml.o
...... warnings .....
λ compiled lablqml.0.6.2
+ /home/odd/.opam/opam-init/hooks/sandbox.sh "install" "make" "install" (CWD=/home/odd/dev/lablqml/_opam/.opam-switch/build/lablqml.0.6.2)
- dune build @install
- Error: mkdir: _build: Read-only file system
- make: *** [Makefile:29: install] Error 1
lablqml is built first to /home/odd/dev/lablqml/_opam/.opam-switch/build/lablqml.0.6.2
Yet in the install step there is a dune build @install
.
I found that curious so I dug around to see how other packages that install fine are structured.
They don't have a install
entry in their .opam
file.
I'm gonna try removing it from lablqml's and see if things change.
Sure enough, removing the install entry from the opam file managed to make lablqml install perfectly, ironically as that sounds:
+ /home/odd/.opam/opam-init/hooks/sandbox.sh "build" "dune" "build" "-p" "lablqml" "-j" "3" (CWD=/home/odd/dev/lablqml/_opam/.opam-switch/build/lablqml.0.6.2)
- discover lib/c_flags.sexp,lib/c_library_flags.sexp,lib/moc.sexp,lib/rcc.sexp
- /usr/bin/moc-qt5
- /usr/bin/rcc-qt5
...... warnings .....
λ compiled lablqml.0.6.2
∗ installed lablqml.0.6.2
Done.
Okay so now that lablqml installs fine, I can assert that ppx_qt
isn't available as a preprocessor.
Using
(preprocess (per_module
((pps ppx_qt) Controller)) )
which is the preferred way to preprocess files in dune, from what I've seen,
results in dune expecting a library, when ppx_qt
is an executable.
I could "workaround" it by using a run
stanza, but it'd be a shame and could be fixed if ppx_qt was compiled as a library too.
@facelesspanda I will try to look at this at the weekend...
run
stanza will be required anyway because ppx_qt
generates C++ files.
@facelesspanda Also, if you manage to upgrade code in https://github.com/Kakadu/lablqml/tree/master/dune_test than pull-request will be appreciated.
Ok, I'll see what I can do.
The opam file for ppx_qt is empty, and nothing is installed. Makes the ppx effectively unavailable, and the library really hard to use.