Skip to content

ruby 3x support #521

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:

- run:
name: start docker-compose build environment
command: |
sudo ./test/bin/setup_volume_permissions.sh
command: |
export ruby_version=<< parameters.ruby_version >>
sudo -E ./test/bin/setup_volume_permissions.sh
docker-compose up -d
echo "Waiting for containers to start..."
sleep 10
Expand Down Expand Up @@ -173,6 +174,7 @@ workflows:
- '2.5'
- '2.6'
- '2.7'
- '3.0'

- test_windows:
matrix:
Expand All @@ -181,3 +183,4 @@ workflows:
- '2.5'
- '2.6'
- '2.7'
- '3.0'
10 changes: 10 additions & 0 deletions clean_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# stop local dockerized development environment and clean build files

set -x
set +e

docker compose down

sudo rm ./Gemfile.lock
sudo rm -rf ./tmp
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ networks:

services:
mssql:
image: metaskills/mssql-server-linux-tinytds:2017-GA
image: mcr.microsoft.com/mssql/server:2022-RTM-ubuntu-20.04
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the pro/con on this tag vs a more generic one, such as 2022-latest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, i wondered if you had any thoughts about this

mssql 2022 came out this month. do you have a preference for 2022 or to stay on 2019-latest?

i suppose as long as 2022-latest passes everything, i don't see a reason not to test on it.

container_name: sqlserver
environment:
ACCEPT_EULA: Y
Expand All @@ -21,7 +21,7 @@ services:
network_mode: "host"

cimgruby:
image: cimg/ruby:2.7.0
image: cimg/ruby:${ruby_version}
container_name: cimg_ruby
environment:
TESTOPTS: '-v'
Expand Down
13 changes: 11 additions & 2 deletions start_dev.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#!/usr/bin/env bash
# will spin up a local dockerized development environment

set -x
set -e

if [ -z "$ruby_version" ]
then
echo "set a value for environment variable ruby_version"
exit 1
else
echo "ruby_version is $ruby_version"
fi

# set volume read/write permissions to work both outside and inside container
sudo ./test/bin/setup_volume_permissions.sh
sudo -E ./test/bin/setup_volume_permissions.sh

docker-compose up -d
docker compose up -d
echo "Waiting for containers to start..."
sleep 10

Expand Down
2 changes: 1 addition & 1 deletion tasks/native_gem.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ task 'gem:windows' => ['ports:cross'] do
build = ['bundle']

# and finally build the native gem
build << 'rake cross native gem RUBY_CC_VERSION=2.7.0:2.6.0:2.5.0:2.4.0 CFLAGS="-Wall" MAKE="make -j`nproc`"'
build << 'rake cross native gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0 CFLAGS="-Wall" MAKE="make -j`nproc`"'

RakeCompilerDock.sh build.join(' && ')
end
1 change: 0 additions & 1 deletion tasks/test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ Rake::TestTask.new do |t|
t.test_files = FileList['test/**/*_test.rb']
t.verbose = true
end

21 changes: 16 additions & 5 deletions test/bin/setup_volume_permissions.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
#!/usr/bin/env bash
# grants circlci docker uid and gid required write permissions to project file system

set -x

sudo groupadd -g 3434 circleci_tinytds
sudo usermod -a -G circleci_tinytds $USER
sudo useradd circleci_tinytds -u 3434 -g 3434
sudo usermod -a -G circleci_tinytds circleci_tinytds
sudo chgrp -R circleci_tinytds .
if $(dpkg --compare-versions $ruby_version lt 3.1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, all of this is a bit confusing. Is it to prepare for Ruby 3.1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was from the 3.1 work, yes. circleci changed the permissions in their container. i will stash this change for a future commit

then
sudo groupadd -g 3434 circleci_tinytds30
sudo useradd circleci_tinytds30 -u 3434 -g 3434
sudo usermod -a -G circleci_tinytds30 circleci_tinytds30
sudo usermod -a -G circleci_tinytds30 $USER
sudo chgrp -R circleci_tinytds30 .
else
sudo groupadd -g 1002 circleci_tinytds31
sudo useradd circleci_tinytds31 -u 1001 -g 1002
sudo usermod -a -G circleci_tinytds31 circleci_tinytds31
sudo usermod -a -G circleci_tinytds31 $USER
sudo chgrp -R circleci_tinytds31 .
fi

sudo chmod -R g+rwx .