SU 2024, Windows, Ruby 3.2.5

The current release of SU 2024 uses Ruby 3.2.2. Ruby 3.2.4 was released yesterday. The 3.2.2 PATCH_LEVEL is 53, the 3.2.4 PATCH_LEVEL is 170. That represents 117 updates between the two.

On Windows, one can make a copy of the SU 2024 folder, and the Ruby install can be replaced in the copy. They both share the extensions folder. It isn’t a good idea to run both at the same time.

If anyone would like to try Windows Ruby 3.2.4, a zip file is available at:
ruby-mswin-su-3.2.4.zip

The file is a stand-alone Ruby, which can also be copied into the correct SketchUp folders.

See Instructions

As to the 3.2.4 build, it was built using VS 2022, with packages from Microsoft/vcpkg. Note that it is using OpenSSL 3.3.0, which hopefully will be included in the next release of SU. The OpenSSL version in SU 2024 is 1.1.1w, which is ‘end-of-life’, but is still supported by some OS’s (Ubuntu 20.04, etc). Also, the zlib package is updated to v1.3.1 (possible CVE’s with older packages).

It was built using the code from MSP-Greg/ruby-loco, which provides Windows Ruby master builds for use in GitHub Actions.

1 Like

Where exactly is the folder for the ruby installation on Windows?

I didn’t write the clearest post. Sorry for that.

There’s two concepts here:

  1. A stand-alone Ruby that is very similar to the Ruby used in SU 2024, with the exception of the OpenSSL version. If you’re not needing to compile any C/C++ source code using OpenSSL, that change should not affect most extension code.

  2. Making a copy of your SU 2024 install, and updating the Ruby install in the copy. To do that, one either needs to be familiar with the location of all the Ruby files in SketchUp, or I need to find the PowerShell file that automates the copying of files from the extracted zip file to the copy of SketchUp…

Are you interested in the second concept? Regardless, I’ll look for that ps1 script…

EDIT: I found the ps1 file, so I’ll update it, verify that it works, and post it and full instructions on GitHub. I’ve already got a copy of SU 2024 running Ruby 3.2.4.

That’s interesting. I thought the developers patched a few things in the Ruby interpreter to make it play nice within SketchUp. Let us know if you encounter any strange crashes or other misbehavior!

Thanks.

No crashes, etc. I’m pretty familiar with stand-alone Ruby. Sometime (hopefully soon), I’ll investigate doing the same on macOS.

This leaves people’s existing SU install untouched.

Maybe this can provide feedback about the update to help Trimble/SketchUp in planning for future SU releases…

1 Like

Instructions are located at this link.

I’ve updated the Ruby zip file shown above, adding some logic to two files to allow them to function both in stand-alone Ruby and SketchUp.

You’ll need PowerShell (I’m using PowerShell 7.4.2). I did this on Windows 11, I suspect it should run fine on Windows 10 also, but I can’t test on that. You can add shortcuts to the Sketchup.exe file in the new folder, etc.

As to OpenSSL 3.3.0, most stand-alone Ruby programs ran just fine using it. Or, I don’t think the net/http gem needed any changes for OpenSSL 3.3.0. There are some differences in Ruby OpenSSL, but most of those deal with cryptography issues that I doubt any SU extensions are making use of.

So, feel free to post if you have any issues.

1 Like

I haven’t mentioned the original reason I started building stand-alone Rubies that matched SU’s Ruby install. After I had built them, I then realized that they could be pushed into a SU install, assuming the Ruby versions were compatible.

The original reason I created the builds is that SU 2021 and later use a Ruby build that’s built with different compiler tools/packages than the standard ‘publicly available’ stand-alone Rubies. So, I built it to allow installing extension gems that would work with SU.

I can provide more info if people are interested in experimenting with that…

When I include the line with my startup code
SKETCHUP_CONSOLE.show

I get this in the ruby console

c:/users/user/appdata/roaming/sketchup/sketchup 2024/sketchup/plugins/su_pcp/bin/32/SUPCP.so: warning: undefining the allocator of T_DATA class swig_runtime_data

I see that warning with both the release SU version (using Ruby 3.2.2) and the version that had Ruby 3.2.4.

It’s generated by compiled code in the ‘Scan Essentials’ extension.

So, it’s a SU problem, and it’s common when upgrading from Ruby 2.x to Ruby 3.x.

Can you check that?

It’s been almost two months since I opened this thread. Although there have been over 500 views, the Ruby zip file has been downloaded fewer than 25 times (GitHub’s API allows one to see a download count, nothing more).

I had hoped people might test it, possibly helping the SU staff determine whether updating from Ruby 3.2.2 to 3.2.4 was appropriate. Along with the update, the OpenSSL version was also updated. The updated OpenSSL has been used by CI in GitHub Actions on all three platforms.

As discussed, there have been a lot of changes in Ruby 3, but many are targeting its performance when using ‘Ruby on Rails’ applications. So, these improvements may not significantly improve Ruby’s performance in SU.

So, for those of you that downloaded the Ruby file, did it install properly for you, and did you notice any differences from the current Ruby in SU (3.2.2)?

Lastly, SU is currently not compatible with Ruby 3.3. Going forward, if a few people are interested in testing ‘new’ Ruby versions with SU, I can continue to provide builds for Windows. Some day I’ll see if the same can be done on macOS.

I just tried this on a SketchUp version and there are a lot of ‘security warning’ when one runs the PowerShell script to copy the Ruby 3.2.4 files into the SketchUp copy in ‘Program Files’. Also, I noticed more warning than when I did so a few months ago. Hence, it’s kind of a PITA cancelling all the prompts.

Oddly, the warning suggests running a ‘cloud scan’, which is only available to (I think) Windows enterprise customers. I cannot run one with a standard Windows Pro installation.

But, after the install, I did a full scan of both the new SketchUp folder and the standalone Ruby folder that the files are copied from, and they ‘passed’.

All of the code used to assemble the Ruby build is available on GitHub, some from my repos, the Ruby code itself (ruby/ruby), and some from Microsoft repos (Microsoft/vcpkg). Separate from that, the actual build tools are Visual Studio 2022.

Re GitHub, I don’t know how many classes of users GitHub has, but due to what I’m involved with, I have from time to time gotten polite emails from GitHub stating that I have to implement security protocols above and beyond what standard users must use.

So, it’s very unlikely that any of the GitHub code has been hacked because of those additional protocols. It’s also very difficult for someone to impersonate me.

So, bottom line is the code is safe. Sorry for all the security warnings. A Ruby build has quite a few compiled files, and they may generate security warnings.

To remove the warnings would require a ‘proper’ installer, and my getting a valid MSFT developer signing setup, similar to what SketchUp has. I have no need for that as my work is all with OSS software…

Ruby 3.2.5 was released today, a build of it has been added and the installation script & directions updated.

Updated instructions are here

Patch info:

PATCHLEVEL  RUBY_DESCRIPTION
    53      ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mswin64_140]
   170      ruby 3.2.4 (2024-04-23 revision af471c0e01) [x64-mswin64_140]
   208      ruby 3.2.5 (2024-07-26 revision 31d0f1a2e7) [x64-mswin64_140]