Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dune failed to be built on bytecode-only archs #637

Closed
andyli opened this issue Mar 20, 2018 · 13 comments
Closed

dune failed to be built on bytecode-only archs #637

andyli opened this issue Mar 20, 2018 · 13 comments

Comments

@andyli
Copy link

andyli commented Mar 20, 2018

On bytecode-only archs (e.g. armel, mips, ia64), building dune failed with the error:

'/usr/bin/ocamldep' -modules src/xdg/xdg.ml > boot-depends.txt
'/usr/bin/ocamlc' -g -w -40 -o boot.exe unix.cma boot.ml
./boot.exe
Failed to parse the output of '/usr/bin/ocamlc -config':
Variable "asm" contains only spaces.
make[1]: *** [debian/rules:20: override_dh_auto_build] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:11: build-arch] Error 2

This affects updating the debian package from 1.0 beta18 to 1.0 beta19.
1.0 beta18 can be built successfully.

@rgrinberg
Copy link
Member

Yeah, that's a bummer. I suppose that we shouldn't require an assembler for bytecode only.

Would you mind posting the output of $ /usr/bin/ocamlc -config. Just to see what other fields can be missing on bytecode only.

@andyli
Copy link
Author

andyli commented Mar 20, 2018

Here is the output I got from a mips docker image (multiarch/debian-debootstrap:mips-stretch):

root@25ee2be51405:/# /usr/bin/ocamlc -config
version: 4.02.3
standard_library_default: /usr/lib/ocaml
standard_library: /usr/lib/ocaml
standard_runtime: /usr/bin/ocamlrun
ccomp_type: cc
bytecomp_c_compiler: gcc -O -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O -fPIC
bytecomp_c_libraries: -lm  -ldl -lcurses -lpthread
native_c_compiler: gcc -O -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
native_c_libraries: -lm  -ldl
native_pack_linker: ld -r  -o 
ranlib: ranlib
cc_profile: -pg
architecture: none
model: default
system: unknown
asm: 
asm_cfi_supported: false
with_frame_pointers: false
ext_obj: .o
ext_asm: .s
ext_lib: .a
ext_dll: .so
os_type: Unix
default_executable_name: a.out
systhread_supported: true
host: mips-unknown-linux-gnu
target: mips-unknown-linux-gnu
exec_magic_number: Caml1999X011
cmi_magic_number: Caml1999I017
cmo_magic_number: Caml1999O010
cma_magic_number: Caml1999A011
cmx_magic_number: Caml1999Y014
cmxa_magic_number: Caml1999Z013
ast_impl_magic_number: Caml1999M016
ast_intf_magic_number: Caml1999N015
cmxs_magic_number: Caml2007D002
cmt_magic_number: Caml2012T004

@rgrinberg
Copy link
Member

Should be fixed in master.

@andyli
Copy link
Author

andyli commented Mar 21, 2018

I've just tried with beta19.1, but it gave the same error as before.

You may find it useful to test it yourself:

docker run -it --rm multiarch/debian-debootstrap:mips-stretch bash
apt update
apt install ocaml-nox git
git clone https://github.com/ocaml/dune.git
cd dune
./configure
ocaml bootstrap.ml
./boot.exe

@rgrinberg
Copy link
Member

rgrinberg commented Mar 21, 2018 via email

@andyli
Copy link
Author

andyli commented Mar 21, 2018

But I need a mips machine or VM for this, right?

Nop, the docker image can be run on a normal x86_64 host. It uses qemu under the hook.

@rgrinberg
Copy link
Member

I get this error using it on docker for mac:

standard_init_linux.go:195: exec user process caused "exec format error"

@andyli
Copy link
Author

andyli commented Mar 21, 2018

Hmmm.. I only ran it in a Ubuntu host.
I guess you have to use a Linux VM to run the docker container then...

@rgrinberg rgrinberg reopened this Mar 21, 2018
rgrinberg added a commit to rgrinberg/jbuilder that referenced this issue Mar 21, 2018
rgrinberg added a commit that referenced this issue Mar 21, 2018
@treinen
Copy link

treinen commented Mar 21, 2018

Hello,

I just tried to build dune 1.0-beta19.1 on a mips machine:

tar xf dune-1.0-beta19.1.tar.gz
cd dune-1.0-beta19.1
make release

This fails with:

'/usr/bin/ocamldep' -modules src/usexp/usexp.ml src/usexp/parser_automaton_internal.ml src/usexp/sexp_ast.ml src/usexp/table.ml > boot-depends.txt
'/usr/bin/ocamldep' -modules src/xdg/xdg.ml > boot-depends.txt
'/usr/bin/ocamlc' -g -w -40 -o boot.exe unix.cma boot.ml
./boot.exe
Failed to parse the output of '/usr/bin/ocamlc -config':
Variable "asm" contains only spaces.
make: *** [Makefile:10: release] Error 1

-Ralf.

@rgrinberg
Copy link
Member

rgrinberg commented Mar 22, 2018 via email

@rgrinberg
Copy link
Member

Actually, we'll just defer this fix to beta20 and release it promptly (very little reason to wait for beta20 anyway)

@treinen
Copy link

treinen commented Mar 22, 2018

OK, f8225b1 compiles fine on mips. Thanks -Ralf.

@andyli
Copy link
Author

andyli commented Apr 1, 2018

@rgrinberg Gentle ping on the beta 20 release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants