Closed mrkaspa closed 6 years ago
cc @Schmavery who did the binary build on linux.
Just to make sure, are you using the release bsansouci/bsb-native#2.1.1
?
Could you try master? Master should work, just take a little longer because it'll build a local version of ocaml for you etc...
Could you paste the full error or is it too long?
@bsansouci done, my dependency is
"devDependencies": {
"bs-platform": "bsansouci/bsb-native#2.1.1"
}
Interesting, thanks for the bug report. I'll see what I can do to reproduce this as soon as I can. Maybe -fPIC is somehow getting disabled in the configure script by my linux build environment. Would be great if we can confirm that master (no prebuilt binaries) works properly.
@Schmavery I put master like this and didn't worked
"devDependencies": {
"bs-platform": "bsansouci/bsb-native#master"
}
Aah sorry for master simply put bsansouci/bsb-native
@bsansouci running with that got this
yarn run build
yarn run v1.3.2
$ bsb -make-world -backend native
ninja: Entering directory `lib/bs/native'
[4/4] Building src/Minimist.mlast.d
[3/3] Building test.native
FAILED: test.native
/home/mrkaspa/code/ml/minimist.re/node_modules/bs-platform/lib/bsb_helper.exe -add-ocaml-dependency bigarray -add-ocaml-dependency compiler-libs -add-ocaml-dependency threads -add-ocaml-dependency unix -w -30-40+6+7+27+32..39+44+45+101-40+6+7-26-27+32..39-28-44+45 -warn-error +8 -bs-main Test -bs-super-errors src/Minimist.mlast test/Test.mlast -link-native test.native
We've found a bug for you!
(No file name)
Cannot find file /home/mrkaspa/code/ml/minimist.re/node_modules/bs-platform/vendor/ocaml/lib/ocaml/compiler-libs/ocamlcommon.cmxa
ninja: build stopped: subcommand failed.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
That folder is not present on the node_modules
Hey @mrkaspa, I tried to repro this on two linux machine (one ubuntu) and couldn't get your error. Can we go over your system specs and repro steps? What version of ubuntu are you running? Do you have anything else related to ocaml installed globally, like reason-cli or opam? That shouldn't be a problem but it's good to cover our bases. What's your yarn version?
I'm assuming you're doing
git clone https://github.com/jaredly/minimist.re.git
cd minimist.re
yarn
yarn run build
and getting the first error you posted. If that is wrong please provide corrections so that I can try it.
When building the master branch, what error are you getting (during the yarn install)?
I just double-checked and the configure script should be including -fPIC already so I'm a bit confused here.
Hey is this still happening?
ping :)
I'm wondering if this could be related to https://caml.inria.fr/mantis/view.php?id=7595. Seems the closest I've been able to find so far. Edit: also potentially related: https://github.com/phusion/holy-build-box/issues/1
As it hints at in the hbb issue, I believe we need to be using a different activation for hbb to be able to build these libraries: https://github.com/phusion/holy-build-box/blob/c0bee9d92f88c2175777b86ac2ed0f7b077c315e/LIBRARY-VARIANTS.md#shlib
Hopefully after converting to shlib/activate instead of hbb/activate this problem will go away :)
@mrkaspa @mciparelli I just tried to rebuild the linux binary with fPIC enabled. Unfortunately I can't repro this issue on any of my machine, can either of you try to reinstall and see if it helps?
it took me a while to notice that bsb-native
uses an own version of OCaml. I understand this issue should be no longer happening in 4.03.0 but I couldn't make this library to use the locally installed library instead of the one that comes with the repo. So I forked and recompiled with -cc "gcc -fPIC" -aspp "gcc -c -fPIC"
and now it worked. It would be great to be able to use the locally installed version of ocaml somehow.
Great to hear you got yourself unblocked. If there's any chance someone with this problem can try again to see if my fix helped, that would be great :)
@mciparelli I'm confused. Which library are you talking about? If you're using bsb-native, we compile your entire project and its deps using the vendored ocaml. @Schmavery pushed a fix to the linux release that compiles all of bsb-native with its ocaml in a relocatable way, so that should fix your issue.
I've been pointing to the master branch of this repo and I had to add the mentioned flags to buildocaml.sh file for it to work. Which one you recommend me to use? Is there an npm package or something?
@mciparelli bsansouci/bsb-native#2.1.1 is the branch of the repo that attempts to install a prebuilt binary suitable for your platform. It's faster than installing master so we're trying to recommend that one and make sure it's stable for everyone.
I still get the following error when trying to use #2.1.1
relocation R_X86_64_32 against symbol `caml_backtrace_last_exn' can not be used when making a shared object; recompile with -fPIC
Looks like my linux version asks for the binary to be compiled with -fPIC option.
Darn it, thanks for sticking with us and checking! I'll try to compile a version with your -cc "gcc -fPIC" -aspp "gcc -c -fPIC"
option and hopefully that fixes it.
@mciparelli sorry about the delay, I just tried to rebuild with these options so if you get a chance, feel free to try it again :)
Yeap, that rebuild made it work for me on #2.1.1
Awesome! Thanks so much for trying again and feel free to open more issues if you run into problems :)
This is te project https://github.com/jaredly/minimist.re, when running the output is: