Skip to content

Build: support Ruby under build.tools #10346

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

Closed
6 tasks done
humitos opened this issue May 24, 2023 · 9 comments · Fixed by #11075
Closed
6 tasks done

Build: support Ruby under build.tools #10346

humitos opened this issue May 24, 2023 · 9 comments · Fixed by #11075
Assignees
Labels
Accepted Accepted issue on our roadmap Feature New feature

Comments

@humitos
Copy link
Member

humitos commented May 24, 2023

We should add support for Ruby on build.tools. It will be useful for doctools like Jekyll.

Work required:

Note: we had a support request for this at #9599 (comment)

@humitos humitos added Feature New feature Accepted Accepted issue on our roadmap labels May 24, 2023
@humitos
Copy link
Member Author

humitos commented Jun 5, 2023

I note there are other people installing Julia as well in a pretty weird form. We should probably document how to install any tool supported by asdf in an easy way. The process is like:

build:
  commands:
    - asdf plugin add <tool> <asdf plugin url>
    - asdf install <tool> <version>
    - asdf global <tool> <version>

Users should be able to do this without our intervention. However, for those tools that require to be compiled or are heavy in network transfer, we should probably include them in our S3 cache.

@henryiii
Copy link
Contributor

henryiii commented Jun 5, 2023

FYI, this (storing in S3) would save 379s. 89s to compile the required modules for Jekyll would remain. I’d be fine with only a recent (3.2 or 3.1 ruby) cached.

@Jasha10
Copy link

Jasha10 commented Nov 15, 2023

Note to future travelers: using the build.command key as mentioned above will result in readthedocs' pre-defined process being entirely overridden.

If you just want to extend the build with additional steps, the following may be more appropriate:

build:
  jobs:
    post_system_dependencies
      - asdf plugin add <tool> <asdf plugin url>
      - asdf install <tool> <version>
      - asdf global <tool> <version>

@github-project-automation github-project-automation bot moved this to Planned in 📍Roadmap Nov 16, 2023
humitos added a commit to readthedocs/readthedocs-docker-images that referenced this issue Jan 29, 2024
humitos added a commit to readthedocs/readthedocs-docker-images that referenced this issue Feb 1, 2024
humitos added a commit to readthedocs/readthedocs-docker-images that referenced this issue Feb 1, 2024
* Add support for Ruby via `asdf`

Related readthedocs/readthedocs.org#10346

* Update tests
humitos added a commit to readthedocs/readthedocs-docker-images that referenced this issue Feb 1, 2024
* Add support for Ruby via `asdf`

Backport 47cc2d4 into Ubuntu 20.04 branch.

Related readthedocs/readthedocs.org#10346

* Update tests

Backport 7745ce5
@humitos humitos self-assigned this Feb 1, 2024
@github-project-automation github-project-automation bot moved this from Planned to Done in 📍Roadmap Feb 1, 2024
@humitos
Copy link
Member Author

humitos commented Feb 1, 2024

I added support for Ruby 3.3.x in our build images. I tested it locally and it worked fine. This work will be deployed next Tuesday, and I'd love to heard some feedback from people already using "the hacky way" 🙏🏼

Now, Ruby is available under the normal build.tools configuration option:

build:
  tools:
    ruby: "3.3"

This will use a pre-compiled version of Ruby, making the builds to build faster.

@henryiii
Copy link
Contributor

henryiii commented Feb 1, 2024

deployed next Tuesday

So we should try it out after Tuesday, it's not something we can try out quite yet?

@humitos
Copy link
Member Author

humitos commented Feb 1, 2024

Yes, after Tuesday. It's not deployed yet. I will write something here when it's deployed, so everybody is aware.

@humitos
Copy link
Member Author

humitos commented Feb 6, 2024

We just deployed this change. Ruby 3.3 is now available on Read the Docs 🎉

@henryiii
Copy link
Contributor

henryiii commented Feb 12, 2024

Before: Build took 408 seconds
After: Build took 49 seconds

🎉

Also, a lot simpler:

 build:
   os: ubuntu-22.04
+
+  tools:
+    ruby: "3.3"
 
   commands:
-    - asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
-    - asdf install ruby 3.1.2
-    - asdf global ruby 3.1.2
-    - gem install bundler
-    - bundle config set --local deployment 'true'
-    - bundle config set --local without development
     - bundle install
     - >
       JEKYLL_ENV=production bundle exec jekyll build --destination
       _readthedocs/html --baseurl $(echo -n "$READTHEDOCS_CANONICAL_URL" | cut
       -d '/' -f 4-)

@humitos
Copy link
Member Author

humitos commented Feb 13, 2024

@henryiii thanks for sharing your feedback! I'm happy the UX got improved with this feature 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Feature New feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants