Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]CHEF-12767 Upgrade oc-id to use ruby 3.4 #3967

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .expeditor/automate_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ export HAB_STUDIO_SECRET_HAB_FEAT_IGNORE_LOCAL=false
export HAB_FEAT_IGNORE_LOCAL=false
export HAB_STUDIO_HOST_ARCH=x86_64-linux
export HAB_FEAT_OFFLINE_INSTALL=true
export HAB_BLDR_CHANNEL: "LTS-2024"

curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash

sudo -E hab pkg install core/ruby
sudo -E hab pkg install core/ruby31/3.1.6/20240912144513
export PATH
PATH="$(hab pkg path core/ruby)/bin:$PATH"
sudo -E "$(hab pkg path core/ruby)"/bin/gem install toml
PATH="$(hab pkg path core/ruby31)/bin:$PATH"
sudo -E "$(hab pkg path core/ruby31)"/bin/gem install toml

export JOB_TEMP_ROOT
JOB_TEMP_ROOT=$(mktemp -d /tmp/job-root-XXXXXX)
Expand Down Expand Up @@ -75,7 +76,7 @@ HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CA
.expeditor/create-manifest.rb
mv manifest.json results/build.json

HAB_PKG_CHANNEL=unstable NO_PIN_HAB=true .expeditor/create-manifest.rb
HAB_PKG_CHANNEL=LTS-2024 NO_PIN_HAB=true .expeditor/create-manifest.rb
mv manifest.json results/build-habdev.json

echo "after build" `ls -l results`
Expand Down
13 changes: 13 additions & 0 deletions .expeditor/build.habitat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
---
env:
HAB_BLDR_CHANNEL: "LTS-2024"
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "LTS-2024"
HAB_FALLBACK_CHANNEL: "LTS-2024"

origin: chef
smart_build: false
studio_secrets:
HAB_BLDR_CHANNEL:
value: "LTS-2024"
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL:
value: "LTS-2024"
HAB_FALLBACK_CHANNEL:
value: "LTS-2024"


1 change: 1 addition & 0 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,4 @@ artifact_channels:
- unstable
- current
- stable
- LTS-2024
4 changes: 2 additions & 2 deletions .expeditor/create_manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_latest(channel, origin, name)
def get_hab_deps_latest()
ret = {}
["hab", "hab-sup", "hab-launcher"].each do |name|
d = get_latest("stable", "core", name)
d = get_latest("LTS-2024", "core", name)
ret[name] = "#{d["origin"]}/#{d["name"]}/#{d["version"]}/#{d["release"]}"
end
ret
Expand Down Expand Up @@ -78,7 +78,7 @@ def get_hab_deps_latest()
# that were part of the build group. Pulling from unstable means
# that we might include packages that were built as part of an
# ad-hoc run of the pipeline or a concurrently running build.
latest_release = get_latest("unstable", pkg_origin, pkg_name)
latest_release = get_latest("LTS-2024", pkg_origin, pkg_name)

pkg_version = latest_release["version"]
pkg_release = latest_release["release"]
Expand Down
5 changes: 4 additions & 1 deletion .expeditor/license_scout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ bundle_install_dirs=(
for dir in "${bundle_install_dirs[@]}"; do
echo "--- Installing gem dependencies for $dir"
pushd "src/$dir"
bundle install --jobs=3 --retry=3 --path=/workdir/vendor/bundle
bundle config set jobs 3
bundle config set retry 3
bundle config set path "/workdir/vendor/bundle"
bundle install
popd
done

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/brakeman-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
ruby-version: '3.1.6'

- name: Setup Brakeman
env:
Expand Down
4 changes: 2 additions & 2 deletions .license_scout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ habitat:
- origin: chef
channel: unstable
- origin: core
channel: stable
channel: LTS-2024

allowed_licenses:
- Apache-1.0
Expand Down Expand Up @@ -205,7 +205,7 @@ exceptions:
reason: Exception made by Chef Legal
- name: core/rsync
reason: Exception made by Chef Legal
- name: core/ruby
- name: core/ruby31/3.1.6/20240912144513
reason: Exception made by Chef Legal
- name: core/sed
reason: Exception made by Chef Legal
Expand Down
2 changes: 1 addition & 1 deletion scripts/bk_tests/bk_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ asdf local erlang 24.3.2
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell

echo "Installing Bundler"
gem install bundler --version '~> 1.17' --no-document
gem install bundler --version '~> 2.1' --no-document

echo "Installing Lua"
export LUALIB=~/.luarocks/lib/lua/5.2
Expand Down
5 changes: 3 additions & 2 deletions src/oc-id/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,12 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.6.2)
sqlite3 (2.0.0)
mini_portile2 (~> 2.8.0)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
sslshake (1.3.1)
stringio (3.0.6)
stringio (3.1.2)
strings (0.2.1)
strings-ansi (~> 0.2)
unicode-display_width (>= 1.5, < 3.0)
Expand Down
12 changes: 8 additions & 4 deletions src/oc-id/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ pkg_origin=chef
pkg_maintainer="The Chef Server Maintainers <support@chef.io>"
pkg_license=('Apache-2.0')
pkg_deps=(
core/sqitch_pg
core/sqitch
core/postgresql17-client
core/curl
core/node14
core/ruby31/3.1.6/20240912144513
core/node
core/ruby3_4
core/rsync
core/sed
core/libffi
Expand Down Expand Up @@ -102,7 +103,10 @@ do_install() {
--with-xml2-lib=$(pkg_path_for core/libxml2)/lib \
--with-xslt-include=$(pkg_path_for core/libxslt)/include/libxslt \
--with-xslt-lib=$(pkg_path_for core/libxslt)/lib
bundle install --path "${HOME}/vendor/bundle" --binstubs="${HOME}/bin" --shebang ruby --deployment
bundle config set path "${HOME}/vendor/bundle"
bundle config set deployment 'true'
bundle config set --local shebang 'ruby'
bundle install --binstubs="${HOME}/bin"
# fix tzdata location
echo "Adding core/tzdata zoneinfo search path to tzinfo gem"
grep -l DEFAULT_SEARCH_PATH $HOME/vendor/bundle/ruby/*/gems/tzinfo*/lib/tzinfo/zoneinfo_data_source.rb | while read -r f; do
Expand Down
Loading