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

Failure compiling MRI #44

Closed
alexeagle opened this issue Dec 4, 2023 · 6 comments
Closed

Failure compiling MRI #44

alexeagle opened this issue Dec 4, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@alexeagle
Copy link
Collaborator

Have you seen something like this?

This error feels to me like the repository rule is trying to write to some global location on my disk, and maybe we need to set an environment variable like XRUBY_RUBYLIBDIR somewhere so the MRI build process is okay with running in some read-only sandbox?

I'm on Linux, tried ruby 3.0.6 and 3.2.2, get an error like the following

x86_64-linux-fake.rb updated
external command failed with status 2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19.5M  100 19.5M    0     0  7329k      0  0:00:02  0:00:02 --:--:-- 7329k
./tool/mkconfig.rb:272:in `write': Permission denied @ io_write - <STDOUT> (Errno::EACCES)
        from ./tool/mkconfig.rb:272:in `print'
        from ./tool/mkconfig.rb:272:in `<main>'
make: *** [uncommon.mk:879: .rbconfig.time] Error 1
make: *** Waiting for unfinished jobs....

BUILD FAILED (Ubuntu 20.04 on x86_64 using ruby-build 20231114)

I do have a system ruby already

$ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
@p0deje
Copy link
Member

p0deje commented Dec 5, 2023

What Linux distro is that?

@alexeagle
Copy link
Collaborator Author

Ubuntu 20.04.6 LTS

uname -a
Linux system76-pc 5.18.10-76051810-generic #202207071639~1659403207~20.04~cb5f582~dev-Ubuntu SMP PREEMPT_DY x86_64 x86_64 x86_64 GNU/Linux

@p0deje
Copy link
Member

p0deje commented Dec 5, 2023

I tried installing using bare Ubuntu 20.04 Docker image and it worked fine:

$ docker run --platform=linux/amd64 -v $(pwd):/rules_ruby -ti ubuntu:20.04 bash
$ uname -a
Linux 6d3c0a69477d 6.4.16-linuxkit #1 SMP PREEMPT Wed Oct 25 16:32:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

# Bazelisk
$ apt-get update -y && apt-get install -y wget && wget https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel

# Ruby deps
$ apt-get install -y build-essential libz-dev libyaml-dev perl

$ cd /rules_ruby/examples/gem
$ echo "3.0.6" > .ruby-version
$ RUBY_RULES_DEBUG=1 bazel build ...
...
INFO: Build completed successfully, 31 total actions

Shall I use some other Docker image to try and reproduce?

@alexeagle
Copy link
Collaborator Author

I imagine you'd want an image that already has ruby installed on the system.

@p0deje p0deje added the bug Something isn't working label Jan 23, 2024
@p0deje
Copy link
Member

p0deje commented Jan 25, 2024

I've installed Ruby 2.7 using apt-get and still could get the toolchain to install w/o problems. How did you install your Ruby?

@alexeagle
Copy link
Collaborator Author

I have no idea, maybe with the system or from some transitive effect of apt-get install - lots of tooling wants a ruby interpreter.

If we can't reproduce then let's wait to see if users report it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants