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

Add ENV['PUMA_NO_RUBOCOP'] to disable RuboCop install, add mswin ci #2881

Merged
merged 2 commits into from May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ragel.yml
Expand Up @@ -15,6 +15,8 @@ jobs:
ragel:
name: >-
ragel ${{ matrix.os }} ${{ matrix.ruby }}
env:
PUMA_NO_RUBOCOP: true

runs-on: ${{ matrix.os }}
if: |
Expand All @@ -40,7 +42,7 @@ jobs:
uses: actions/checkout@v3

- name: load ruby
uses: MSP-Greg/setup-ruby-pkgs@v1
uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: ragel
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yaml
Expand Up @@ -22,6 +22,7 @@ jobs:
env:
CI: true
TESTOPTS: -v
PUMA_NO_RUBOCOP: true

runs-on: ${{ matrix.os }}
if: |
Expand All @@ -36,6 +37,7 @@ jobs:
yjit: ['']
include:
- { os: windows-2022 , ruby: ucrt }
- { os: windows-2022 , ruby: mswin }
- { os: windows-2022 , ruby: 2.7 , no-ssl: ' no SSL' }
- { os: ubuntu-20.04 , ruby: head , yjit: ' yjit' }
- { os: ubuntu-20.04 , ruby: 2.7 , no-ssl: ' no SSL' }
Expand All @@ -59,7 +61,7 @@ jobs:
uses: actions/checkout@v3

- name: load ruby
uses: MSP-Greg/setup-ruby-pkgs@v1
uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: ragel
Expand Down Expand Up @@ -103,6 +105,7 @@ jobs:
env:
CI: true
TESTOPTS: -v
PUMA_NO_RUBOCOP: true

runs-on: ${{ matrix.os }}
if: |
Expand Down Expand Up @@ -133,14 +136,11 @@ jobs:
echo JAVA_HOME=$JAVA_HOME_11_X64 >> $GITHUB_ENV

- name: load ruby, ragel
uses: MSP-Greg/setup-ruby-pkgs@v1
uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: ragel
brew: ragel
mingw: _upgrade_ openssl ragel
# Use the bundler shipped with that ruby,
# temporary workaround for https://github.com/oracle/truffleruby/issues/2586
bundler: none
bundler-cache: true
timeout-minutes: 10
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -15,7 +15,9 @@ gem "sd_notify"

gem "jruby-openssl", :platform => "jruby"

gem "rubocop", "~> 0.64.0"
unless ENV['PUMA_NO_RUBOCOP'] || RUBY_PLATFORM.include?('mswin')
gem "rubocop", "~> 0.64.0"
end

if %w(2.2.7 2.2.8 2.2.9 2.2.10 2.3.4 2.4.1).include? RUBY_VERSION
gem "stopgap_13632", "~> 1.0", :platforms => ["mri", "mingw", "x64_mingw"]
Expand Down
11 changes: 7 additions & 4 deletions Rakefile
Expand Up @@ -2,17 +2,20 @@ require "bundler/setup"
require "rake/testtask"
require "rake/extensiontask"
require "rake/javaextensiontask"
require "rubocop/rake_task"
require_relative 'lib/puma/detect'
require 'rubygems/package_task'
require 'bundler/gem_tasks'

begin
# Add rubocop task
require "rubocop/rake_task"
RuboCop::RakeTask.new
rescue LoadError
end

gemspec = Gem::Specification.load("puma.gemspec")
Gem::PackageTask.new(gemspec).define

# Add rubocop task
RuboCop::RakeTask.new

# generate extension code using Ragel (C and Java)
desc "Generate extension code (C and Java) using Ragel"
task :ragel
Expand Down
2 changes: 2 additions & 0 deletions ext/puma_http11/extconf.rb
Expand Up @@ -14,6 +14,8 @@
found_ssl = if (!$mingw || RUBY_VERSION >= '2.4') && (t = pkg_config 'openssl')
puts 'using OpenSSL pkgconfig (openssl.pc)'
true
elsif have_library('libcrypto', 'BIO_read') && have_library('libssl', 'SSL_CTX_new')
true
Copy link
Member

Choose a reason for hiding this comment

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

Is this change related to this PR?

Copy link
Member Author

@MSP-Greg MSP-Greg May 19, 2022

Choose a reason for hiding this comment

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

This started as a PR about the mswin build, and it might be a bug in mkmf. The RuboCop ENV variable involved the same code, so I added it. An issue or PR mentioned the idea of having a way to skip RuboCop, but I couldn't find it.

But, almost all current OpenSSL implementations name the files 'libcrypto' and 'libssl'. Older installs did not. Older Windows OpenSSL used names 'libeay32' and 'ssleay32'. Anyway, it is needed for mswin, and most other builds use pkgconfig.

elsif %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')} &&
%w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')}
true
Expand Down