From 49cd440eebab66db539e6bf2c1521ffb86199dad Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Fri, 14 Jan 2022 20:17:10 -0700 Subject: [PATCH 01/34] Upgrade Ruby to 3.1.0, Rubygems to 3.3.4 Conflicts: .ruby-version --- .ruby-version | 2 +- .rubygems-version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ruby-version b/.ruby-version index a603bb50..fd2a0186 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.5 +3.1.0 diff --git a/.rubygems-version b/.rubygems-version index e852534b..a0891f56 100644 --- a/.rubygems-version +++ b/.rubygems-version @@ -1 +1 @@ -3.2.33 +3.3.4 From c26ea17acea37154bf2af95c29d1015243a438f4 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Thu, 21 Apr 2022 00:36:45 -0600 Subject: [PATCH 02/34] Upgrade Chef to 17.9.18, Bundler to 2.3.4, Ohai to 17.9.0 + bundle upgrade all gem deps Conflicts: Gemfile.lock --- Gemfile | 2 +- Gemfile.lock | 309 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 235 insertions(+), 76 deletions(-) diff --git a/Gemfile b/Gemfile index 62de427c..be0f5d67 100644 --- a/Gemfile +++ b/Gemfile @@ -32,4 +32,4 @@ group :development do gem 'fauxhai', '~> 6.0.0', require: false # versions after 6.0.1 remove `node['etc']` end -gem 'chef-zero', '~> 13.1', require: false # versions after 14.x require ruby 2.4 +#gem 'chef-zero', '~> 13.1', require: false # versions after 14.x require ruby 2.4 diff --git a/Gemfile.lock b/Gemfile.lock index 46071713..f0b41bce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,63 +4,130 @@ GEM addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) - awesome_print (1.9.2) + aws-eventstream (1.2.0) + aws-partitions (1.543.0) + aws-sdk-core (3.125.0) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.525.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-kms (1.53.0) + aws-sdk-core (~> 3, >= 3.125.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.110.0) + aws-sdk-core (~> 3, >= 3.125.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.4) + aws-sdk-secretsmanager (1.55.0) + aws-sdk-core (~> 3, >= 3.125.0) + aws-sigv4 (~> 1.1) + aws-sigv4 (1.4.0) + aws-eventstream (~> 1, >= 1.0.2) builder (3.2.4) byebug (11.1.3) - chef (13.10.0) + chef (17.9.18) addressable - bundler (>= 1.10) - chef-config (= 13.10.0) - chef-zero (~> 13.0) - diff-lcs (~> 1.2, >= 1.2.4) + aws-sdk-s3 (~> 1.91) + aws-sdk-secretsmanager (~> 1.46) + chef-config (= 17.9.18) + chef-utils (= 17.9.18) + chef-vault + chef-zero (>= 14.0.11) + corefoundation (~> 0.3.4) + diff-lcs (>= 1.2.4, < 1.4.0) erubis (~> 2.7) + ffi (>= 1.5.0) + ffi-libarchive (~> 1.0, >= 1.0.3) ffi-yajl (~> 2.2) - highline (~> 1.6, >= 1.6.9) iniparse (~> 1.4) - iso8601 (~> 0.9.1) - mixlib-archive (~> 0.4) - mixlib-authentication (~> 1.4) - mixlib-cli (~> 1.7) - mixlib-log (~> 1.3) - mixlib-shellout (~> 2.0) - net-sftp (~> 2.1, >= 2.1.2) - net-ssh (>= 2.9, < 5.0) - net-ssh-multi (~> 1.2, >= 1.2.1) - ohai (~> 13.0) + inspec-core (~> 4.23) + license-acceptance (>= 1.0.5, < 3) + mixlib-archive (>= 0.4, < 2.0) + mixlib-authentication (>= 2.1, < 4) + mixlib-cli (>= 2.1.1, < 3.0) + mixlib-log (>= 2.0.3, < 4.0) + mixlib-shellout (>= 3.1.1, < 4.0) + net-sftp (>= 2.1.2, < 4.0) + ohai (~> 17.0) plist (~> 3.2) proxifier (~> 1.0) - rspec-core (~> 3.5) - rspec-expectations (~> 3.5) - rspec-mocks (~> 3.5) - rspec_junit_formatter (~> 0.2.0) - serverspec (~> 2.7) - specinfra (~> 2.10) syslog-logger (~> 1.6) - uuidtools (~> 2.1.5) - chef-config (13.10.0) + train-core (~> 3.2, >= 3.2.28) + train-winrm (>= 0.2.5) + uuidtools (>= 2.1.5, < 3.0) + vault (~> 0.16) + chef-bin (17.9.18) + chef (= 17.9.18) + chef-cli (5.4.2) + addressable (>= 2.3.5, < 2.9) + chef (>= 16.0) + cookbook-omnifetch (~> 0.5) + diff-lcs (>= 1.0, < 1.4) + ffi-yajl (>= 1.0, < 3.0) + license-acceptance (>= 1.0.11, < 3) + minitar (~> 0.6) + mixlib-cli (>= 1.7, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + pastel (~> 0.7) + solve (> 2.0, < 5.0) + chef-config (17.9.18) addressable + chef-utils (= 17.9.18) fuzzyurl - mixlib-config (>= 2.2.12, < 3.0) - mixlib-shellout (~> 2.0) + mixlib-config (>= 2.2.12, < 4.0) + mixlib-shellout (>= 2.0, < 4.0) tomlrb (~> 1.2) - chef-zero (13.1.0) + chef-telemetry (1.1.1) + chef-config + concurrent-ruby (~> 1.0) + chef-utils (17.9.18) + concurrent-ruby + chef-vault (4.1.5) + chef-zero (15.0.11) ffi-yajl (~> 2.2) - hashie (>= 2.0, < 4.0) - mixlib-log (~> 1.3) - rack (~> 2.0) + hashie (>= 2.0, < 5.0) + mixlib-log (>= 2.0, < 4.0) + rack (~> 2.0, >= 2.0.6) uuidtools (~> 2.1) - chefspec (7.3.4) - chef (>= 12.16.42) - fauxhai (>= 4) + webrick + chefspec (9.3.1) + chef (>= 15) + chef-cli + fauxhai-ng (>= 7.5) rspec (~> 3.0) coderay (1.1.3) coolline (0.5.0) unicode_utils (~> 1.4) + concurrent-ruby (1.1.9) + cookbook-omnifetch (0.11.1) + mixlib-archive (>= 0.4, < 2.0) + corefoundation (0.3.4) + ffi (>= 1.15.0) diff-lcs (1.5.0) + erubi (1.10.0) erubis (2.7.0) + faraday (1.4.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) + multipart-post (>= 1.2, < 3) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday_middleware (1.2.0) + faraday (~> 1.0) fauxhai (6.0.1) net-ssh + fauxhai-ng (9.1.0) + net-ssh ffi (1.15.5) + ffi-libarchive (1.1.3) + ffi (~> 1.0) ffi-yajl (2.4.0) libyajl2 (>= 1.2) foodcritic (16.3.0) @@ -72,6 +139,8 @@ GEM treetop (~> 1.4) formatador (0.3.0) fuzzyurl (0.9.0) + gssapi (1.3.1) + ffi (>= 1.0.1) guard (2.18.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -93,11 +162,38 @@ GEM guard-shell (0.7.2) guard (>= 2.0.0) guard-compat (~> 1.0) - hashie (2.1.2) - highline (1.7.10) + gyoku (1.3.1) + builder (>= 2.1.2) + hashie (4.1.0) + highline (2.0.3) + httpclient (2.8.3) iniparse (1.5.0) + inspec-core (4.52.9) + addressable (~> 2.4) + chef-telemetry (~> 1.0, >= 1.0.8) + faraday (>= 0.9.0, < 1.5) + faraday_middleware (~> 1.0) + hashie (>= 3.4, < 5.0) + license-acceptance (>= 0.2.13, < 3.0) + method_source (>= 0.8, < 2.0) + mixlib-log (~> 3.0) + multipart-post (~> 2.0) + parallel (~> 1.9) + parslet (>= 1.5, < 2.0) + pry (~> 0.13) + rspec (>= 3.9, < 3.11) + rspec-its (~> 1.2) + rubyzip (>= 1.2.2, < 3.0) + semverse (~> 3.0) + sslshake (~> 1.2) + thor (>= 0.20, < 2.0) + tomlrb (>= 1.2, < 2.1) + train-core (~> 3.0) + tty-prompt (~> 0.17) + tty-table (~> 0.10) ipaddress (0.8.3) - iso8601 (0.9.1) + jmespath (1.4.0) + json (2.6.1) librarian (0.1.2) highline thor (~> 0.15) @@ -106,28 +202,40 @@ GEM librarian (~> 0.1.0) minitar (>= 0.5.2) libyajl2 (2.1.0) + license-acceptance (2.1.13) + pastel (~> 0.7) + tomlrb (>= 1.2, < 3.0) + tty-box (~> 0.6) + tty-prompt (~> 0.20) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + little-plugger (1.1.4) + logging (2.3.0) + little-plugger (~> 1.1) + multi_json (~> 1.14) lumberjack (1.2.8) method_source (1.0.0) mini_portile2 (2.7.1) minitar (0.9) - mixlib-archive (0.4.20) + mixlib-archive (1.1.7) mixlib-log - mixlib-authentication (1.4.2) - mixlib-cli (1.7.0) - mixlib-config (2.2.18) + mixlib-authentication (3.0.10) + mixlib-cli (2.1.8) + mixlib-config (3.0.9) tomlrb - mixlib-log (1.7.1) - mixlib-shellout (2.4.4) + mixlib-log (3.0.9) + mixlib-shellout (3.2.5) + chef-utils + molinillo (0.8.0) multi_json (1.15.0) + multipart-post (2.1.1) nenv (0.3.0) net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-ssh (4.2.0) + net-sftp (3.0.0) + net-ssh (>= 5.0.0, < 7.0.0) + net-ssh (6.1.0) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) net-ssh-multi (1.2.1) @@ -143,24 +251,29 @@ GEM racc (~> 1.4) nokogiri (1.13.1-x86_64-linux) racc (~> 1.4) + nori (2.6.0) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - ohai (13.12.6) - chef-config (>= 12.5.0.alpha.1, < 14) + ohai (17.9.0) + chef-config (>= 14.12, < 18) + chef-utils (>= 16.0, < 18) ffi (~> 1.9) ffi-yajl (~> 2.2) ipaddress - mixlib-cli (< 2.0) - mixlib-config (~> 2.0) - mixlib-log (>= 1.7.1, < 2.0) - mixlib-shellout (~> 2.0) + mixlib-cli (>= 1.7.0) + mixlib-config (>= 2.0, < 4.0) + mixlib-log (>= 2.0.1, < 4.0) + mixlib-shellout (~> 3.2, >= 3.2.5) plist (~> 3.1) - systemu (~> 2.6.4) + train-core wmi-lite (~> 1.0) parallel (1.21.0) parser (3.1.0.0) ast (~> 2.4.1) + parslet (1.8.2) + pastel (0.8.0) + tty-color (~> 0.5) plist (3.6.0) polyglot (0.3.5) proxifier (1.0.3) @@ -214,47 +327,93 @@ GEM rubocop-ast (1.15.1) parser (>= 3.0.1.1) ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + rubyntlm (0.6.3) + rubyzip (2.3.2) rufus-lru (1.1.0) - serverspec (2.41.8) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.72) - sfl (2.3) + semverse (3.0.0) shellany (0.0.1) - soloist (1.0.3) - awesome_print - chef - hashie (~> 2.0) - librarian-chef - net-ssh - thor - specinfra (2.83.1) - net-scp - net-ssh (>= 2.7) - net-telnet (= 0.1.1) - sfl + solve (4.0.4) + molinillo (~> 0.6) + semverse (>= 1.1, < 4.0) + sslshake (1.3.1) + strings (0.2.1) + strings-ansi (~> 0.2) + unicode-display_width (>= 1.5, < 3.0) + unicode_utils (~> 1.4) + strings-ansi (0.2.0) syslog-logger (1.6.8) - systemu (2.6.5) thor (0.20.3) tomlrb (1.3.0) + train-core (3.8.6) + addressable (~> 2.5) + ffi (!= 1.13.0) + json (>= 1.8, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + net-scp (>= 1.2, < 4.0) + net-ssh (>= 2.9, < 7.0) + train-winrm (0.2.12) + winrm (>= 2.3.6, < 3.0) + winrm-elevated (~> 1.2.2) + winrm-fs (~> 1.0) treetop (1.6.11) polyglot (~> 0.3) + tty-box (0.7.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-cursor (~> 0.7) + tty-color (0.6.0) + tty-cursor (0.7.1) + tty-prompt (0.23.1) + pastel (~> 0.8) + tty-reader (~> 0.8) + tty-reader (0.9.0) + tty-cursor (~> 0.7) + tty-screen (~> 0.8) + wisper (~> 2.0) + tty-screen (0.8.1) + tty-table (0.12.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-screen (~> 0.8) unicode-display_width (2.1.0) unicode_utils (1.4.0) - uuidtools (2.1.5) + uuidtools (2.2.0) + vault (0.16.0) + aws-sigv4 + webrick (1.7.0) + winrm (2.3.6) + builder (>= 2.1.2) + erubi (~> 1.8) + gssapi (~> 1.2) + gyoku (~> 1.0) + httpclient (~> 2.2, >= 2.2.0.2) + logging (>= 1.6.1, < 3.0) + nori (~> 2.0) + rubyntlm (~> 0.6.0, >= 0.6.3) + winrm-elevated (1.2.3) + erubi (~> 1.8) + winrm (~> 2.0) + winrm-fs (~> 1.0) + winrm-fs (1.3.5) + erubi (~> 1.8) + logging (>= 1.6.1, < 3.0) + rubyzip (~> 2.0) + winrm (~> 2.0) + wisper (2.0.1) wmi-lite (1.0.5) PLATFORMS arm64-darwin-21 ruby universal-darwin-20 + x86_64-darwin-18 x86_64-darwin-19 + x86_64-darwin-20 x86_64-linux DEPENDENCIES bundler - chef-zero (~> 13.1) chefspec fauxhai (~> 6.0.0) ffi (>= 1.15.2) @@ -271,7 +430,7 @@ DEPENDENCIES pry-coolline rspec rubocop - soloist + soloist! BUNDLED WITH 2.3.4 From 4b2cd676b8e82d6ef9024d91e95a8f045ccfdac8 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 10 Jan 2022 20:26:17 -0700 Subject: [PATCH 03/34] soloistrc.JamesCuzellaMBP: Workaround git provider error in Chef 17.9.18 Error was: git branch -f HEAD 86c1e3c04379266d47dff8104bc9eef12c72c8a2 fatal: 'HEAD' is not a valid branch name. --- soloistrc.E0000001104.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/soloistrc.E0000001104.yml b/soloistrc.E0000001104.yml index 788be4cf..a658b1a4 100644 --- a/soloistrc.E0000001104.yml +++ b/soloistrc.E0000001104.yml @@ -361,6 +361,7 @@ node_attributes: vim_alias_vi_to_minimal_vim: false versions: rvm: 1.26.11 + bash_it: master rvm: user_installs: - user: jcuzella From e2fdddf6cd743a56363f5f3bc0b7ace22aa40300 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Thu, 21 Apr 2022 01:27:50 -0600 Subject: [PATCH 04/34] Up/Downgrade & DepSolve Gems: chefspec, diff-lcs, librarian-chef, chef, chef-cli, rspec, rspec-mocks Chef downgraded to 16.7.61 --- Gemfile.lock | 186 +++++++++++++++++---------------------------------- 1 file changed, 61 insertions(+), 125 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f0b41bce..cc6cbb21 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,43 +4,26 @@ GEM addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) - aws-eventstream (1.2.0) - aws-partitions (1.543.0) - aws-sdk-core (3.125.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.53.0) - aws-sdk-core (~> 3, >= 3.125.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.110.0) - aws-sdk-core (~> 3, >= 3.125.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sdk-secretsmanager (1.55.0) - aws-sdk-core (~> 3, >= 3.125.0) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.4.0) - aws-eventstream (~> 1, >= 1.0.2) + awesome_print (1.9.2) + bcrypt_pbkdf (1.1.0.rc1) builder (3.2.4) byebug (11.1.3) - chef (17.9.18) + chef (16.7.61) addressable - aws-sdk-s3 (~> 1.91) - aws-sdk-secretsmanager (~> 1.46) - chef-config (= 17.9.18) - chef-utils (= 17.9.18) + bcrypt_pbkdf (= 1.1.0.rc1) + bundler (>= 1.10) + chef-config (= 16.7.61) + chef-utils (= 16.7.61) chef-vault chef-zero (>= 14.0.11) - corefoundation (~> 0.3.4) diff-lcs (>= 1.2.4, < 1.4.0) + ed25519 (~> 1.2) erubis (~> 2.7) - ffi (>= 1.5.0) + ffi (>= 1.9.25) ffi-libarchive (~> 1.0, >= 1.0.3) ffi-yajl (~> 2.2) + highline (>= 1.6.9, < 3) iniparse (~> 1.4) - inspec-core (~> 4.23) license-acceptance (>= 1.0.5, < 3) mixlib-archive (>= 0.4, < 2.0) mixlib-authentication (>= 2.1, < 4) @@ -48,17 +31,20 @@ GEM mixlib-log (>= 2.0.3, < 4.0) mixlib-shellout (>= 3.1.1, < 4.0) net-sftp (>= 2.1.2, < 4.0) - ohai (~> 17.0) + net-ssh (>= 4.2, < 7) + net-ssh-multi (~> 1.2, >= 1.2.1) + ohai (~> 16.0) + pastel plist (~> 3.2) proxifier (~> 1.0) syslog-logger (~> 1.6) train-core (~> 3.2, >= 3.2.28) train-winrm (>= 0.2.5) - uuidtools (>= 2.1.5, < 3.0) - vault (~> 0.16) - chef-bin (17.9.18) - chef (= 17.9.18) - chef-cli (5.4.2) + tty-prompt (~> 0.21) + tty-screen (~> 0.6) + tty-table (~> 0.11) + uuidtools (~> 2.1.5) + chef-cli (5.6.1) addressable (>= 2.3.5, < 2.9) chef (>= 16.0) cookbook-omnifetch (~> 0.5) @@ -70,19 +56,15 @@ GEM mixlib-shellout (>= 2.0, < 4.0) pastel (~> 0.7) solve (> 2.0, < 5.0) - chef-config (17.9.18) + chef-config (16.7.61) addressable - chef-utils (= 17.9.18) + chef-utils (= 16.7.61) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) tomlrb (~> 1.2) - chef-telemetry (1.1.1) - chef-config - concurrent-ruby (~> 1.0) - chef-utils (17.9.18) - concurrent-ruby - chef-vault (4.1.5) + chef-utils (16.7.61) + chef-vault (4.1.10) chef-zero (15.0.11) ffi-yajl (~> 2.2) hashie (>= 2.0, < 5.0) @@ -90,40 +72,23 @@ GEM rack (~> 2.0, >= 2.0.6) uuidtools (~> 2.1) webrick - chefspec (9.3.1) + chefspec (9.3.3) chef (>= 15) chef-cli fauxhai-ng (>= 7.5) rspec (~> 3.0) coderay (1.1.3) - coolline (0.5.0) - unicode_utils (~> 1.4) - concurrent-ruby (1.1.9) cookbook-omnifetch (0.11.1) mixlib-archive (>= 0.4, < 2.0) - corefoundation (0.3.4) - ffi (>= 1.15.0) - diff-lcs (1.5.0) + coolline (0.5.0) + unicode_utils (~> 1.4) + diff-lcs (1.3) + ed25519 (1.3.0) erubi (1.10.0) erubis (2.7.0) - faraday (1.4.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - multipart-post (>= 1.2, < 3) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday_middleware (1.2.0) - faraday (~> 1.0) fauxhai (6.0.1) net-ssh - fauxhai-ng (9.1.0) + fauxhai-ng (9.3.0) net-ssh ffi (1.15.5) ffi-libarchive (1.1.3) @@ -162,37 +127,14 @@ GEM guard-shell (0.7.2) guard (>= 2.0.0) guard-compat (~> 1.0) - gyoku (1.3.1) + gyoku (1.4.0) builder (>= 2.1.2) - hashie (4.1.0) + rexml (~> 3.0) + hashie (2.1.2) highline (2.0.3) httpclient (2.8.3) iniparse (1.5.0) - inspec-core (4.52.9) - addressable (~> 2.4) - chef-telemetry (~> 1.0, >= 1.0.8) - faraday (>= 0.9.0, < 1.5) - faraday_middleware (~> 1.0) - hashie (>= 3.4, < 5.0) - license-acceptance (>= 0.2.13, < 3.0) - method_source (>= 0.8, < 2.0) - mixlib-log (~> 3.0) - multipart-post (~> 2.0) - parallel (~> 1.9) - parslet (>= 1.5, < 2.0) - pry (~> 0.13) - rspec (>= 3.9, < 3.11) - rspec-its (~> 1.2) - rubyzip (>= 1.2.2, < 3.0) - semverse (~> 3.0) - sslshake (~> 1.2) - thor (>= 0.20, < 2.0) - tomlrb (>= 1.2, < 2.1) - train-core (~> 3.0) - tty-prompt (~> 0.17) - tty-table (~> 0.10) ipaddress (0.8.3) - jmespath (1.4.0) json (2.6.1) librarian (0.1.2) highline @@ -225,11 +167,10 @@ GEM mixlib-config (3.0.9) tomlrb mixlib-log (3.0.9) - mixlib-shellout (3.2.5) + mixlib-shellout (3.2.7) chef-utils molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.1.1) nenv (0.3.0) net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) @@ -241,7 +182,6 @@ GEM net-ssh-multi (1.2.1) net-ssh (>= 2.6.5) net-ssh-gateway (>= 1.2.0) - net-telnet (0.1.1) nokogiri (1.13.1) mini_portile2 (~> 2.7.0) racc (~> 1.4) @@ -255,9 +195,9 @@ GEM notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - ohai (17.9.0) - chef-config (>= 14.12, < 18) - chef-utils (>= 16.0, < 18) + ohai (16.17.0) + chef-config (>= 14.12, < 17) + chef-utils (>= 16.0, < 17) ffi (~> 1.9) ffi-yajl (~> 2.2) ipaddress @@ -268,10 +208,9 @@ GEM plist (~> 3.1) train-core wmi-lite (~> 1.0) - parallel (1.21.0) + parallel (1.22.1) parser (3.1.0.0) ast (~> 2.4.1) - parslet (1.8.2) pastel (0.8.0) tty-color (~> 0.5) plist (3.6.0) @@ -286,7 +225,7 @@ GEM pry-coolline (0.2.6) coolline (~> 0.5) pry (~> 0.13) - public_suffix (4.0.6) + public_suffix (4.0.7) racc (1.6.0) rack (2.2.3) rainbow (3.1.1) @@ -296,25 +235,19 @@ GEM ffi (~> 1.0) regexp_parser (2.2.0) rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-its (1.3.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.3) - rspec_junit_formatter (0.2.3) - builder (< 4) - rspec-core (>= 2, < 4, != 2.12.0) + rspec-support (~> 3.11.0) + rspec-support (3.11.0) rubocop (1.24.1) parallel (~> 1.10) parser (>= 3.0.0.0) @@ -327,16 +260,21 @@ GEM rubocop-ast (1.15.1) parser (>= 3.0.1.1) ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) rubyntlm (0.6.3) rubyzip (2.3.2) rufus-lru (1.1.0) semverse (3.0.0) shellany (0.0.1) + soloist (1.0.3) + awesome_print + chef + hashie (~> 2.0) + librarian-chef + net-ssh + thor solve (4.0.4) molinillo (~> 0.6) semverse (>= 1.1, < 4.0) - sslshake (1.3.1) strings (0.2.1) strings-ansi (~> 0.2) unicode-display_width (>= 1.5, < 3.0) @@ -345,14 +283,14 @@ GEM syslog-logger (1.6.8) thor (0.20.3) tomlrb (1.3.0) - train-core (3.8.6) + train-core (3.9.2) addressable (~> 2.5) ffi (!= 1.13.0) json (>= 1.8, < 3.0) mixlib-shellout (>= 2.0, < 4.0) net-scp (>= 1.2, < 4.0) net-ssh (>= 2.9, < 7.0) - train-winrm (0.2.12) + train-winrm (0.2.13) winrm (>= 2.3.6, < 3.0) winrm-elevated (~> 1.2.2) winrm-fs (~> 1.0) @@ -378,9 +316,7 @@ GEM tty-screen (~> 0.8) unicode-display_width (2.1.0) unicode_utils (1.4.0) - uuidtools (2.2.0) - vault (0.16.0) - aws-sigv4 + uuidtools (2.1.5) webrick (1.7.0) winrm (2.3.6) builder (>= 2.1.2) @@ -401,7 +337,7 @@ GEM rubyzip (~> 2.0) winrm (~> 2.0) wisper (2.0.1) - wmi-lite (1.0.5) + wmi-lite (1.0.7) PLATFORMS arm64-darwin-21 @@ -430,7 +366,7 @@ DEPENDENCIES pry-coolline rspec rubocop - soloist! + soloist BUNDLED WITH 2.3.4 From b8a3948ca0c31af2d3501320ee4a3b22fd67cc28 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Thu, 21 Apr 2022 01:33:10 -0600 Subject: [PATCH 05/34] Add VSCode project files --- .vscode/extensions.json | 7 +++++++ .vscode/sprout-wrap.code-workspace | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/sprout-wrap.code-workspace diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..d34d678e --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "davidanson.vscode-markdownlint", + "elagil.pre-commit-helper", + "cschleiden.vscode-github-actions" + ] +} diff --git a/.vscode/sprout-wrap.code-workspace b/.vscode/sprout-wrap.code-workspace new file mode 100644 index 00000000..64bfb872 --- /dev/null +++ b/.vscode/sprout-wrap.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": ".." + } + ], + "settings": {} +} From 04f1330ec22a66f297d2da477693848c7388c3c4 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 2 Jul 2024 17:57:03 -0600 Subject: [PATCH 06/34] Migrate deprecated Cask: blackhole -> blackhole-16ch --- soloistrc.lyra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soloistrc.lyra.yml b/soloistrc.lyra.yml index 5a8db3ad..13b26e62 100644 --- a/soloistrc.lyra.yml +++ b/soloistrc.lyra.yml @@ -278,7 +278,7 @@ node_attributes: - audio-hijack - loopback - keyfinder - - blackhole + - blackhole-16ch - elektron-overbridge - elektron-transfer - paulxstretch From a2873e29000fb2e7b73fba939941c703be0c3f2b Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 9 Jul 2024 13:54:47 -0600 Subject: [PATCH 07/34] Upgrade Rubygems to 3.3.7, Xcode to 14.3.1 --- .rubygems-version | 2 +- bootstrap-scripts/bootstrap.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubygems-version b/.rubygems-version index a0891f56..86fb6504 100644 --- a/.rubygems-version +++ b/.rubygems-version @@ -1 +1 @@ -3.3.4 +3.3.7 diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index cd3c652d..5693de77 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -287,7 +287,7 @@ detect_platform_version # https://developer.apple.com/downloads/index.action case $platform_version in 12.*) - XCODE_DMG='Xcode_13.3.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1 ; + XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; BYPASS_APPLE_TCC="1" ;; From 797dfb3cb4ed0722bd7b55b68220a7b825ec80a3 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 9 Jul 2024 15:21:47 -0600 Subject: [PATCH 08/34] bootstrap.sh: Wait for CommandLine Tools to be installed --- bootstrap-scripts/bootstrap.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 5693de77..f35f6e69 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -381,7 +381,10 @@ if [[ "$TRY_XCI_OSASCRIPT_FIRST" == '1' ]]; then # Source: https://web.archive.org/web/20211210020829/https://techviewleo.com/install-xcode-command-line-tools-macos/ if [ ! -d /Library/Developer/CommandLineTools ]; then xcode-select --install - sleep 1 + # Wait for CLT Installer App starts & grab PID + while ! clt_pid=$(pgrep -f 'Install Command Line Developer Tools.app' 2>/dev/null) ; do + sleep 1 + done osascript <<-EOD tell application "System Events" tell process "Install Command Line Developer Tools" @@ -390,6 +393,9 @@ if [[ "$TRY_XCI_OSASCRIPT_FIRST" == '1' ]]; then end tell end tell EOD + # Wait for CLT to be fully installed before continuing + # wait for non-child PID (Darwin) + lsof -p $clt_pid +r 1 &>/dev/null else echo "INFO: Found /Library/Developer/CommandLineTools already existing. skipping..." fi From 892e3ded5b5cb1edd38e5d89a2f1de2f9b939817 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Sun, 14 Jul 2024 17:24:37 -0600 Subject: [PATCH 09/34] soloistrc.lyra: Add brew fund tap --- soloistrc.lyra.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/soloistrc.lyra.yml b/soloistrc.lyra.yml index 13b26e62..f8c0dcce 100644 --- a/soloistrc.lyra.yml +++ b/soloistrc.lyra.yml @@ -198,6 +198,7 @@ node_attributes: - jlhonora/lsusb - homebrew/cask-drivers - chef/homebrew-chef + - colindean/fund formulas: - bash-completion # - ctags-exuberant From b95af1c7b2ea25c6bf52109c3a3b7a31a8193902 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Sun, 14 Jul 2024 18:15:17 -0600 Subject: [PATCH 10/34] bootstrap.sh: Install OpenSSL 3.x via Homebrew MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: From current chef-workstation manifest, they use 3.0.12. Homebrew uses: 3.3.1 We may need to adjust... but it should be ABI compatible 🤷 Depends on: rvm/rvm#5480 If RVM is insistent on using openssl@1.1, you need to: rvm get master --- bootstrap-scripts/bootstrap.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index f35f6e69..dea5449b 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -197,6 +197,9 @@ function rvm_set_compile_opts() { } function brew_install_rvm_libs() { + if [[ "$BREW_INSTALL_OPENSSL" == "1" ]]; then + grep -q 'openssl@3' Brewfile || echo "brew 'openssl@3'" >> Brewfile + fi if [[ "$CI" != 'true' ]]; then if [[ "$BREW_INSTALL_LIBFFI" == "1" ]]; then grep -q 'libffi' Brewfile || echo "brew 'libffi'" >> Brewfile @@ -287,7 +290,7 @@ detect_platform_version # https://developer.apple.com/downloads/index.action case $platform_version in 12.*) - XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1 ; + XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1 BREW_INSTALL_OPENSSL=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; BYPASS_APPLE_TCC="1" ;; From dac4e693056b9b479b201135d2e9de0d810c8569 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Sun, 14 Jul 2024 18:19:35 -0600 Subject: [PATCH 11/34] Upgrade Ruby to 3.1.2, Rubygems to 3.3.7 Current chef-workstation version manifest: chef-workstation 24.6.1066 Component Installed Version Version GUID Overridden From ------------------------------------------------------------------------------------------------------------------------------------------------------------------- bzip2 1.0.8 sha256:ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 c_rehash_ruby main path:/Users/anka/buildkite-workspace/omnibus/files/../../components/rehash cacerts 2022-10-11 sha256:2cff03f9efdaf52626bd1b451d700605dc1ea000c5da56bd0fc59f8f43071040 chef-analyze 0.1.186 git:e1a9d15d95fcaa307343f227a5c165d3b1b16c83 main chef-workstation-app 0.2.191 config_guess master git:84f04b02a7e2fc8eaa9d52deee5f6d57b06fe447 curl 8.4.0 sha256:816e41809c043ff285e8c0f06a75a1fa250211bbfb2dc0a037eeef39f1a9e427 expat 2.5.0 sha256:6b902ab103843592be5e99504f846ec109c1abb692e85347587f237a4ffa1033 gem-permissions 0.0.1 gem-version-manifest 24.6.1066 gems 24.6.1066 git-custom-bindir 2.39.3 sha256:2f9aa93c548941cc5aff641cedc24add15b912ad8c9b36ff5a41b1a9dcad783e go 1.21.5 sha256:a2e1d5743e896e5fe1e7d96479c0a769254aed18cf216cf8f4c3a2300a9b3923 1.19.5 go-uninstall 0.0.1 google-protobuf v3.21.12 git:f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c habitat 1.6.1041 sha256:2dbde6139a47341d63e696014262b37958461fdaed7cfafe5e72f534bc66e40e libarchive 3.6.2 sha256:ba6d02f15ba04aba9c23fd5f236bb234eab9d5209e95d1c4df85c44d5f19b9b3 libedit 20120601-3.0 sha256:51f0f4b4a97b7ebab26e7b5c2564c47628cdb3042fd8ba8d0605c719d2541918 libffi 3.4.2 sha256:540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620 3.4.4 libiconv 1.16 sha256:e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04 1.17 liblzma 5.2.5 sha256:f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10 5.2.10 libnghttp2 1.58.0 sha256:9ebdfbfbca164ef72bdf5fd2a94a4e6dfb54ec39d2ef249aeb750a91ae361dfb libxml2 2.12.5 sha256:a972796696afd38073e0f59c283c3a2f5a560b5268b4babc391b286166526b21 2.11.7 libxslt 1.1.39 sha256:2a20ad621148339b0759c4d4e96719362dee64c9a096dbba625ba053846349f0 libyaml 0.1.7 sha256:8088e457264a98ba451a90b8661fcb4f9d6f478f7265d48322a196cec2480729 0.2.5 main-chef-wrapper 24.6.1066 more-ruby-cleanup 24.6.1066 ncurses 6.4 sha256:6931283d9ac87c5073f30b6290c4c75f21632bb4fc3603ac8100812bed248159 openssl 3.0.12 sha256:f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61 openssl-customization 24.6.1066 pcre 8.45 sha256:4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 preparation 1.0.0 rb-fsevent-gem 623f64a7edfd2505e64aa2125f01a54ffd6166ba git:623f64a7edfd2505e64aa2125f01a54ffd6166ba ruby 3.1.2 sha256:61843112389f02b735428b53bb64cf988ad9fb81858b8248e22e57336f24a83e 3.1.3 ruby-cleanup 1.0.0 ruby-env-script 24.6.1066 rubygems-customization 24.6.1066 shebang-cleanup 0.0.2 uninstall-scripts 24.6.1066 version-manifest 0.0.1 zlib 1.3.1 sha256:9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 1.2.13 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index fd2a0186..ef538c28 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.0 +3.1.2 From 434cc4e9bd2553d67ec5cb52d7906e1e014cfeaa Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Sun, 14 Jul 2024 18:30:08 -0600 Subject: [PATCH 12/34] bootstrap.sh: Link RVM ruby build against OpenSSL 3.x from Homebrew --- bootstrap-scripts/bootstrap.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index dea5449b..9f71a82c 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -177,6 +177,9 @@ function rvm_set_compile_opts() { update: --no-document EOF + if [[ "$RVM_COMPILE_OPTS_OPENSSL3" == "1" ]]; then + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" + fi if [[ "$RVM_COMPILE_OPTS_M1_LIBFFI" == "1" ]]; then export optflags="-Wno-error=implicit-function-declaration" export LDFLAGS="-L${HOMEBREW_PREFIX}/opt/libffi/lib" @@ -290,7 +293,7 @@ detect_platform_version # https://developer.apple.com/downloads/index.action case $platform_version in 12.*) - XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1 BREW_INSTALL_OPENSSL=1 ; + XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1 BREW_INSTALL_OPENSSL=1 RVM_COMPILE_OPTS_OPENSSL3=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; BYPASS_APPLE_TCC="1" ;; From 4ff99d31166b970350a9fc4d838985ce9e492c7d Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Sun, 14 Jul 2024 19:47:39 -0600 Subject: [PATCH 13/34] bootstrap.sh: Enable YJIT --- bootstrap-scripts/bootstrap.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 9f71a82c..652f3722 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -177,6 +177,9 @@ function rvm_set_compile_opts() { update: --no-document EOF + if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --reconfigure --enable-yjit" + fi if [[ "$RVM_COMPILE_OPTS_OPENSSL3" == "1" ]]; then export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" fi @@ -200,6 +203,9 @@ function rvm_set_compile_opts() { } function brew_install_rvm_libs() { + if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then + grep -q 'rust' Brewfile || echo "brew 'rust'" >> Brewfile + fi if [[ "$BREW_INSTALL_OPENSSL" == "1" ]]; then grep -q 'openssl@3' Brewfile || echo "brew 'openssl@3'" >> Brewfile fi @@ -293,7 +299,8 @@ detect_platform_version # https://developer.apple.com/downloads/index.action case $platform_version in 12.*) - XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1 BREW_INSTALL_OPENSSL=1 RVM_COMPILE_OPTS_OPENSSL3=1 ; + XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1; + BREW_INSTALL_OPENSSL=1 ; RVM_COMPILE_OPTS_OPENSSL3=1 ; RVM_ENABLE_YJIT=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; BYPASS_APPLE_TCC="1" ;; From c84c4a3269a3a13a6d4b5922dc15bc3720f79196 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Sun, 14 Jul 2024 19:49:06 -0600 Subject: [PATCH 14/34] bootstrap.sh: Pass CONFIGURE_ARGS to rvm install --- bootstrap-scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 652f3722..4a108c21 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -226,7 +226,7 @@ function rvm_install_ruby_and_gemset() { rvm_set_compile_opts - rvm install "ruby-${sprout_ruby_version}" + rvm install "ruby-${sprout_ruby_version}" ${CONFIGURE_ARGS} rvm use "ruby-${sprout_ruby_version}" rvm gemset create "$sprout_ruby_gemset" rvm use "ruby-${sprout_ruby_version}"@"${sprout_ruby_gemset}" From dc198fe10ead89337f8c7fa1fa51be466f6e6463 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 10:34:22 -0600 Subject: [PATCH 15/34] .sublime-text: Add .sublime-project json file --- .gitignore | 1 + .sublime-text/sprout-wrap.sublime-project | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 .sublime-text/sprout-wrap.sublime-project diff --git a/.gitignore b/.gitignore index a9041f93..fb904bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ tmp/ cookbooks/ .bundle/ vendor/bundle +*.sublime-workspace diff --git a/.sublime-text/sprout-wrap.sublime-project b/.sublime-text/sprout-wrap.sublime-project new file mode 100644 index 00000000..ee4f1124 --- /dev/null +++ b/.sublime-text/sprout-wrap.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "../." + } + ] +} From d06caa1dee0e75293f1adf4ee2acbe087a1cc745 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 10:41:02 -0600 Subject: [PATCH 16/34] bootstrap.sh: Bump copyright date --- bootstrap-scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 4a108c21..a54f34bf 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -9,7 +9,7 @@ # ./bootstrap.sh # # http://github.com/LyraPhase/sprout-wrap -# Copyright (C) © 🄯 2013-2021 James Cuzella +# Copyright (C) © 🄯 2013-2024 James Cuzella # This script may be freely distributed under the MIT license. ## Figure out OSX version (source: https://www.opscode.com/chef/install.sh) From 8e0ff09525531ad7cac21e5a731beefebb6659fd Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 12:09:33 -0600 Subject: [PATCH 17/34] bootstrap.sh: Link RVM ruby build against Homebrew libs Due to macOS stock libs being so outdated, and the general hostility of Apple's OS-level changes to installing Ruby + dependencies over **many** years... we must now go down the path of installing everything we need from Homebrew. This will come with its own breakages due to Homebrew's history of formula deprecations, renames, etc... C'est la vie Currently including: - libffi - libreadline - libxslt - libyaml --- bootstrap-scripts/bootstrap.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index a54f34bf..ca588c9f 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -188,16 +188,31 @@ function rvm_set_compile_opts() { export LDFLAGS="-L${HOMEBREW_PREFIX}/opt/libffi/lib" export DLDFLAGS="-L${HOMEBREW_PREFIX}/opt/libffi/lib" export CPPFLAGS="-I${HOMEBREW_PREFIX}/opt/libffi/include" - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libffi/lib/pkgconfig" + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libffi/lib/pkgconfig:${PKG_CONFIG_PATH}" # Escape from current Gemfile.lock bundler version restriction for bootstrap # NOTE: This could cause problems in the future, b/c # we depend on system bundler to write ~/.bundle/config here # Let's hope they don't break config file API version - bash -c 'cd /tmp/ && bundle config build.ffi --enable-system-libffi' + bash -c "cd /tmp/ && bundle config build.ffi -- --with-libffi-dir=$(pkg-config --variable=prefix libffi )" fi - if [[ "$RVM_COMPILE_OPTS_M1_NOKOGIRI" == "1" ]]; then + if [[ "$RVM_COMPILE_OPTS_M1_NOKOGIRI" == "1" && "$machine" == "arm64" ]]; then bash -c 'cd /tmp/ && bundle config build.nokogiri --platform=ruby -- --use-system-libraries' + elif [[ "$RVM_COMPILE_OPTS_LIBXSLT" == "1" ]]; then + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libxslt/lib/pkgconfig:${PKG_CONFIG_PATH}" + bash -c "cd /tmp/ && bundle config build.nokogiri --platform=ruby -- --with-xslt-dir=$(pkg-config --variable=prefix libxslt )" + fi + + if [[ "$RVM_COMPILE_OPTS_READLINE" ]]; then + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/readline/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-readline-dir=$(pkg-config --variable=prefix readline)" + fi + + if [[ "$RVM_COMPILE_OPTS_LIBYAML" ]]; then + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libyaml/lib/pkgconfig:${PKG_CONFIG_PATH}" + # Note: The pkg-config .pc file is named: yaml-0.1.pc + # This may be a Homebrew packaging error, so if it changes, we could switch to using: brew --prefix libyaml + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libyaml-dir=$(pkg-config --variable=prefix yaml-0.1)" fi turn_trace_off } @@ -301,6 +316,7 @@ case $platform_version in 12.*) XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1; BREW_INSTALL_OPENSSL=1 ; RVM_COMPILE_OPTS_OPENSSL3=1 ; RVM_ENABLE_YJIT=1 ; + BREW_INSTALL_READLINE=1; RVM_COMPILE_OPTS_READLINE=1 ; BREW_INSTALL_LIBYAML=1 ; RVM_COMPILE_OPTS_LIBYAML=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; BYPASS_APPLE_TCC="1" ;; From 24de3d5ce0a7c2711b8bd55cdfe6ede5a9631f4a Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 13:48:19 -0600 Subject: [PATCH 18/34] bootstrap.sh: Install & link all Ruby + Nokogiri deps via Homebrew Part of the effort to decouple our Ruby installation as much as possible from macOS, to insulate against the incessant changes pushed by Apple. Similar to postmodern/ruby-install#484, we will also install `ncurses` from Homebrew. Avoiding Apple's system-installed version for any Ruby versions installed using RVM. --- bootstrap-scripts/bootstrap.sh | 65 ++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index ca588c9f..7f3bbf8a 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -170,6 +170,7 @@ function check_sprout_locked_ruby_versions() { function rvm_set_compile_opts() { turn_trace_on_if_was_on + local opt_dir # Disable installing RI docs for speed cat > "${HOME}/.gemrc" <<-EOF @@ -198,14 +199,29 @@ function rvm_set_compile_opts() { if [[ "$RVM_COMPILE_OPTS_M1_NOKOGIRI" == "1" && "$machine" == "arm64" ]]; then bash -c 'cd /tmp/ && bundle config build.nokogiri --platform=ruby -- --use-system-libraries' - elif [[ "$RVM_COMPILE_OPTS_LIBXSLT" == "1" ]]; then - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libxslt/lib/pkgconfig:${PKG_CONFIG_PATH}" - bash -c "cd /tmp/ && bundle config build.nokogiri --platform=ruby -- --with-xslt-dir=$(pkg-config --variable=prefix libxslt )" + elif [[ "$RVM_COMPILE_OPTS_NOKOGIRI_DEPS" == "1" ]]; then + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libxslt/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/libxml2/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/zlib/lib/pkgconfig:${PKG_CONFIG_PATH}" + local nokogiri_dep_configure_flags=( + "--with-xslt-dir=$(pkg-config --variable=prefix libxslt )" + "--with-iconv-dir=$(brew --prefix libiconv )" + "--with-xml2-dir=$(pkg-config --variable=prefix libxml-2.0 )" + "--with-zlib-dir=$(pkg-config --variable=prefix zlib )" + ) + # Run in forked subshell to avoid sprout-wrap's project Gemfile.lock context + ( + cd /tmp/ && bundle config build.nokogiri --platform=ruby -- "${nokogiri_dep_configure_flags[@]}" + ) fi if [[ "$RVM_COMPILE_OPTS_READLINE" ]]; then export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/readline/lib/pkgconfig:${PKG_CONFIG_PATH}" export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-readline-dir=$(pkg-config --variable=prefix readline)" + opt_dir="$(pkg-config --variable=prefix readline):${opt_dir}" + fi + + if [[ "$RVM_COMPILE_OPTS_NCURSES" ]]; then + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/ncurses/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-ncurses-dir=$(pkg-config --variable=prefix ncurses)" fi if [[ "$RVM_COMPILE_OPTS_LIBYAML" ]]; then @@ -213,17 +229,49 @@ function rvm_set_compile_opts() { # Note: The pkg-config .pc file is named: yaml-0.1.pc # This may be a Homebrew packaging error, so if it changes, we could switch to using: brew --prefix libyaml export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libyaml-dir=$(pkg-config --variable=prefix yaml-0.1)" + opt_dir="$(pkg-config --variable=prefix yaml-0.1):${opt_dir}" + fi + # Optional Ruby Std-lib dependency + # See: https://ruby-doc.org/stdlib-1.9.3/libdoc/gdbm/rdoc/GDBM.html + if [[ "$RVM_COMPILE_OPTS_GDBM" ]]; then + opt_dir="$(brew --prefix gdbm):${opt_dir}" + fi + + if [ -n "$opt_dir" ]; then + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-opt-dir=${opt_dir}" fi turn_trace_off } function brew_install_rvm_libs() { + # Refer to Ruby dependency list from ruby-install to keep this updated + # https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby/dependencies.txt#L5 + # TODO: xz automake bison readline libyaml gdbm libffi if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then grep -q 'rust' Brewfile || echo "brew 'rust'" >> Brewfile fi - if [[ "$BREW_INSTALL_OPENSSL" == "1" ]]; then + # Note: Locked version due to CVE-2024-3094 + if [[ "$BREW_INSTALL_XZ" == "1" ]]; then + grep -q 'xz@5.4.6' Brewfile || echo "brew 'xz@5.4.6'" >> Brewfile + fi + if [[ "$BREW_INSTALL_BISON" == "1" ]]; then + grep -q 'bison' Brewfile || echo "brew 'bison'" >> Brewfile + fi + if [[ "$BREW_INSTALL_GDBM" == "1" ]]; then + grep -q 'gdbm' Brewfile || echo "brew 'gdbm'" >> Brewfile + fi + if [[ "$BREW_INSTALL_OPENSSL3" == "1" ]]; then grep -q 'openssl@3' Brewfile || echo "brew 'openssl@3'" >> Brewfile fi + if [[ "$BREW_INSTALL_READLINE" == "1" ]]; then + grep -q 'readline' Brewfile || echo "brew 'readline'" >> Brewfile + fi + if [[ "$BREW_INSTALL_NCURSES" == "1" ]]; then + grep -q 'ncurses' Brewfile || echo "brew 'ncurses'" >> Brewfile + fi + if [[ "$BREW_INSTALL_LIBYAML" == "1" ]]; then + grep -q 'libyaml' Brewfile || echo "brew 'libyaml'" >> Brewfile + fi if [[ "$CI" != 'true' ]]; then if [[ "$BREW_INSTALL_LIBFFI" == "1" ]]; then grep -q 'libffi' Brewfile || echo "brew 'libffi'" >> Brewfile @@ -232,6 +280,7 @@ function brew_install_rvm_libs() { grep -q 'libxml2' Brewfile || echo "brew 'libxml2'" >> Brewfile grep -q 'libxslt' Brewfile || echo "brew 'libxslt'" >> Brewfile grep -q 'libiconv' Brewfile || echo "brew 'libiconv'" >> Brewfile + grep -q 'zlib' Brewfile || echo "brew 'zlib'" >> Brewfile fi fi } @@ -315,8 +364,12 @@ detect_platform_version case $platform_version in 12.*) XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1; - BREW_INSTALL_OPENSSL=1 ; RVM_COMPILE_OPTS_OPENSSL3=1 ; RVM_ENABLE_YJIT=1 ; - BREW_INSTALL_READLINE=1; RVM_COMPILE_OPTS_READLINE=1 ; BREW_INSTALL_LIBYAML=1 ; RVM_COMPILE_OPTS_LIBYAML=1 ; + BREW_INSTALL_OPENSSL3=1 ; RVM_COMPILE_OPTS_OPENSSL3=1 ; RVM_ENABLE_YJIT=1 ; + BREW_INSTALL_READLINE=1 ; RVM_COMPILE_OPTS_READLINE=1 ; + BREW_INSTALL_NCURSES=1 ; RVM_COMPILE_OPTS_NCURSES=1 ; + BREW_INSTALL_LIBYAML=1 ; RVM_COMPILE_OPTS_LIBYAML=1 ; + BREW_INSTALL_XZ=1 ; BREW_INSTALL_GDBM=1 ; + RVM_COMPILE_OPTS_NOKOGIRI_DEPS=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; BYPASS_APPLE_TCC="1" ;; From a417e877cec092f235424a7bb5ad9f0d5e509ffd Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 13:52:20 -0600 Subject: [PATCH 19/34] bootstrap.sh: Switch to Homebrew's new prefix: /usr/local References: - https://github.com/orgs/Homebrew/discussions/3316#discussioncomment-10055460 - https://github.com/Homebrew/brew/blob/master/Library/Homebrew/brew.sh#L33-L50 - https://github.com/Homebrew/brew/blob/75e77db9f4c5b0760d464722a3298f44785c8dc2/bin/brew#L72-L74 --- bootstrap-scripts/bootstrap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 7f3bbf8a..6a245963 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -561,8 +561,8 @@ if [ "$machine" == "arm64" ]; then export HOMEBREW_PREFIX=/opt/homebrew export PATH="/opt/homebrew/bin:${PATH}" else - export HOMEBREW_PREFIX=/usr/local/homebrew - export PATH="/usr/local/homebrew/bin:${PATH}" + export HOMEBREW_PREFIX=/usr/local + export PATH="/usr/local/bin:${PATH}" fi brew_install_rvm_libs From 777320d21be4179010494f9a13894a013b8515af Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 15:17:40 -0600 Subject: [PATCH 20/34] =?UTF-8?q?bootstrap.sh:=20We=20can=20only=20install?= =?UTF-8?q?=20latest=20`xz`=20=F0=9F=98=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is because of: Homebrew/homebrew-bundle#547 --- bootstrap-scripts/bootstrap.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 6a245963..e3d088c3 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -246,13 +246,14 @@ function rvm_set_compile_opts() { function brew_install_rvm_libs() { # Refer to Ruby dependency list from ruby-install to keep this updated # https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby/dependencies.txt#L5 - # TODO: xz automake bison readline libyaml gdbm libffi if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then grep -q 'rust' Brewfile || echo "brew 'rust'" >> Brewfile fi - # Note: Locked version due to CVE-2024-3094 + # Note: Beware of CVE-2024-3094 + # Cannot lock version due to https://github.com/Homebrew/homebrew-bundle/issues/547#issuecomment-525443604 + # So, we must rely on the Homebrew community to not push the new versions until it's been vetted if [[ "$BREW_INSTALL_XZ" == "1" ]]; then - grep -q 'xz@5.4.6' Brewfile || echo "brew 'xz@5.4.6'" >> Brewfile + grep -q 'xz' Brewfile || echo "brew 'xz'" >> Brewfile fi if [[ "$BREW_INSTALL_BISON" == "1" ]]; then grep -q 'bison' Brewfile || echo "brew 'bison'" >> Brewfile From 0866fd9e28c6517df0b647b0e1e155e25fe59fcd Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 17:20:50 -0600 Subject: [PATCH 21/34] bootstrap.sh: Install + link against libksba from Homebrew --- bootstrap-scripts/bootstrap.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index e3d088c3..0db85c39 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -231,6 +231,11 @@ function rvm_set_compile_opts() { export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libyaml-dir=$(pkg-config --variable=prefix yaml-0.1)" opt_dir="$(pkg-config --variable=prefix yaml-0.1):${opt_dir}" fi + if [[ "$RVM_COMPILE_OPTS_LIBKSBA" ]]; then + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libksba/lib/pkgconfig:${PKG_CONFIG_PATH}" + # Note: This pkg-config .pc file is named: ksba.pc + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libksba-dir=$(pkg-config --variable=prefix ksba)" + fi # Optional Ruby Std-lib dependency # See: https://ruby-doc.org/stdlib-1.9.3/libdoc/gdbm/rdoc/GDBM.html if [[ "$RVM_COMPILE_OPTS_GDBM" ]]; then @@ -273,6 +278,9 @@ function brew_install_rvm_libs() { if [[ "$BREW_INSTALL_LIBYAML" == "1" ]]; then grep -q 'libyaml' Brewfile || echo "brew 'libyaml'" >> Brewfile fi + if [[ "$BREW_INSTALL_LIBKSBA" == "1" ]]; then + grep -q 'libksba' Brewfile || echo "brew 'libksba'" >> Brewfile + fi if [[ "$CI" != 'true' ]]; then if [[ "$BREW_INSTALL_LIBFFI" == "1" ]]; then grep -q 'libffi' Brewfile || echo "brew 'libffi'" >> Brewfile @@ -369,6 +377,7 @@ case $platform_version in BREW_INSTALL_READLINE=1 ; RVM_COMPILE_OPTS_READLINE=1 ; BREW_INSTALL_NCURSES=1 ; RVM_COMPILE_OPTS_NCURSES=1 ; BREW_INSTALL_LIBYAML=1 ; RVM_COMPILE_OPTS_LIBYAML=1 ; + BREW_INSTALL_LIBKSBA=1 ; RVM_COMPILE_OPTS_LIBKSBA=1 ; BREW_INSTALL_XZ=1 ; BREW_INSTALL_GDBM=1 ; RVM_COMPILE_OPTS_NOKOGIRI_DEPS=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; From 0cb88779bcea8a34a99b3065cb14f91bea345007 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 17:22:52 -0600 Subject: [PATCH 22/34] bootstrap.sh: Fix configure args to rvm + Ruby dist tarball --- bootstrap-scripts/bootstrap.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 0db85c39..1fa3c0aa 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -179,7 +179,7 @@ function rvm_set_compile_opts() { EOF if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --reconfigure --enable-yjit" + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-yjit" fi if [[ "$RVM_COMPILE_OPTS_OPENSSL3" == "1" ]]; then export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" @@ -245,6 +245,10 @@ function rvm_set_compile_opts() { if [ -n "$opt_dir" ]; then export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-opt-dir=${opt_dir}" fi + + if [ -n "$CONFIGURE_ARGS" ]; then + export CONFIGURE_ARGS=" -C ${CONFIGURE_ARGS}" + fi turn_trace_off } From 96455b56369f26c78db04906d1871c25eda43e9c Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 17:24:30 -0600 Subject: [PATCH 23/34] bootstrap.sh: Fix RVM triggering EXIT trap via overridden shell builtins --- bootstrap-scripts/bootstrap.sh | 52 +++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 1fa3c0aa..4e397760 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -298,15 +298,30 @@ function brew_install_rvm_libs() { fi } +# Use rvm as a function within each subshell +# This is necessary to do per-subshell because it overrides built-in commands +# like `cd`, and the rvm __zsh_like_cd() function triggers our traps via EXIT +function source_rvm() { + if ! type rvm 2>&1 | grep -q 'rvm is a function' ; then + # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. + export PATH="$PATH:$HOME/.rvm/bin" + + [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* + fi +} + function rvm_install_ruby_and_gemset() { check_sprout_locked_ruby_versions rvm_set_compile_opts - - rvm install "ruby-${sprout_ruby_version}" ${CONFIGURE_ARGS} - rvm use "ruby-${sprout_ruby_version}" - rvm gemset create "$sprout_ruby_gemset" - rvm use "ruby-${sprout_ruby_version}"@"${sprout_ruby_gemset}" + # N.B.: Use a subshell for rvm functions, so that our kill_timeout_loop is not inherited + ( + source_rvm + rvm install "ruby-${sprout_ruby_version}" ${CONFIGURE_ARGS} + rvm use "ruby-${sprout_ruby_version}" + rvm gemset create "$sprout_ruby_gemset" + rvm use "ruby-${sprout_ruby_version}"@"${sprout_ruby_gemset}" + ) } # shellcheck disable=SC1010 @@ -315,11 +330,17 @@ function rvm_install_bundler() { # Install bundler + rubygems in RVM path echo "rvm ${sprout_ruby_version} do gem update --system ${sprout_rubygems_ver}" - rvm "${sprout_ruby_version}" do gem update --system "${sprout_rubygems_ver}" + ( + source_rvm + rvm "${sprout_ruby_version}" do gem update --system "${sprout_rubygems_ver}" + ) # Install same version of bundler as Gemfile.lock echo "rvm ${sprout_ruby_version} do gem install --default bundler:${sprout_bundler_ver}" - rvm "${sprout_ruby_version}" do gem install --default "bundler:${sprout_bundler_ver}" + ( + source_rvm + rvm "${sprout_ruby_version}" do gem install --default "bundler:${sprout_bundler_ver}" + ) } # shellcheck disable=SC1010 @@ -329,11 +350,17 @@ function rvm_debug_gems() { type rvm | head -1 command -v ruby command -v bundler - rvm info + ( + source_rvm + rvm info + ) echo "GEMS IN SHELL ENV:" gem list echo "GEMS IN ${sprout_ruby_version}@${sprout_ruby_gemset}:" - rvm "${sprout_ruby_version}"@"${sprout_ruby_gemset}" do gem list + ( + source_rvm + rvm "${sprout_ruby_version}"@"${sprout_ruby_gemset}" do gem list + ) echo "======= DEBUG ============" fi } @@ -617,13 +644,6 @@ elif [[ "$CI" != 'true' ]]; then check_trace_state turn_trace_off - if ! type rvm 2>&1 | grep -q 'rvm is a function' ; then - # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. - export PATH="$PATH:$HOME/.rvm/bin" - - [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* - fi - # Install .ruby-version @ .ruby-gemset rvm_install_ruby_and_gemset From 9e62bc2ce88d43c7f963acd1161e74327e6a522a Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 18:34:32 -0600 Subject: [PATCH 24/34] bootstrap.sh: Fix GNU Autoconf failure - __func__ name string Reference: - https://dev.to/franklinyu/error-of-rubyfunctionnamestring-when-compiling-ruby-32b8 --- bootstrap-scripts/bootstrap.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 4e397760..a31f3a99 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -242,6 +242,10 @@ function rvm_set_compile_opts() { opt_dir="$(brew --prefix gdbm):${opt_dir}" fi + if [[ "$RVM_COMPILE_OPTS_FUNC_NAME_STRING" == "1" ]]; then + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-rb_cv_function_name_string=__func__" + fi + if [ -n "$opt_dir" ]; then export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-opt-dir=${opt_dir}" fi @@ -409,7 +413,8 @@ case $platform_version in BREW_INSTALL_NCURSES=1 ; RVM_COMPILE_OPTS_NCURSES=1 ; BREW_INSTALL_LIBYAML=1 ; RVM_COMPILE_OPTS_LIBYAML=1 ; BREW_INSTALL_LIBKSBA=1 ; RVM_COMPILE_OPTS_LIBKSBA=1 ; - BREW_INSTALL_XZ=1 ; BREW_INSTALL_GDBM=1 ; + BREW_INSTALL_XZ=1 ; BREW_INSTALL_GDBM=1 ; RVM_COMPILE_OPTS_GDBM=1 ; + RVM_COMPILE_OPTS_FUNC_NAME_STRING=1 ; RVM_COMPILE_OPTS_NOKOGIRI_DEPS=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; From 1a6c781fa310baf660c4aec4eb9d1711cf753355 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Mon, 15 Jul 2024 23:31:08 -0600 Subject: [PATCH 25/34] bootstrap.sh: Add Ruby Autoconf patch workaround for rvm/rvm#5483 --- bootstrap-scripts/bootstrap.sh | 8 ++++---- .../patches/ruby-3.1.2-configure.ac.patch | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 bootstrap-scripts/patches/ruby-3.1.2-configure.ac.patch diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index a31f3a99..7fe7f9c2 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -242,8 +242,8 @@ function rvm_set_compile_opts() { opt_dir="$(brew --prefix gdbm):${opt_dir}" fi - if [[ "$RVM_COMPILE_OPTS_FUNC_NAME_STRING" == "1" ]]; then - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-rb_cv_function_name_string=__func__" + if [[ "$RVM_COMPILE_OPTS_PATCH_AUTOCONF_FUNC_NAME_STRING" == "1" ]]; then + export RVM_PATCH_ARGS="--patch ${REPO_BASE}/bootstrap-scripts/patches/ruby-3.1.2-configure.ac.patch" fi if [ -n "$opt_dir" ]; then @@ -251,7 +251,7 @@ function rvm_set_compile_opts() { fi if [ -n "$CONFIGURE_ARGS" ]; then - export CONFIGURE_ARGS=" -C ${CONFIGURE_ARGS}" + export CONFIGURE_ARGS="${RVM_PATCH_ARGS} -C ${CONFIGURE_ARGS}" fi turn_trace_off } @@ -414,7 +414,7 @@ case $platform_version in BREW_INSTALL_LIBYAML=1 ; RVM_COMPILE_OPTS_LIBYAML=1 ; BREW_INSTALL_LIBKSBA=1 ; RVM_COMPILE_OPTS_LIBKSBA=1 ; BREW_INSTALL_XZ=1 ; BREW_INSTALL_GDBM=1 ; RVM_COMPILE_OPTS_GDBM=1 ; - RVM_COMPILE_OPTS_FUNC_NAME_STRING=1 ; + RVM_COMPILE_OPTS_PATCH_AUTOCONF_FUNC_NAME_STRING=1 ; RVM_COMPILE_OPTS_NOKOGIRI_DEPS=1 ; BYPASS_APPLE_TCC="1"; BREW_INSTALL_NOKOGIRI_LIBS="1" ; RVM_COMPILE_OPTS_M1_NOKOGIRI=1 ;; 11.6*) XCODE_DMG='Xcode_13.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ; diff --git a/bootstrap-scripts/patches/ruby-3.1.2-configure.ac.patch b/bootstrap-scripts/patches/ruby-3.1.2-configure.ac.patch new file mode 100644 index 00000000..aac91f2b --- /dev/null +++ b/bootstrap-scripts/patches/ruby-3.1.2-configure.ac.patch @@ -0,0 +1,11 @@ +--- a/configure.ac 2022-04-12 05:11:15.000000000 -0600 ++++ b/configure.ac 2024-07-15 22:24:27.000000000 -0600 +@@ -1685,6 +1685,8 @@ + rb_cv_function_name_string, + [AS_CASE(["$target_os"],[openbsd*],[ + rb_cv_function_name_string=__func__ ++ ],[*darwin*],[ ++ rb_cv_function_name_string=__func__ + ],[ + rb_cv_function_name_string=no + RUBY_WERROR_FLAG([ From f221aa7db0ccfb728ffa8b30da9c577090f06f52 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 00:18:42 -0600 Subject: [PATCH 26/34] bootstrap.sh: YJIT: Install Rust stable toolchain for machine architecture --- bootstrap-scripts/bootstrap.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 7fe7f9c2..3df6c142 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -180,6 +180,7 @@ function rvm_set_compile_opts() { if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then export CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-yjit" + rustup default stable-${machine}-apple-darwin fi if [[ "$RVM_COMPILE_OPTS_OPENSSL3" == "1" ]]; then export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" @@ -261,6 +262,7 @@ function brew_install_rvm_libs() { # https://github.com/postmodern/ruby-install/blob/master/share/ruby-install/ruby/dependencies.txt#L5 if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then grep -q 'rust' Brewfile || echo "brew 'rust'" >> Brewfile + grep -q 'rustup-init' Brewfile || echo "brew 'rustup-init'" >> Brewfile fi # Note: Beware of CVE-2024-3094 # Cannot lock version due to https://github.com/Homebrew/homebrew-bundle/issues/547#issuecomment-525443604 From dae365faac06ff3f14cc3d101bfd131b6809de5d Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 00:24:53 -0600 Subject: [PATCH 27/34] bootstrap.sh: Enable jemalloc for RVM ruby 3.1.2 --- bootstrap-scripts/bootstrap.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 3df6c142..95c46dda 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -182,6 +182,11 @@ function rvm_set_compile_opts() { export CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-yjit" rustup default stable-${machine}-apple-darwin fi + if [[ "$RVM_WITH_JEMALLOC" == "1" ]]; then + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc" + export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/jemalloc/lib/pkgconfig:${PKG_CONFIG_PATH}" + export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc-dir=$(pkg-config --variable=prefix jemalloc)" + fi if [[ "$RVM_COMPILE_OPTS_OPENSSL3" == "1" ]]; then export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" fi @@ -264,6 +269,9 @@ function brew_install_rvm_libs() { grep -q 'rust' Brewfile || echo "brew 'rust'" >> Brewfile grep -q 'rustup-init' Brewfile || echo "brew 'rustup-init'" >> Brewfile fi + if [[ "$RVM_WITH_JEMALLOC" == "1" ]]; then + grep -q 'jemalloc' Brewfile || echo "brew 'jemalloc'" >> Brewfile + fi # Note: Beware of CVE-2024-3094 # Cannot lock version due to https://github.com/Homebrew/homebrew-bundle/issues/547#issuecomment-525443604 # So, we must rely on the Homebrew community to not push the new versions until it's been vetted @@ -410,7 +418,8 @@ detect_platform_version case $platform_version in 12.*) XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1; - BREW_INSTALL_OPENSSL3=1 ; RVM_COMPILE_OPTS_OPENSSL3=1 ; RVM_ENABLE_YJIT=1 ; + BREW_INSTALL_OPENSSL3=1 ; RVM_COMPILE_OPTS_OPENSSL3=1 ; + RVM_ENABLE_YJIT=1 ; RVM_WITH_JEMALLOC=1 ; BREW_INSTALL_READLINE=1 ; RVM_COMPILE_OPTS_READLINE=1 ; BREW_INSTALL_NCURSES=1 ; RVM_COMPILE_OPTS_NCURSES=1 ; BREW_INSTALL_LIBYAML=1 ; RVM_COMPILE_OPTS_LIBYAML=1 ; From f3445dd33ac36635f416fa63109105523866f0f4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:57:53 +0000 Subject: [PATCH 28/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- bootstrap-scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 95c46dda..7ffe7afd 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -417,7 +417,7 @@ detect_platform_version # https://developer.apple.com/downloads/index.action case $platform_version in 12.*) - XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1; + XCODE_DMG='Xcode_14.3.1.xip'; export TRY_XCI_OSASCRIPT_FIRST=1; BREW_INSTALL_LIBFFI=1; RVM_COMPILE_OPTS_M1_LIBFFI=1; BREW_INSTALL_OPENSSL3=1 ; RVM_COMPILE_OPTS_OPENSSL3=1 ; RVM_ENABLE_YJIT=1 ; RVM_WITH_JEMALLOC=1 ; BREW_INSTALL_READLINE=1 ; RVM_COMPILE_OPTS_READLINE=1 ; From a29b4ccca7e0a6ce06f7a6d71c351309185f2ff6 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 17:29:24 -0600 Subject: [PATCH 29/34] bootstrap.sh: Fix SC2155 & only export defined RVM compilation vars Shellcheck warnings were: In bootstrap-scripts/bootstrap.sh line 188: export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc-dir=$(pkg-config --variable=prefix jemalloc)" ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In bootstrap-scripts/bootstrap.sh line 191: export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In bootstrap-scripts/bootstrap.sh line 224: export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-readline-dir=$(pkg-config --variable=prefix readline)" ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In bootstrap-scripts/bootstrap.sh line 230: export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-ncurses-dir=$(pkg-config --variable=prefix ncurses)" ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In bootstrap-scripts/bootstrap.sh line 237: export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libyaml-dir=$(pkg-config --variable=prefix yaml-0.1)" ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In bootstrap-scripts/bootstrap.sh line 243: export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libksba-dir=$(pkg-config --variable=prefix ksba)" ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. --- bootstrap-scripts/bootstrap.sh | 51 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 7ffe7afd..10f5ffc1 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -170,7 +170,7 @@ function check_sprout_locked_ruby_versions() { function rvm_set_compile_opts() { turn_trace_on_if_was_on - local opt_dir + local opt_dir rvm_patch_args # Disable installing RI docs for speed cat > "${HOME}/.gemrc" <<-EOF @@ -179,23 +179,23 @@ function rvm_set_compile_opts() { EOF if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-yjit" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-yjit" rustup default stable-${machine}-apple-darwin fi if [[ "$RVM_WITH_JEMALLOC" == "1" ]]; then - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc" - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/jemalloc/lib/pkgconfig:${PKG_CONFIG_PATH}" - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc-dir=$(pkg-config --variable=prefix jemalloc)" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc" + PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/jemalloc/lib/pkgconfig:${PKG_CONFIG_PATH}" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc-dir=$(pkg-config --variable=prefix jemalloc)" fi if [[ "$RVM_COMPILE_OPTS_OPENSSL3" == "1" ]]; then - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl-dir=$(brew --prefix openssl@3)" fi if [[ "$RVM_COMPILE_OPTS_M1_LIBFFI" == "1" ]]; then - export optflags="-Wno-error=implicit-function-declaration" - export LDFLAGS="-L${HOMEBREW_PREFIX}/opt/libffi/lib" - export DLDFLAGS="-L${HOMEBREW_PREFIX}/opt/libffi/lib" - export CPPFLAGS="-I${HOMEBREW_PREFIX}/opt/libffi/include" - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libffi/lib/pkgconfig:${PKG_CONFIG_PATH}" + optflags="-Wno-error=implicit-function-declaration" + LDFLAGS="-L${HOMEBREW_PREFIX}/opt/libffi/lib" + DLDFLAGS="-L${HOMEBREW_PREFIX}/opt/libffi/lib" + CPPFLAGS="-I${HOMEBREW_PREFIX}/opt/libffi/include" + PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libffi/lib/pkgconfig:${PKG_CONFIG_PATH}" # Escape from current Gemfile.lock bundler version restriction for bootstrap # NOTE: This could cause problems in the future, b/c # we depend on system bundler to write ~/.bundle/config here @@ -206,7 +206,7 @@ function rvm_set_compile_opts() { if [[ "$RVM_COMPILE_OPTS_M1_NOKOGIRI" == "1" && "$machine" == "arm64" ]]; then bash -c 'cd /tmp/ && bundle config build.nokogiri --platform=ruby -- --use-system-libraries' elif [[ "$RVM_COMPILE_OPTS_NOKOGIRI_DEPS" == "1" ]]; then - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libxslt/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/libxml2/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/zlib/lib/pkgconfig:${PKG_CONFIG_PATH}" + PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libxslt/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/libxml2/lib/pkgconfig:${HOMEBREW_PREFIX}/opt/zlib/lib/pkgconfig:${PKG_CONFIG_PATH}" local nokogiri_dep_configure_flags=( "--with-xslt-dir=$(pkg-config --variable=prefix libxslt )" "--with-iconv-dir=$(brew --prefix libiconv )" @@ -220,27 +220,27 @@ function rvm_set_compile_opts() { fi if [[ "$RVM_COMPILE_OPTS_READLINE" ]]; then - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/readline/lib/pkgconfig:${PKG_CONFIG_PATH}" - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-readline-dir=$(pkg-config --variable=prefix readline)" + PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/readline/lib/pkgconfig:${PKG_CONFIG_PATH}" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-readline-dir=$(pkg-config --variable=prefix readline)" opt_dir="$(pkg-config --variable=prefix readline):${opt_dir}" fi if [[ "$RVM_COMPILE_OPTS_NCURSES" ]]; then - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/ncurses/lib/pkgconfig:${PKG_CONFIG_PATH}" - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-ncurses-dir=$(pkg-config --variable=prefix ncurses)" + PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/ncurses/lib/pkgconfig:${PKG_CONFIG_PATH}" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-ncurses-dir=$(pkg-config --variable=prefix ncurses)" fi if [[ "$RVM_COMPILE_OPTS_LIBYAML" ]]; then - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libyaml/lib/pkgconfig:${PKG_CONFIG_PATH}" + PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libyaml/lib/pkgconfig:${PKG_CONFIG_PATH}" # Note: The pkg-config .pc file is named: yaml-0.1.pc # This may be a Homebrew packaging error, so if it changes, we could switch to using: brew --prefix libyaml - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libyaml-dir=$(pkg-config --variable=prefix yaml-0.1)" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libyaml-dir=$(pkg-config --variable=prefix yaml-0.1)" opt_dir="$(pkg-config --variable=prefix yaml-0.1):${opt_dir}" fi if [[ "$RVM_COMPILE_OPTS_LIBKSBA" ]]; then - export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libksba/lib/pkgconfig:${PKG_CONFIG_PATH}" + PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/libksba/lib/pkgconfig:${PKG_CONFIG_PATH}" # Note: This pkg-config .pc file is named: ksba.pc - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libksba-dir=$(pkg-config --variable=prefix ksba)" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libksba-dir=$(pkg-config --variable=prefix ksba)" fi # Optional Ruby Std-lib dependency # See: https://ruby-doc.org/stdlib-1.9.3/libdoc/gdbm/rdoc/GDBM.html @@ -249,16 +249,21 @@ function rvm_set_compile_opts() { fi if [[ "$RVM_COMPILE_OPTS_PATCH_AUTOCONF_FUNC_NAME_STRING" == "1" ]]; then - export RVM_PATCH_ARGS="--patch ${REPO_BASE}/bootstrap-scripts/patches/ruby-3.1.2-configure.ac.patch" + rvm_patch_args="--patch ${REPO_BASE}/bootstrap-scripts/patches/ruby-3.1.2-configure.ac.patch" fi if [ -n "$opt_dir" ]; then - export CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-opt-dir=${opt_dir}" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-opt-dir=${opt_dir}" fi if [ -n "$CONFIGURE_ARGS" ]; then - export CONFIGURE_ARGS="${RVM_PATCH_ARGS} -C ${CONFIGURE_ARGS}" + CONFIGURE_ARGS="${rvm_patch_args} -C ${CONFIGURE_ARGS}" fi + + for _var in PKG_CONFIG_PATH CONFIGURE_ARGS LDFLAGS DLDFLAGS CPPFLAGS optflags ; do + [ -n "$(eval echo -n \$$_var)" ] && export ${_var} + done + turn_trace_off } From 71c1d70bfc7be443ffd73b0e61f0aa34f1249d39 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 19:13:19 -0600 Subject: [PATCH 30/34] bootstrap.sh: Ignore SC2317 shellcheck warning Shellcheck warnings were: In bootstrap-scripts/bootstrap.sh line 125: echo "Killing $timeout_loop_PID due to trap" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In bootstrap-scripts/bootstrap.sh line 126: kill -TERM $timeout_loop_PID ^--------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill -TERM "$timeout_loop_PID" In bootstrap-scripts/bootstrap.sh line 127: sudo -K ^-----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). --- bootstrap-scripts/bootstrap.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 10f5ffc1..ff772852 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -121,6 +121,8 @@ prevent_sudo_timeout() { } # Kill sudo timestamp refresh PID and invalidate sudo timestamp +# Don't warn about unreachable commands in this function (triggered by trap) +# shellcheck disable=SC2317 kill_timeout_loop() { echo "Killing $timeout_loop_PID due to trap" kill -TERM $timeout_loop_PID From 4a909f964386f5555feb3e460cb3e11a6772eb38 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 19:15:57 -0600 Subject: [PATCH 31/34] bootstrap.sh: Fix SC2163 - null var check already done so silence it This parameter expansion, `${foo?}`, will return error if `${_var}` is null or unset... but we already check that before exporting the variable name contained in `${_var}`. Shellcheck is trying to be helpful, but we actually want to export the variable contained in `$_var`, not just `$_var` itself. Shellcheck warning was: In bootstrap-scripts/bootstrap.sh line 266: [ -n "$(eval echo -n \$$_var)" ] && export ${_var} ^-----^ SC2163 (warning): This does not export '_var'. Remove $/${} for that, or use ${var?} to quiet. --- bootstrap-scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index ff772852..e06a40e0 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -263,7 +263,7 @@ function rvm_set_compile_opts() { fi for _var in PKG_CONFIG_PATH CONFIGURE_ARGS LDFLAGS DLDFLAGS CPPFLAGS optflags ; do - [ -n "$(eval echo -n \$$_var)" ] && export ${_var} + [ -n "$(eval echo -n \$$_var)" ] && export ${_var?} done turn_trace_off From d61ea41415c9eaf7842a40d353b7c0a14ecdae81 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 20:01:14 -0600 Subject: [PATCH 32/34] bootstrap.sh: Fix SC2086 Shellcheck warnings were: In bootstrap-scripts/bootstrap.sh line 544: lsof -p $clt_pid +r 1 &>/dev/null ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: lsof -p "$clt_pid" +r 1 &>/dev/null --- bootstrap-scripts/bootstrap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index e06a40e0..3d083c26 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -528,7 +528,7 @@ if [[ "$TRY_XCI_OSASCRIPT_FIRST" == '1' ]]; then if [ ! -d /Library/Developer/CommandLineTools ]; then xcode-select --install # Wait for CLT Installer App starts & grab PID - while ! clt_pid=$(pgrep -f 'Install Command Line Developer Tools.app' 2>/dev/null) ; do + while ! clt_pid=$(pgrep -f 'Install Command Line Developer Tools.app' 2>/dev/null | head -n1) ; do sleep 1 done osascript <<-EOD @@ -541,7 +541,7 @@ if [[ "$TRY_XCI_OSASCRIPT_FIRST" == '1' ]]; then EOD # Wait for CLT to be fully installed before continuing # wait for non-child PID (Darwin) - lsof -p $clt_pid +r 1 &>/dev/null + lsof -p "$clt_pid" +r 1 &>/dev/null else echo "INFO: Found /Library/Developer/CommandLineTools already existing. skipping..." fi From d2b40f6c55c9ea5ead0f8151985d9bf514359a52 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 20:03:09 -0600 Subject: [PATCH 33/34] bootstrap.sh: Ignore SC2086 for CONFIGURE_ARGS We want to split on spaces, because we are building a command line --- bootstrap-scripts/bootstrap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index 3d083c26..d8848ac3 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -338,6 +338,7 @@ function rvm_install_ruby_and_gemset() { # N.B.: Use a subshell for rvm functions, so that our kill_timeout_loop is not inherited ( source_rvm + # shellcheck disable=SC2086 rvm install "ruby-${sprout_ruby_version}" ${CONFIGURE_ARGS} rvm use "ruby-${sprout_ruby_version}" rvm gemset create "$sprout_ruby_gemset" From ce76d99f73973aca9fd1b0ab5ffe9b975ff71857 Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Tue, 16 Jul 2024 20:05:33 -0600 Subject: [PATCH 34/34] bootstrap.sh: Fix more SC2086 warnings Just quote the things Shellcheck warnings were: In bootstrap-scripts/bootstrap.sh line 128: kill -TERM $timeout_loop_PID ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill -TERM "$timeout_loop_PID" In bootstrap-scripts/bootstrap.sh line 185: rustup default stable-${machine}-apple-darwin ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rustup default stable-"${machine}"-apple-darwin --- bootstrap-scripts/bootstrap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-scripts/bootstrap.sh b/bootstrap-scripts/bootstrap.sh index d8848ac3..722a2588 100755 --- a/bootstrap-scripts/bootstrap.sh +++ b/bootstrap-scripts/bootstrap.sh @@ -125,7 +125,7 @@ prevent_sudo_timeout() { # shellcheck disable=SC2317 kill_timeout_loop() { echo "Killing $timeout_loop_PID due to trap" - kill -TERM $timeout_loop_PID + kill -TERM "$timeout_loop_PID" sudo -K } trap kill_timeout_loop EXIT HUP TSTP QUIT SEGV TERM INT ABRT # trap all common terminate signals @@ -182,7 +182,7 @@ function rvm_set_compile_opts() { if [[ "$RVM_ENABLE_YJIT" == "1" ]]; then CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-yjit" - rustup default stable-${machine}-apple-darwin + rustup default "stable-${machine}-apple-darwin" fi if [[ "$RVM_WITH_JEMALLOC" == "1" ]]; then CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jemalloc"