Repository navigation
A Windows installer, in the style of RubyInstaller - #38
Merged
Merged
Conversation
Util/installer/ironruby.iss is an Inno Setup 6 script for the win-x64 release archive: Util/installer/build-installer.sh unpacks the zip and compiles ironruby-<version>-win-x64-setup.exe, which installs the tree unchanged. - It installs into C:\IronRuby40-x64 by default, as RubyInstaller into C:\Ruby40-x64: igem install writes into the install tree, so the directory must be writable without admin rights, and Bundler's RUBYOPT, the Rails templates and mspec break on a path with a space. Another directory can be chosen; a space gets a warning, a directory that already holds other files is refused. - For the current user (the default, no admin) or for all users. It puts the install directory first on that PATH, so ironruby, ir, irb and igem work from a new terminal. - Running .rb files with IronRuby is an option, off by default, and gives .rb back to the program it had before (RubyInstaller's RubyFile) on uninstall. - The uninstaller removes the files, Src as a whole with the gems installed since, and the PATH entry, leaving the rest of PATH as it was. release.yml builds it in the win-x64 package job with Inno Setup 6.7.3, downloaded from its GitHub release and checked against the asset's SHA-256, then installs, runs and uninstalls it with Util/installer/test-installer.ps1, once for the current user and once for all users: ironruby -v, ir, irb and igem install rack from the PATH a new terminal gets, and no file or PATH entry left afterwards. It is attested with the same pinned actions/attest step as the archives and published next to the zip.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…es Strings
irb in the 4.0.2 Windows build stopped at once:
reline/io/windows.rb:112:in 'Handle#sym': unknown symbol "FillConsoleOutputCharacter"
reline binds the console API through Fiddle by the functions' bare names, and kernel32
exports only FillConsoleOutputCharacterA and ...W (ScrollConsoleScreenBuffer likewise).
CRuby's fiddle looks a missing name up again with "A" appended on Windows; Handle#sym and
#sym_defined? now do too. (CRuby also tries 32-bit stdcall decorations, name@N, which x64
does not have.)
Past that, irb in a console crashed with an access violation: reline's Win32API#call
passes each pointer argument as [str].pack("p").unpack("q*"), and IronRuby's pack("p")
writes an index into the packed string's list, not an address, so Windows wrote through
address 1. The vendored reline now hands Fiddle the String itself, which Fiddle passes as
a pointer to its bytes and copies back what C wrote - the buffer CRuby's address names.
irb now reaches its prompt in a Windows console, and runs piped input; the installer test
in release.yml runs irb from the installed tree.
…n packaging Handle#sym and #sym_defined? on Windows now try a name in the order of fiddle 1.1.8's fiddle_handle_find_func: as given, with the "A" suffix, then with the stdcall decorations "@0" to "@252", plain and after the "A". The previous commit tried only the "A". Linux and macOS are unchanged. - Fiddle_AnsiSuffix1 (MiscTests): GetModuleHandle is GetModuleHandleA, FillConsoleOutputCharacter is found, and an unknown name gives CRuby's message. - ci.yml's console smoke test and package-release.sh's check of the unpacked tree pipe `puts 6 * 7` into irb and want 42, on Windows and on Linux: irb died at a pipe as at a console in 4.0.2, so both catch that. Written in the session that found the bug alongside this one, and taken over here.
…upstream ships it #39 makes [str].pack("p") a real address, so reline's Win32API works as Ruby ships it. This branch's change to Src/StdLib/ruby/4.0/reline/io/windows.rb goes back to upstream's file, as on master. RubyTests.cs and MiscTests.cs are #39's, which hold this branch's Fiddle_AnsiSuffix1 and #39's PackPointer tests; the release note says how irb was fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Util/installer/ironruby.issis an Inno Setup 6 script for the win-x64 release archive.Util/installer/build-installer.shunpacks the zip and compilesironruby-<version>-win-x64-setup.exe, which installs the archive's tree unchanged.C:\IronRuby40-x64by default, as RubyInstaller usesC:\Ruby40-x64.igem installwrites into the install tree, so the directory must be writable without admin rights, and Bundler'sRUBYOPT, the Rails templates and mspec break on a path with a space. You can choose another directory: a path with a space gets a warning, and a directory that already holds other files is refused, because the uninstaller removesSrcfrom it whole.ironruby,ir,irbandigemwork from a new terminal. IronRuby'sirbthen comes before CRuby's;rubyandgemstay CRuby's..rbfiles with IronRuby is optional and off by default. On uninstall,.rbgoes back to the program it had before, such as RubyInstaller'sRubyFile.CI (
release.yml, win-x64 package job):Util/installer/test-installer.ps1installs it intoC:\IronRuby40-x64, once for the current user and once for all users. Each time it runsironruby -v,ir,irbandigem install rack+require 'rack'with the PATH a new terminal gets, then uninstalls and checks that no file and no PATH entry is left.actions/atteststep as the archives (dist/ironruby-*-<rid>*.*), is uploaded with the zip and is published by the release job,SHA256SUMSincluded.No binaries are committed:
check-no-executables.rbpasses on the new files. Documented in the README's binary-release section and inDocs/releases/v4.0.3.md.Tested on Windows 11 with the v4.0.2 zip (checksum and attestation verified), built with Inno Setup 6.7.3:
C:\IronRuby40-x64passed: PATH,ironruby -v,ir,igem install rack,require 'rack', then an uninstall that removed the directory and left PATH unchanged..rbassociation worked, and the uninstall restoredRubyFile.irb on Windows crashed at startup in the 4.0.2 build. It is fixed on master by #39, which this branch has merged: Fiddle finds a Win32 function's
Aexport, andpack("p")is a real address, so reline runs unmodified. The irb check in this PR's installer test (Util/installer/test-installer.ps1) covers it from the installed tree. A real console with typed input (p 6 * 7,exit) was checked by hand on Windows 11.