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

🐛 "Could not create symlink... (File exists)" #54

Closed
thundergolfer opened this issue Dec 23, 2019 · 6 comments
Closed

🐛 "Could not create symlink... (File exists)" #54

thundergolfer opened this issue Dec 23, 2019 · 6 comments

Comments

@thundergolfer
Copy link

Description

I have a failing CI build here.

File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/2800332926ca5670e559e7706ead37a8/external/bazelruby_ruby_rules/ruby/private/toolchains/ruby_runtime.bzl", line 52, in _install_dirs
--
  | ctx.symlink(path, rel_path)
  | java.io.IOException: Could not create symlink from /usr/include to /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/2800332926ca5670e559e7706ead37a8/external/org_ruby_lang_ruby_toolchain/usr/include: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/2800332926ca5670e559e7706ead37a8/external/org_ruby_lang_ruby_toolchain/usr/include (File exists)

This is working locally, but failing in CI.


rules_ruby version: a0d21e570f79424e6125df6c691ab27ed7454e1a
Bazel version: 2.0.0

@thundergolfer thundergolfer changed the title 🐛 "Could not create symlink..." 🐛 "Could not create symlink... (File exists)" Dec 23, 2019
@thundergolfer
Copy link
Author

This might be a good opportunity to dig through the code and fix my own issue.

thundergolfer pushed a commit to thundergolfer/example-bazel-monorepo that referenced this issue Dec 23, 2019
@thundergolfer
Copy link
Author

When I log onto a CI instance and run the tests, things work fine... 🤔

thundergolfer pushed a commit to thundergolfer/example-bazel-monorepo that referenced this issue Dec 23, 2019
@kigster
Copy link
Contributor

kigster commented Jan 3, 2020

It looks like your rules are trying to build new ruby interpreter and then create symlinks to /usr/bin etc, and I bet it’s failing due to permissions problem.

If I’m correct you have two options:

  1. Run your Ci as root so these links can be created
  2. But I would recommend installing ruby in your CI Docker image and then specifying ruby interpreter as host when registering Ruby toolchain.

Host option also does not limit you to the only two versions of ruby 2.6 we currently support for building the interpreter.

It will also significantly speed up your build time.

Hope this helps!

@thundergolfer
Copy link
Author

Thanks for the reply. I wouldn't expect to see (File exists) if it was a permissions thing?

Sounds like I really just need to setup up the tooling to build AMIs for CI rather than just using the stock Amazon Linux 2 AMI.

Cheers

@kigster
Copy link
Contributor

kigster commented Feb 29, 2020

Closing since it's unclear if we need to do anything.

@kigster kigster closed this as completed Feb 29, 2020
@snnn
Copy link

snnn commented Sep 10, 2021

I still get the same error while building https://github.com/kythe/kythe.git on my local dev machine(Fedora 34).
Bazel version: 4.2.0
rules_ruby version: 0.4.1

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