wreq 1.2.6-aarch64-linux → 1.2.7-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.cargo/config.toml +4 -0
- data/Rakefile +6 -0
- data/crates/wreq-util/README.md +1 -1
- data/docs/windows-gnu-tokio-crash.md +49 -3
- data/extconf.rb +4 -0
- data/lib/wreq_ruby/3.3/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/3.4/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/4.0/wreq_ruby.so +0 -0
- data/script/rust_env.rb +85 -0
- data/wreq.gemspec +1 -1
- metadata +4 -3
- data/script/build_windows_gnu.ps1 +0 -270
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9316db9e35fe5cfb70ebdf780a508df148eaee98239484d093b6b548fb7e3396
|
|
4
|
+
data.tar.gz: 2fc029910c849a41c069b0b6fd637ec3d13ae2a81eac22a081a361d0f1f6cbc0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83e817b5150d93ae1723aa17b506e04379f5989b8c4d1052c81ac2fe0aaf9acba3bd8e5fdffd70f7f9ffde31e71c92315d7951db6907ffe12e4f7972af8eb82d
|
|
7
|
+
data.tar.gz: c0d45f2c282bdf328b0dc66f238f3962d69541f070adbb32577d39f6d6bff8a57fbe2e2fa4ed91b861406102db200beaac9bd71d7aa63371e7ed1351d1531473
|
data/.cargo/config.toml
ADDED
data/Rakefile
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "script/rust_env"
|
|
4
|
+
|
|
5
|
+
# Cargo needs RubyInstaller's UCRT tools when Rake builds the native extension
|
|
6
|
+
# on Windows. Other platforms keep their existing native Cargo environment.
|
|
7
|
+
Wreq::RustEnv.activate
|
|
8
|
+
|
|
3
9
|
require "bundler/gem_tasks"
|
|
4
10
|
require "rake/testtask"
|
|
5
11
|
require "rb_sys/extensiontask"
|
data/crates/wreq-util/README.md
CHANGED
|
@@ -43,7 +43,7 @@ async fn main() -> wreq::Result<()> {
|
|
|
43
43
|
.build()?;
|
|
44
44
|
|
|
45
45
|
// Use the API you're already familiar with
|
|
46
|
-
let resp = client.get("https://
|
|
46
|
+
let resp = client.get("https://pingly.us.kg/api/all").send().await?;
|
|
47
47
|
println!("{}", resp.text().await?);
|
|
48
48
|
Ok(())
|
|
49
49
|
}
|
|
@@ -57,14 +57,60 @@ DLL Name: KERNEL32.dll
|
|
|
57
57
|
problematic `Sleep` reference can come from Rust std, MinGW, or pthread-related
|
|
58
58
|
linking paths, not only from `windows-sys`.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Windows builds use the `x86_64-pc-windows-gnu` target and the RubyInstaller
|
|
61
|
+
UCRT toolchain. The Rakefile configures that environment automatically, so the
|
|
62
|
+
extension and tests can be built with:
|
|
61
63
|
|
|
62
64
|
```powershell
|
|
63
|
-
|
|
65
|
+
rustup target add x86_64-pc-windows-gnu
|
|
66
|
+
ridk exec pacman -S --needed --noconfirm `
|
|
67
|
+
mingw-w64-ucrt-x86_64-gcc `
|
|
68
|
+
mingw-w64-ucrt-x86_64-clang `
|
|
69
|
+
mingw-w64-ucrt-x86_64-cmake `
|
|
70
|
+
mingw-w64-ucrt-x86_64-pkgconf
|
|
71
|
+
bundle exec rake test
|
|
64
72
|
```
|
|
65
73
|
|
|
74
|
+
The first Rake invocation also writes a machine-local `.cargo/windows.toml`.
|
|
75
|
+
The checked-in `.cargo/config.toml` loads it automatically, so Cargo and Rust
|
|
76
|
+
language servers use the same GNU target and RubyInstaller tools without
|
|
77
|
+
editor-specific settings.
|
|
78
|
+
|
|
79
|
+
## RubyInstaller development tools
|
|
80
|
+
|
|
81
|
+
RubyInstaller adds Ruby itself to `PATH`, but it does not enable the bundled
|
|
82
|
+
MSYS2 development environment globally. Running `ridk enable` adds tools such
|
|
83
|
+
as GCC, CMake, and Make to the current terminal only. This is normally useful
|
|
84
|
+
because it avoids conflicts with other Windows toolchains.
|
|
85
|
+
|
|
86
|
+
Rust language servers start Cargo directly and do not run `ridk enable` or the
|
|
87
|
+
Rakefile first. Add RubyInstaller's `ucrt64\bin` and `usr\bin` directories to
|
|
88
|
+
the user `PATH` so Cargo can load GCC, libclang, and their dependent DLLs from
|
|
89
|
+
any editor:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
$rubyRoot = ruby -rrbconfig -e "print RbConfig::CONFIG.fetch('prefix')"
|
|
93
|
+
$required = @(
|
|
94
|
+
(Join-Path $rubyRoot "msys64\ucrt64\bin"),
|
|
95
|
+
(Join-Path $rubyRoot "msys64\usr\bin")
|
|
96
|
+
)
|
|
97
|
+
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
|
98
|
+
$entries = @($userPath -split ";" | Where-Object {
|
|
99
|
+
$_ -and $_ -notin $required
|
|
100
|
+
})
|
|
101
|
+
$entries = $required + $entries
|
|
102
|
+
[Environment]::SetEnvironmentVariable("Path", ($entries -join ";"), "User")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Restart the editor after changing `PATH` so its language server inherits the
|
|
106
|
+
updated environment. Run `bundle exec rake compile` once after installing or
|
|
107
|
+
switching Ruby so `.cargo/windows.toml` points to the active RubyInstaller.
|
|
108
|
+
Run a Rake command after switching the same checkout between Windows and WSL;
|
|
109
|
+
Windows generates this local configuration, while other platforms remove it.
|
|
110
|
+
|
|
66
111
|
Result:
|
|
67
112
|
|
|
68
113
|
```text
|
|
69
|
-
|
|
114
|
+
254 runs, 1198 assertions, 0 failures, 0 errors
|
|
115
|
+
2 Rust tests passed
|
|
70
116
|
```
|
data/extconf.rb
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/script/rust_env.rb
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rbconfig"
|
|
4
|
+
require "fileutils"
|
|
5
|
+
|
|
6
|
+
module Wreq
|
|
7
|
+
module RustEnv
|
|
8
|
+
WINDOWS_GNU_TARGET = "x86_64-pc-windows-gnu"
|
|
9
|
+
WINDOWS_RUBY_PLATFORM = "x64-mingw-ucrt"
|
|
10
|
+
|
|
11
|
+
# Uses the UCRT toolchain shipped with the active RubyInstaller installation.
|
|
12
|
+
def self.activate
|
|
13
|
+
unless RbConfig::CONFIG["host_os"].match?(/mingw|mswin/)
|
|
14
|
+
FileUtils.rm_f(cargo_config_path)
|
|
15
|
+
return
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
ruby_platform = RbConfig::CONFIG.fetch("arch")
|
|
19
|
+
unless ruby_platform == WINDOWS_RUBY_PLATFORM
|
|
20
|
+
raise "Unsupported Windows Ruby platform: #{ruby_platform}. " \
|
|
21
|
+
"Use RubyInstaller UCRT (#{WINDOWS_RUBY_PLATFORM})."
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
ruby_root = RbConfig::CONFIG.fetch("prefix")
|
|
25
|
+
msys_root = File.join(ruby_root, "msys64")
|
|
26
|
+
ucrt_bin = File.join(msys_root, "ucrt64", "bin")
|
|
27
|
+
msys_bin = File.join(msys_root, "usr", "bin")
|
|
28
|
+
|
|
29
|
+
validate_tools(ucrt_bin, msys_bin)
|
|
30
|
+
write_cargo_config(ucrt_bin, msys_bin)
|
|
31
|
+
ENV["CARGO_BUILD_TARGET"] = WINDOWS_GNU_TARGET
|
|
32
|
+
ENV["LIBCLANG_PATH"] = ucrt_bin
|
|
33
|
+
ENV.delete("CMAKE_GENERATOR")
|
|
34
|
+
ENV["PATH"] = [ucrt_bin, msys_bin, ENV.fetch("PATH", nil)].compact.join(File::PATH_SEPARATOR)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Reports missing RubyInstaller packages before Cargo starts compiling.
|
|
38
|
+
def self.validate_tools(ucrt_bin, msys_bin)
|
|
39
|
+
required = %w[gcc.exe g++.exe gcc-ar.exe clang.exe libclang.dll cmake.exe]
|
|
40
|
+
.map { |tool| File.join(ucrt_bin, tool) }
|
|
41
|
+
.append(File.join(msys_bin, "make.exe"))
|
|
42
|
+
missing = required.reject { |tool| File.file?(tool) }
|
|
43
|
+
unless %w[pkgconf.exe pkg-config.exe].any? { |tool| File.file?(File.join(ucrt_bin, tool)) }
|
|
44
|
+
missing << File.join(ucrt_bin, "pkgconf.exe")
|
|
45
|
+
end
|
|
46
|
+
return if missing.empty?
|
|
47
|
+
|
|
48
|
+
raise "Missing RubyInstaller UCRT tools: #{missing.join(", ")}. " \
|
|
49
|
+
"Install the Windows build dependencies documented in " \
|
|
50
|
+
"docs/windows-gnu-tokio-crash.md."
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Generates machine-local Cargo defaults that work in command lines and IDEs.
|
|
54
|
+
def self.write_cargo_config(ucrt_bin, msys_bin)
|
|
55
|
+
config = <<~TOML
|
|
56
|
+
# Generated by script/rust_env.rb for the active RubyInstaller.
|
|
57
|
+
|
|
58
|
+
[build]
|
|
59
|
+
target = "#{WINDOWS_GNU_TARGET}"
|
|
60
|
+
|
|
61
|
+
[target.#{WINDOWS_GNU_TARGET}]
|
|
62
|
+
linker = "#{File.join(ucrt_bin, "gcc.exe")}"
|
|
63
|
+
|
|
64
|
+
[env]
|
|
65
|
+
CC_x86_64_pc_windows_gnu = { value = "#{File.join(ucrt_bin, "gcc.exe")}", force = true }
|
|
66
|
+
CXX_x86_64_pc_windows_gnu = { value = "#{File.join(ucrt_bin, "g++.exe")}", force = true }
|
|
67
|
+
AR_x86_64_pc_windows_gnu = { value = "#{File.join(ucrt_bin, "gcc-ar.exe")}", force = true }
|
|
68
|
+
CMAKE = { value = "#{File.join(ucrt_bin, "cmake.exe")}", force = true }
|
|
69
|
+
CMAKE_GENERATOR = { value = "MSYS Makefiles", force = true }
|
|
70
|
+
CMAKE_MAKE_PROGRAM = { value = "#{File.join(msys_bin, "make.exe")}", force = true }
|
|
71
|
+
LIBCLANG_PATH = { value = "#{ucrt_bin}", force = true }
|
|
72
|
+
TOML
|
|
73
|
+
|
|
74
|
+
return if File.exist?(cargo_config_path) && File.binread(cargo_config_path) == config
|
|
75
|
+
|
|
76
|
+
FileUtils.mkdir_p(File.dirname(cargo_config_path))
|
|
77
|
+
File.binwrite(cargo_config_path, config)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns the ignored Cargo configuration shared by Rake and language servers.
|
|
81
|
+
def self.cargo_config_path
|
|
82
|
+
File.expand_path("../.cargo/windows.toml", __dir__)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
data/wreq.gemspec
CHANGED
|
@@ -56,7 +56,7 @@ Gem::Specification.new do |spec|
|
|
|
56
56
|
# Exclude non-Ruby files from RDoc to prevent parsing errors
|
|
57
57
|
spec.rdoc_options = ["--exclude", "Cargo\\..*", "--exclude", "\\.rs$"]
|
|
58
58
|
|
|
59
|
-
spec.requirements = ["Rust >= 1.
|
|
59
|
+
spec.requirements = ["Rust >= 1.97"]
|
|
60
60
|
# use a Ruby version which:
|
|
61
61
|
# - supports Rubygems with the ability of compilation of Rust gem
|
|
62
62
|
# - not end of life
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wreq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.7
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- SearchApi
|
|
@@ -20,6 +20,7 @@ extensions: []
|
|
|
20
20
|
extra_rdoc_files: []
|
|
21
21
|
files:
|
|
22
22
|
- "./extconf.rb"
|
|
23
|
+
- ".cargo/config.toml"
|
|
23
24
|
- Gemfile
|
|
24
25
|
- LICENSE
|
|
25
26
|
- README.md
|
|
@@ -60,7 +61,7 @@ files:
|
|
|
60
61
|
- lib/wreq_ruby/http.rb
|
|
61
62
|
- lib/wreq_ruby/response.rb
|
|
62
63
|
- script/build_platform_gem.rb
|
|
63
|
-
- script/
|
|
64
|
+
- script/rust_env.rb
|
|
64
65
|
- test/body_sender_test.rb
|
|
65
66
|
- test/client_cookie_test.rb
|
|
66
67
|
- test/client_test.rb
|
|
@@ -112,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
112
113
|
- !ruby/object:Gem::Version
|
|
113
114
|
version: '0'
|
|
114
115
|
requirements:
|
|
115
|
-
- Rust >= 1.
|
|
116
|
+
- Rust >= 1.97
|
|
116
117
|
rubygems_version: 3.5.23
|
|
117
118
|
signing_key:
|
|
118
119
|
specification_version: 4
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
param(
|
|
2
|
-
[switch]$SkipBundleInstall,
|
|
3
|
-
[switch]$SkipToolInstall,
|
|
4
|
-
[switch]$BuildGem,
|
|
5
|
-
[switch]$TestGem,
|
|
6
|
-
[switch]$RunTests,
|
|
7
|
-
[string]$SmokeUrl = $env:WREQ_SMOKE_URL
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
$ErrorActionPreference = "Stop"
|
|
11
|
-
|
|
12
|
-
$target = "x86_64-pc-windows-gnu"
|
|
13
|
-
$platform = "x64-mingw-ucrt"
|
|
14
|
-
$gemPattern = "pkg\wreq-*-$platform.gem"
|
|
15
|
-
if ([string]::IsNullOrWhiteSpace($SmokeUrl)) {
|
|
16
|
-
$SmokeUrl = "https://httpbin.io/get"
|
|
17
|
-
}
|
|
18
|
-
$rubyRoot = Split-Path (Split-Path (Get-Command ruby).Source -Parent) -Parent
|
|
19
|
-
$ucrt = Join-Path $rubyRoot "msys64\ucrt64"
|
|
20
|
-
$ucrtBin = Join-Path $ucrt "bin"
|
|
21
|
-
$msysPackages = @(
|
|
22
|
-
"mingw-w64-ucrt-x86_64-gcc",
|
|
23
|
-
"mingw-w64-ucrt-x86_64-clang",
|
|
24
|
-
"mingw-w64-ucrt-x86_64-cmake",
|
|
25
|
-
"mingw-w64-ucrt-x86_64-pkgconf"
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
function Invoke-Step {
|
|
29
|
-
param(
|
|
30
|
-
[string]$Name,
|
|
31
|
-
[scriptblock]$Command
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
Write-Host "==> $Name"
|
|
35
|
-
# Native command failures do not honor ErrorActionPreference in Windows PowerShell.
|
|
36
|
-
$global:LASTEXITCODE = 0
|
|
37
|
-
& $Command
|
|
38
|
-
if ($LASTEXITCODE -ne 0) {
|
|
39
|
-
throw "$Name failed with exit code $LASTEXITCODE."
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function Get-MissingUcrtTools {
|
|
44
|
-
$missing = @()
|
|
45
|
-
|
|
46
|
-
if (-not (Test-Path (Join-Path $ucrtBin "gcc.exe")) -or -not (Test-Path (Join-Path $ucrtBin "g++.exe"))) {
|
|
47
|
-
$missing += "gcc/g++"
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (-not (Test-Path (Join-Path $ucrtBin "clang.exe")) -or -not (Test-Path (Join-Path $ucrtBin "libclang.dll"))) {
|
|
51
|
-
$missing += "clang/libclang"
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (-not (Test-Path (Join-Path $ucrtBin "cmake.exe"))) {
|
|
55
|
-
$missing += "cmake"
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (-not (Test-Path (Join-Path $ucrtBin "pkgconf.exe")) -and -not (Test-Path (Join-Path $ucrtBin "pkg-config.exe"))) {
|
|
59
|
-
$missing += "pkgconf"
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
$missing
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function Get-LatestPlatformGem {
|
|
66
|
-
$gem = Get-ChildItem -Path $gemPattern -ErrorAction SilentlyContinue |
|
|
67
|
-
Sort-Object LastWriteTime -Descending |
|
|
68
|
-
Select-Object -First 1
|
|
69
|
-
|
|
70
|
-
if (-not $gem) {
|
|
71
|
-
throw "No Windows GNU platform gem found at '$gemPattern'. Re-run with -BuildGem first."
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
$gem
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function Invoke-RubySmoke {
|
|
78
|
-
param(
|
|
79
|
-
[string]$Name,
|
|
80
|
-
[string]$Code
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
Write-Host "Smoke: $Name"
|
|
84
|
-
ruby -e $Code
|
|
85
|
-
if ($LASTEXITCODE -ne 0) {
|
|
86
|
-
throw "$Name failed with exit code $LASTEXITCODE."
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
Invoke-Step "Check Ruby platform" {
|
|
91
|
-
$rubyArch = & ruby -rrbconfig -e "print RbConfig::CONFIG['arch']"
|
|
92
|
-
if ($rubyArch -ne $platform) {
|
|
93
|
-
throw "Expected Ruby platform '$platform', got '$rubyArch'. Use RubyInstaller UCRT for this build."
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
ruby -v
|
|
97
|
-
ruby -rrbconfig -rrubygems -e "puts RbConfig::CONFIG.values_at('arch', 'host', 'CC').join(%q{ }); puts Gem::Platform.local"
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
Invoke-Step "Install Rust target" {
|
|
101
|
-
$installedTargets = @(rustup target list --installed)
|
|
102
|
-
if ($installedTargets -contains $target) {
|
|
103
|
-
Write-Host "Rust target $target already installed; skipping rustup."
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
rustup target add $target
|
|
108
|
-
if ($LASTEXITCODE -ne 0) {
|
|
109
|
-
throw "Failed to install Rust target $target."
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
Invoke-Step "Check MSYS2 UCRT build tools" {
|
|
114
|
-
$missing = @(Get-MissingUcrtTools)
|
|
115
|
-
if ($missing.Count -eq 0) {
|
|
116
|
-
Write-Host "MSYS2 UCRT build tools already present; skipping pacman."
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if ($SkipToolInstall) {
|
|
121
|
-
throw "Missing MSYS2 UCRT build tools: $($missing -join ', '). Re-run without -SkipToolInstall or install them with ridk."
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
Write-Host "Missing MSYS2 UCRT build tools: $($missing -join ', ')"
|
|
125
|
-
ridk exec pacman -S --needed --noconfirm @msysPackages
|
|
126
|
-
if ($LASTEXITCODE -ne 0) {
|
|
127
|
-
$stillMissing = @(Get-MissingUcrtTools)
|
|
128
|
-
if ($stillMissing.Count -eq 0) {
|
|
129
|
-
Write-Warning "pacman returned exit code $LASTEXITCODE, but all required tools are present; continuing."
|
|
130
|
-
$global:LASTEXITCODE = 0
|
|
131
|
-
return
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
throw "Failed to install MSYS2 UCRT build tools. Missing: $($stillMissing -join ', '). If pacman cannot lock its database, close other pacman/ridk shells, run PowerShell as Administrator, or install RubyInstaller in a user-writable directory."
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
Invoke-Step "Configure Windows GNU toolchain" {
|
|
139
|
-
$env:CARGO_BUILD_TARGET = $target
|
|
140
|
-
$env:LIBCLANG_PATH = $ucrtBin
|
|
141
|
-
$env:CC_x86_64_pc_windows_gnu = Join-Path $ucrtBin "gcc.exe"
|
|
142
|
-
$env:CXX_x86_64_pc_windows_gnu = Join-Path $ucrtBin "g++.exe"
|
|
143
|
-
$env:CMAKE = Join-Path $ucrtBin "cmake.exe"
|
|
144
|
-
Remove-Item Env:\CMAKE_GENERATOR -ErrorAction SilentlyContinue
|
|
145
|
-
|
|
146
|
-
rustc -Vv
|
|
147
|
-
Write-Host "LIBCLANG_PATH=$env:LIBCLANG_PATH"
|
|
148
|
-
Write-Host "CC_x86_64_pc_windows_gnu=$env:CC_x86_64_pc_windows_gnu"
|
|
149
|
-
Write-Host "CXX_x86_64_pc_windows_gnu=$env:CXX_x86_64_pc_windows_gnu"
|
|
150
|
-
Write-Host "CMAKE=$env:CMAKE"
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (-not $SkipBundleInstall) {
|
|
154
|
-
Invoke-Step "Install Ruby dependencies" {
|
|
155
|
-
bundle install
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
Invoke-Step "Compile native extension" {
|
|
160
|
-
ridk exec ruby -S bundle exec rake compile
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
Invoke-Step "Sync versioned extension" {
|
|
164
|
-
$rubyMinor = & ruby -e "print RUBY_VERSION[/\A\d+\.\d+/]"
|
|
165
|
-
$dest = "lib\wreq_ruby\$rubyMinor"
|
|
166
|
-
New-Item -ItemType Directory -Force $dest | Out-Null
|
|
167
|
-
Copy-Item "lib\wreq_ruby\wreq_ruby.so" (Join-Path $dest "wreq_ruby.so") -Force
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
Invoke-Step "Verify extension loads" {
|
|
171
|
-
ruby -Ilib -rwreq -e "puts Wreq::VERSION; puts Wreq::Client.new.class"
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if ($RunTests) {
|
|
175
|
-
Invoke-Step "Run tests" {
|
|
176
|
-
ridk exec ruby -S bundle exec rake test
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if ($BuildGem) {
|
|
181
|
-
Invoke-Step "Build local platform gem" {
|
|
182
|
-
$rubyMinor = & ruby -e "print RUBY_VERSION[/\A\d+\.\d+/]"
|
|
183
|
-
$dest = "lib\wreq_ruby\$rubyMinor"
|
|
184
|
-
New-Item -ItemType Directory -Force $dest | Out-Null
|
|
185
|
-
Copy-Item "lib\wreq_ruby\wreq_ruby.so" (Join-Path $dest "wreq_ruby.so") -Force
|
|
186
|
-
|
|
187
|
-
ruby script/build_platform_gem.rb $platform
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if ($TestGem) {
|
|
192
|
-
Invoke-Step "Install and smoke test platform gem" {
|
|
193
|
-
$gem = Get-LatestPlatformGem
|
|
194
|
-
$gemHome = Join-Path ([System.IO.Path]::GetTempPath()) "wreq-gem-test-$PID"
|
|
195
|
-
$gemBin = Join-Path $gemHome "bin"
|
|
196
|
-
$testDir = Join-Path ([System.IO.Path]::GetTempPath()) "wreq-gem-test-cwd-$PID"
|
|
197
|
-
|
|
198
|
-
Remove-Item -Recurse -Force $gemHome, $testDir -ErrorAction SilentlyContinue
|
|
199
|
-
New-Item -ItemType Directory -Force $gemHome, $gemBin, $testDir | Out-Null
|
|
200
|
-
|
|
201
|
-
$oldGemHome = $env:GEM_HOME
|
|
202
|
-
$oldGemPath = $env:GEM_PATH
|
|
203
|
-
$oldGemrc = $env:GEMRC
|
|
204
|
-
$oldRubyopt = $env:RUBYOPT
|
|
205
|
-
$oldRubylib = $env:RUBYLIB
|
|
206
|
-
$oldBundleGemfile = $env:BUNDLE_GEMFILE
|
|
207
|
-
$oldBundleBinPath = $env:BUNDLE_BIN_PATH
|
|
208
|
-
$oldBundlerVersion = $env:BUNDLER_VERSION
|
|
209
|
-
$oldSmokeUrl = $env:WREQ_SMOKE_URL
|
|
210
|
-
$oldWreqGemHome = $env:WREQ_GEM_HOME
|
|
211
|
-
|
|
212
|
-
try {
|
|
213
|
-
$env:GEM_HOME = $gemHome
|
|
214
|
-
$env:GEM_PATH = $gemHome
|
|
215
|
-
$env:GEMRC = ""
|
|
216
|
-
$env:RUBYOPT = ""
|
|
217
|
-
$env:RUBYLIB = ""
|
|
218
|
-
$env:BUNDLE_GEMFILE = ""
|
|
219
|
-
$env:BUNDLE_BIN_PATH = ""
|
|
220
|
-
$env:BUNDLER_VERSION = ""
|
|
221
|
-
$env:WREQ_SMOKE_URL = $SmokeUrl
|
|
222
|
-
$env:WREQ_GEM_HOME = $gemHome
|
|
223
|
-
|
|
224
|
-
gem install --norc --local --install-dir $gemHome --bindir $gemBin --no-document --force --no-user-install $gem.FullName
|
|
225
|
-
if ($LASTEXITCODE -ne 0) {
|
|
226
|
-
throw "Failed to install $($gem.FullName)."
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
Push-Location $testDir
|
|
230
|
-
try {
|
|
231
|
-
Invoke-RubySmoke "Load installed platform gem" @'
|
|
232
|
-
STDOUT.sync = true
|
|
233
|
-
STDERR.sync = true
|
|
234
|
-
require "wreq"
|
|
235
|
-
spec = Gem.loaded_specs.fetch("wreq")
|
|
236
|
-
expected = File.expand_path(ENV.fetch("WREQ_GEM_HOME"))
|
|
237
|
-
actual = File.expand_path(spec.full_gem_path)
|
|
238
|
-
raise "loaded #{actual}, expected under #{expected}" unless actual.start_with?(expected)
|
|
239
|
-
puts "loaded #{spec.full_name}"
|
|
240
|
-
puts actual
|
|
241
|
-
puts "wreq #{Wreq::VERSION}"
|
|
242
|
-
'@
|
|
243
|
-
|
|
244
|
-
Invoke-RubySmoke "Request through installed platform gem" @'
|
|
245
|
-
STDOUT.sync = true
|
|
246
|
-
STDERR.sync = true
|
|
247
|
-
require "wreq"
|
|
248
|
-
client = Wreq::Client.new
|
|
249
|
-
resp = client.get(ENV.fetch("WREQ_SMOKE_URL"), timeout: 20)
|
|
250
|
-
puts "HTTP #{resp.code}"
|
|
251
|
-
raise "unexpected status #{resp.code}" unless resp.code == 200
|
|
252
|
-
'@
|
|
253
|
-
} finally {
|
|
254
|
-
Pop-Location
|
|
255
|
-
}
|
|
256
|
-
} finally {
|
|
257
|
-
$env:GEM_HOME = $oldGemHome
|
|
258
|
-
$env:GEM_PATH = $oldGemPath
|
|
259
|
-
$env:GEMRC = $oldGemrc
|
|
260
|
-
$env:RUBYOPT = $oldRubyopt
|
|
261
|
-
$env:RUBYLIB = $oldRubylib
|
|
262
|
-
$env:BUNDLE_GEMFILE = $oldBundleGemfile
|
|
263
|
-
$env:BUNDLE_BIN_PATH = $oldBundleBinPath
|
|
264
|
-
$env:BUNDLER_VERSION = $oldBundlerVersion
|
|
265
|
-
$env:WREQ_SMOKE_URL = $oldSmokeUrl
|
|
266
|
-
$env:WREQ_GEM_HOME = $oldWreqGemHome
|
|
267
|
-
Remove-Item -Recurse -Force $gemHome, $testDir -ErrorAction SilentlyContinue
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|