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

32 bit build... #1340

Closed
Crayder opened this issue Jun 6, 2016 · 7 comments
Closed

32 bit build... #1340

Crayder opened this issue Jun 6, 2016 · 7 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request
Milestone

Comments

@Crayder
Copy link

Crayder commented Jun 6, 2016

My laptop is 32 bit and all of the releases are 64 bit.

So basically I'm requesting a 32 bit .deb build.

@meteorcloudy
Copy link
Member

Can you try to compile Bazel from source?

$ git clone https://github.com/bazelbuild/bazel.git
$ cd bazel
$ ./compile.sh

This will create a bazel binary in bazel-bin/src/bazel.
http://www.bazel.io/docs/install.html#h2

@meteorcloudy meteorcloudy added type: feature request P3 We're not considering working on this, but happy to review a PR. (No assignee) labels Jun 7, 2016
@Crayder
Copy link
Author

Crayder commented Jun 8, 2016

I know how to compile... And I already tried. It just wouldn't.

@meteorcloudy
Copy link
Member

Can you show me the error you got when running ./compile.sh?

@Crayder
Copy link
Author

Crayder commented Jun 8, 2016

No, I won't have my laptop back for a few days (probably at least a week, maybe two). I don't recall what they were either.

@laszlocsomor
Copy link
Contributor

Bazel only supports 64-bit platforms. Unfortunately we can't help with building it on 32-bit platforms.

gcampax added a commit to flathub/edu.stanford.Almond that referenced this issue May 3, 2019
Because bazel will not build (at all) on 32 bit:
bazelbuild/bazel#1340
@jirkadanek
Copy link

If there is a 32bit compatible Remote Executor (https://docs.bazel.build/versions/2.0.0/remote-execution.html), it might be possible to build and test on 32 bit with bazel that way.

@jiridanek
Copy link
Contributor

As per this issue, Bazel project does not release binaries for i686 and as per #8652 the binaries are not expected to work on RHEL6x. And they indeed do not work:

[root@rhel6x ~]# bazel
/usr/local/bin/bazel: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by /usr/local/bin/bazel)

Let me drop here notes about getting Bazel on RHEL6i. I tried first running the binaries under qemu-x86_64 and then I tried remote execution. Remote execution seems to work and solves my goal of performning RHEL6i builds with Bazel. I was not able to get the qemu-x86-64 solution to work.

Remote execution

https://docs.bazel.build/versions/master/remote-execution.html

This looks to be the way.

Scoot

There is Go toolchain for i686, awesome! When I compiled the project, I hit a few issues, the last of which looked hard to fix, and I got Buildfarm working next, so I did not investigate.

Scoot does not work for me.

Buildfarm

That worked fine. I built the _dist.jars on another machine, shipped them onto rhel6i machine, together with sample configs, and was able to start remote build of Buildfarm itself. I am still watching for issues.

jdanek@nixos ~/repos/bazel-buildfarm (git)-[master] % bazel build //src/main/java/build/buildfarm:buildfarm-server_deploy.jar
jdanek@nixos ~/repos/bazel-buildfarm (git)-[master] % bazel build //src/main/java/build/buildfarm:buildfarm-operationqueue-worker_deploy.jar

Seems to be working fine so far.

Qemu

Compile qemu, as per https://wiki.qemu.org/Hosts/Linux

yum install -y git glib2-devel libfdt-devel pixman-devel zlib-devel
https://download.qemu.org/qemu-2.12.1.tar.xz
tar xf qemu-2.12.1.tar.xz
cd qemu-2.12.1
./configure --target-list=x86_64-linux-user
make install

Register qemu-x86_64 as the interpreter for 64bit binaries, from https://k3a.me/running-x86_64-amd64-executables-on-ppc64le-ibm-power-9-gentoo/

echo ':x86_64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-x86_64:OC' > /proc/sys/fs/binfmt_misc/register

Copy 64bit libraries from Ubuntu Trusty docker image (docker --rm -it library/ubuntu:trusty) onto the rhel6i system.

Taking libraries from a rhel6x does not help (glibc and libstdc++ are too old there) and with libraries from rhel7x I get a segfault. So Trusty it is.

[rhel6i] mkdir -p /lib64 /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/ 

[trusty] for lib in /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2
    do scp $lib root@rhel6i:/${lib}
done

I saw "cannot mmap brk" error from qemu, apparently caused by running out of RAM, since adding more memory to the rhel6i VM solved the problem.

qemu 0.14.0, 1.5.1

[root@rhel6i qemu-1.5.3]# bazel
qemu: Unsupported syscall: 202
qemu: Unsupported syscall: 202
qemu: Unsupported syscall: 202
qemu: Unsupported syscall: 202
qemu: Unsupported syscall: 202
qemu: Unsupported syscall: 202
file is invalid or corrupted (missing end of central directory record)
Opening zip "/proc/self/exe": Cannot find central directory
FATAL: Failed to open '/proc/self/exe' as a zip file: (error: 5): Input/output error

qemu 2.3.1

[root@rhel6i ~]# bazel
Opening zip "/proc/self/exe": lseek(): Bad file descriptor
FATAL: Failed to open '/proc/self/exe' as a zip file: (error: 9): Bad file descriptor

And I stopped version climbing at qemu 3.0.1 because I don't have packaged dependemcies in repo for it any more

[root@rhel6i qemu-3.0.1]# ./configure --target-list=x86_64-linux-user --python=/opt/miniconda3/bin/python

ERROR: glib-2.40 gthread-2.0 is required to compile QEMU

As a last resort, qemu 4.2.0, the latest version, also needs a custom kernel (due to qemu 4.2, linux/if_alg.h: No such file or directory; installed http://elrepo.org/tiki/kernel-lt) and updated glibc. I had two issues there

  • Version 2.48 of glibc claims to need lipbcre >= 8.13, but it does not work with that version (It needs PCRE_INFO_MAXLOOKBEHIND, which is undeclared). I found reports that pcre 8.21 des not work either. I installed libpcre 8.38 from sources and glib compiled fine.

  • I had to do yum install devtoolset-2-binutils, it did not get installed automatically, an I had mismatched as when compiling. Devtoolset is similar to what Red Hat calls software collection. Devtoolsets 3+ are part of SCL, but devtoolsets 1 and 2 are separate repositories. To activate the scl I had to do scl enable devtoolset-2 bash.

  CC      /root/qemu-4.2.0/slirp/src/mbuf.o
/tmp/ccodbApI.s: Assembler messages:
/tmp/ccodbApI.s:762: Error: expecting string instruction after `rep'

Never the less, after doing all this, I got a segfault this time

# LD_LIBRARY_PATH=/usr/local/lib strace -f /usr/local/bin/qemu-x86_64 /opt/baz/lib/bazel/bin/bazel-real
[pid 24103] write(6, "tty=/dev/pts/0\n", 15) = 15
[pid 24103] munmap(0x44f06000, 4096)    = 0
[pid 24103] statfs64("/root/.cache/bazel/_bazel_root/d41d8cd98f00b204e9800998ecf8427e", 84, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=10287747, f_bfree=8297009, f_bavail=7776393, f_files=2600960, f_ffree=2316214, f_fsid={1083499738, 1387305835}, f_namelen=255, f_frsize=4096, f_flags=4128}) = 0
[pid 24103] access("/usr/gnemul/qemu-x86_64/root/.cache/bazel/_bazel_root/install/a968348e0a72afc534c7baff88ca46f1", F_OK) = -1 ENOENT (No such file or directory)
[pid 24103] access("/root/.cache/bazel/_bazel_root/install/a968348e0a72afc534c7baff88ca46f1", F_OK) = -1 ENOENT (No such file or directory)
[pid 24103] clock_gettime(CLOCK_MONOTONIC, {157344, 550953409}) = 0
[pid 24103] access("/usr/gnemul/qemu-x86_64/root/.cache/bazel/_bazel_root/install", F_OK) = -1 ENOENT (No such file or directory)
[pid 24103] stat64("/root/.cache/bazel/_bazel_root/install", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 24103] lstat64("/root/.cache/bazel/_bazel_root/install", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 24103] geteuid32()                 = 0
[pid 24103] umask(022)                  = 022
[pid 24103] umask(022)                  = 022
[pid 24103] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffba4000} ---
[pid 24103] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 24103] rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], NULL, 8) = 0
[pid 24103] getrlimit(RLIMIT_CORE, {rlim_cur=0, rlim_max=RLIM_INFINITY}) = 0
[pid 24103] getrlimit(RLIMIT_CORE, {rlim_cur=0, rlim_max=RLIM_INFINITY}) = 0
[pid 24103] setrlimit(RLIMIT_CORE, {rlim_cur=0, rlim_max=RLIM_INFINITY}) = 0
[pid 24103] futex(0x413900, FUTEX_WAKE_PRIVATE, 2147483647) = 0
[pid 24103] write(2, "qemu: uncaught target signal 11 "..., 67qemu: uncaught target signal 11 (Segmentation fault) - core dumped
) = 67
[pid 24103] rt_sigaction(SIGSEGV, {SIG_DFL, ~[RTMIN RT_1], 0}, NULL, 8) = 0
[pid 24103] kill(24103, SIGSEGV)        = 0
[pid 24103] rt_sigsuspend(~[SEGV RTMIN RT_1] <unfinished ...>
[pid 24104] <... futex resumed> )       = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 24103] <... rt_sigsuspend resumed> ) = ? ERESTARTNOHAND (To be restarted if no handler)
[pid 24104] --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_USER, si_pid=24103, si_uid=0} ---
[pid 24103] rt_sigsuspend(~[SEGV RTMIN RT_1] <unfinished ...>
[pid 24104] +++ killed by SIGSEGV (core dumped) +++
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

Qemu way did not work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants