Skip to content

Commit

Permalink
Merge pull request #1613 from MSP-Greg/appveyor-update-2018-07
Browse files Browse the repository at this point in the history
appveyor.yml - fix casing, OpenSSL 1.1.0h, convert to ps
  • Loading branch information
schneems committed Jul 15, 2018
2 parents f7e1e58 + 712618a commit b623c03
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 80 deletions.
127 changes: 64 additions & 63 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,97 @@
# cache cleanup 2018-03-16

init:
- set PATH=C:\ruby%ruby_version%\bin;C:\Program Files\7-Zip;C:\Program Files\AppVeyor\BuildAgent;C:\Program Files\Git\cmd;C:\Windows\system32
- set PATH=C:\Ruby%ruby_version%\bin;C:\Program Files\7-Zip;C:\Program Files\AppVeyor\BuildAgent;C:\Program Files\Git\cmd;C:\Windows\system32
# Download current trunk, install OpenSSL via trunk_pkgs.cmd file
- if %ruby_version%==_trunk (
appveyor DownloadFile https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z -FileName C:\ruby_trunk.7z &
7z x C:\ruby_trunk.7z -oC:\ruby_trunk &
C:\ruby_trunk\trunk_pkgs.cmd
)
- ps: >-
if ($env:ruby_version -eq '_trunk') {
$trunk_uri = 'https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z'
(New-Object Net.WebClient).DownloadFile($trunk_uri, 'C:\ruby_trunk.7z')
7z.exe x C:\ruby_trunk.7z -oC:\Ruby_trunk
}
install:
# Install ragel
- if "%ri_file%"=="x64_2" ( C:\msys64\usr\bin\pacman -S --noconfirm mingw-w64-x86_64-ragel )
- if "%ri_file%"=="x86_2" ( C:\msys64\usr\bin\pacman -S --noconfirm mingw-w64-i686-ragel )

# Install ragel & download RI OpenSSL Knapsack package
# RI DevKit is only installed in Ruby23 and Ruby23-x64 folders
# RI2 MSYS2/MinGW OpenSSL package is standard Appveyor item
- if "%ri_file%"=="x86" (
appveyor DownloadFile https://dl.bintray.com/oneclick/OpenKnapsack/x86/openssl-1.0.2j-x86-windows.tar.lzma &
7z e openssl-1.0.2j-x86-windows.tar.lzma &
7z x -y openssl-1.0.2j-x86-windows.tar -oC:\ruby23\DevKit\mingw &
set b_config="--with-ssl-dir=C:/ruby23/DevKit/mingw --with-opt-include=C:/ruby23/DevKit/mingw/include" &
set SSL_CERT_FILE=C:/ruby24-x64/ssl/cert.pem &
C:\msys64\usr\bin\pacman -S --noconfirm mingw-w64-i686-ragel &
set PATH=%PATH%;C:\msys64\ming32\bin
)
- if "%ri_file%"=="x64" (
appveyor DownloadFile https://dl.bintray.com/oneclick/OpenKnapsack/x64/openssl-1.0.2j-x64-windows.tar.lzma &
7z e openssl-1.0.2j-x64-windows.tar.lzma &
7z x -y openssl-1.0.2j-x64-windows.tar -oC:\ruby23-x64\DevKit\mingw &
set b_config="--with-ssl-dir=C:/ruby23-x64/DevKit/mingw --with-opt-include=C:/ruby23-x64/DevKit/mingw/include" &
set SSL_CERT_FILE=C:/ruby24-x64/ssl/cert.pem &
C:\msys64\usr\bin\pacman -S --noconfirm mingw-w64-x86_64-ragel &
set PATH=%PATH%;C:\msys64\ming64\bin
)
- RAKEOPT:
- ps: >-
if ($env:ri_file -lt 'x86') {
C:\msys64\usr\bin\pacman -S --noconfirm --noprogressbar mingw-w64-x86_64-ragel
} else {
C:\msys64\usr\bin\pacman -S --noconfirm --noprogressbar mingw-w64-i686-ragel
}
# For RI builds, set SSL_CERT_FILE & add path for ragel
- ps: >-
if ($env:ruby_version -lt '24') {
$env:SSL_CERT_FILE = C:/Ruby25-x64/ssl/cert.pem
$env:path += ";C:\msys64\ming32\bin;"
}
# Download RubyInstaller OpenSSL Knapsack packages
# DevKit is installed in Ruby23 and Ruby23-x64 folders
- ps: >-
if ($env:ri_file -eq "x86") {
appveyor DownloadFile https://dl.bintray.com/oneclick/OpenKnapsack/x86/openssl-1.0.2j-x86-windows.tar.lzma
7z e openssl-1.0.2j-x86-windows.tar.lzma
7z x -y openssl-1.0.2j-x86-windows.tar -oC:\ruby23\DevKit\mingw\i686-w64-mingw32
# $env:b_config = "--with-ssl-dir=C:/Ruby23/DevKit/mingw --with-opt-include=C:/Ruby23/DevKit/mingw/include"
} elseif ($env:ri_file -eq "x64") {
appveyor DownloadFile https://dl.bintray.com/oneclick/OpenKnapsack/x64/openssl-1.0.2j-x64-windows.tar.lzma
7z e openssl-1.0.2j-x64-windows.tar.lzma
7z x -y openssl-1.0.2j-x64-windows.tar -oC:\ruby23-x64\DevKit\mingw\x86_64-w64-mingw32
# $env:b_config = "--with-ssl-dir=C:/Ruby23-x64/DevKit/mingw --with-opt-include=C:/Ruby23-x64/DevKit/mingw/include"
}
- RAKEOPT:
- APPVEYOR: true
- ruby --version
- gem --version
- bundle --version
- bundle install --without documentation --path C:/av_bundle

# Download & install current OpenSSL package for later RubyInstaller2 version(s)
- if %ruby_version%==25-x64 (
set openssl=mingw-w64-x86_64-openssl-1.1.0.g-1-any.pkg.tar.xz
)
- if %ruby_version%==25 (
set openssl=mingw-w64-i686-openssl-1.1.0.g-1-any.pkg.tar.xz
)
- set dl_uri=https://dl.bintray.com/msp-greg/ruby_trunk
- if %ruby_version%==25-x64 (
C:\msys64\usr\bin\bash -lc "pacman-key -r 77D8FA18 --keyserver na.pool.sks-keyservers.net && pacman-key -f 77D8FA18 && pacman-key --lsign-key 77D8FA18" &
appveyor DownloadFile %dl_uri%/%openssl% -FileName C:\%openssl% &
appveyor DownloadFile %dl_uri%/%openssl%.sig -FileName C:\%openssl%.sig &
C:\msys64\usr\bin\pacman -Rdd --noconfirm mingw-w64-x86_64-openssl &
C:\msys64\usr\bin\pacman -Udd --noconfirm --force C:\%openssl%
)
- if %ruby_version%==25 (
C:\msys64\usr\bin\bash -lc "pacman-key -r 77D8FA18 --keyserver na.pool.sks-keyservers.net && pacman-key -f 77D8FA18 && pacman-key --lsign-key 77D8FA18" &
appveyor DownloadFile %dl_uri%/%openssl% -FileName C:\%openssl% &
appveyor DownloadFile %dl_uri%/%openssl%.sig -FileName C:\%openssl%.sig &
C:\msys64\usr\bin\pacman -Rdd --noconfirm mingw-w64-686-openssl &
C:\msys64\usr\bin\pacman -Udd --noconfirm --force C:\%openssl%
)
# Download & install current OpenSSL package for later RubyInstaller2/MSYS2 versions
- ps: >-
if ($env:ruby_version -ge '25' -or $env:ruby_version -eq '_trunk') {
if ($env:ruby_version -eq '25-x64' -or $env:ruby_version -eq '_trunk') {
$openssl = "mingw-w64-x86_64-openssl"
$dl_uri = "https://dl.bintray.com/msp-greg/ruby_trunk/"
$key = "77D8FA18"
} elseif ($env:ruby_version -eq '25') {
$openssl = "mingw-w64-i686-openssl"
$dl_uri = "https://dl.bintray.com/larskanis/rubyinstaller2-packages/"
$key = "BE8BF1C5"
}
Appveyor-Retry C:\msys64\usr\bin\bash.exe -lc "pacman-key -r $key --keyserver hkp://pool.sks-keyservers.net && pacman-key -f $key && pacman-key --lsign-key $key" 2> $null
C:\msys64\usr\bin\pacman.exe -Rdd --noconfirm --noprogressbar $openssl
$openssl += "-1.1.0.h-1-any.pkg.tar.xz"
$dl_uri += $openssl
$wc = $(New-Object System.Net.WebClient)
$wc.DownloadFile($dl_uri , "C:\$openssl")
$wc.DownloadFile("$dl_uri.sig", "C:\$openssl.sig")
C:\msys64\usr\bin\pacman.exe -Udd --noconfirm --noprogressbar --force C:\$openssl
$env:b_config = "--use-system-libraries"
}
build_script:
- bundle exec rake -rdevkit compile -- %b_config%

test_script:
# clear path to test with ruby packaged dll's
- set PATH=C:\Ruby%ruby_version%\bin;C:\Program Files\7-Zip;C:\Program Files\AppVeyor\BuildAgent;C:\Program Files\Git\cmd;C:\Windows\system32
- set OPENSSL_DIR=
- bundle exec rake -rdevkit test TESTOPTS="--verbose"
- bundle exec rake test TESTOPTS="--verbose"

on_finish:
- ruby -v
- ruby -v

environment:
matrix:
- ruby_version: _trunk
b_config: "--use-system-libraries"
ri_file: x64_2
- ruby_version: 25
b_config: "--use-system-libraries"
ri_file: x86_2
- ruby_version: 25-x64
b_config: "--use-system-libraries"
ri_file: x64_2
- ruby_version: 24
b_config: "--use-system-libraries"
ri_file: x86_2
- ruby_version: 24-x64
b_config: "--use-system-libraries"
ri_file: x64_2
- ruby_version: 23
ri_file: x86
Expand Down
17 changes: 8 additions & 9 deletions lib/puma/binder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,34 +90,32 @@ def parse(binds, logger)
case uri.scheme
when "tcp"
if fd = @inherited_fds.delete(str)
logger.log "* Inherited #{str}"
io = inherit_tcp_listener uri.host, uri.port, fd
logger.log "* Inherited #{str}"
elsif sock = @activated_sockets.delete([ :tcp, uri.host, uri.port ])
logger.log "* Activated #{str}"
io = inherit_tcp_listener uri.host, uri.port, sock
logger.log "* Activated #{str}"
else
params = Util.parse_query uri.query

opt = params.key?('low_latency')
bak = params.fetch('backlog', 1024).to_i

logger.log "* Listening on #{str}"
io = add_tcp_listener uri.host, uri.port, opt, bak
logger.log "* Listening on #{str}"
end

@listeners << [str, io] if io
when "unix"
path = "#{uri.host}#{uri.path}".gsub("%20", " ")

if fd = @inherited_fds.delete(str)
logger.log "* Inherited #{str}"
io = inherit_unix_listener path, fd
logger.log "* Inherited #{str}"
elsif sock = @activated_sockets.delete([ :unix, path ])
logger.log "* Activated #{str}"
io = inherit_unix_listener path, sock
logger.log "* Activated #{str}"
else
logger.log "* Listening on #{str}"

umask = nil
mode = nil
backlog = 1024
Expand All @@ -139,6 +137,7 @@ def parse(binds, logger)
end

io = add_unix_listener path, umask, mode, backlog
logger.log "* Listening on #{str}"
end

@listeners << [str, io]
Expand Down Expand Up @@ -204,11 +203,11 @@ def parse(binds, logger)
logger.log "* Inherited #{str}"
io = inherit_ssl_listener fd, ctx
elsif sock = @activated_sockets.delete([ :tcp, uri.host, uri.port ])
logger.log "* Activated #{str}"
io = inherit_ssl_listener sock, ctx
logger.log "* Activated #{str}"
else
logger.log "* Listening on #{str}"
io = add_ssl_listener uri.host, uri.port, ctx
logger.log "* Listening on #{str}"
end

@listeners << [str, io] if io
Expand Down
12 changes: 4 additions & 8 deletions test/test_pumactl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ def teardown
end

def find_open_port
begin
server = TCPServer.new("127.0.0.1", 0)
server.addr[1]
ensure
server.close
end
server = TCPServer.new("127.0.0.1", 0)
server.addr[1]
ensure
server.close
end

def test_config_file
Expand All @@ -32,8 +30,6 @@ def test_config_file
end

def test_control_url
skip if Puma.jruby? || Puma.windows?

host = "127.0.0.1"
port = find_open_port
url = "tcp://#{host}:#{port}/"
Expand Down

0 comments on commit b623c03

Please sign in to comment.