Skip to content

Commit 6698485

Browse files
2023.1 release code drop.
1 parent 71f2ec8 commit 6698485

6 files changed

Lines changed: 99 additions & 123 deletions

File tree

LICENSE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022, Perforce Software, Inc. All rights reserved.
1+
Copyright (c) 2023, Perforce Software, Inc. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without
44
modification, are permitted provided that the following conditions are met:
@@ -32,7 +32,7 @@ this program.
3232

3333
P4/P4API License
3434
-----------------------
35-
Copyright (c) 1995-2022, Perforce Software, Inc.
35+
Copyright (c) 1995-2023, Perforce Software, Inc.
3636
All rights reserved.
3737

3838
Redistribution and use in source and binary forms, with or without

RELNOTES.txt

Lines changed: 66 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Release Notes for
22
P4Ruby, Perforce's script API for Ruby
33

4-
Version 2022.1
4+
Version 2023.1
55

66
Introduction
77

@@ -16,8 +16,8 @@ Introduction
1616
release up to the bug fix change level.
1717

1818
Precompiled versions of P4Ruby are built against a corresponding version
19-
of the Perforce C++ API, e.g., P4Ruby 2022.1 will be compiled using a
20-
2022.1 version of the P4API. You can always install P4Ruby using a
19+
of the Perforce C++ API, e.g., P4Ruby 2023.1 will be compiled using a
20+
2023.1 version of the P4API. You can always install P4Ruby using a
2121
source-only variation, selecting a specific version of the P4API.
2222

2323
To determine the version of your P4Ruby, and which version of the
@@ -26,7 +26,14 @@ Introduction
2626

2727
--------------------------------------------------------------------------
2828

29-
Installing P4Ruby
29+
Important End-of-Life Notice
30+
31+
This major release of P4Ruby would be the last to test against Ruby 2.7
32+
which is in EOL status. This is part of our commitment to focus on supported
33+
technology platforms
34+
35+
--------------------------------------------------------------------------
36+
Installation
3037

3138
The recommended method of installing P4Ruby is via gems.
3239

@@ -52,69 +59,30 @@ Installing P4Ruby
5259

5360
Building P4Ruby from Source
5461

55-
1. Download the Perforce C++ API from the Perforce FTP site at
56-
"ftp://ftp.perforce.com/perforce". The API archive is located
57-
in release and platform-specific subdirectories and is named
58-
"p4api-glibc2.3-openssl1.1.1.tgz" .
59-
60-
Note: 32-bit builds of P4Ruby require a 32-bit version of the
61-
C++ API and a 32-bit version of Ruby. 64-bit builds of
62-
P4Ruby require a 64-bit version of the C++ API and a
63-
64-bit version of Ruby.
64-
65-
Unzip the archive into an empty directory.
66-
67-
2. Extract the P4Ruby API archive into a new, empty directory.
68-
69-
3. Execute the build commands:
70-
71-
bundle install
72-
bundle exec rake compile -- --with-p4api_dir=<absolute path to Perforce C++ API> \
73-
--with-ssl-dir=<absolute path to OpenSSL libraries matching Perforce C++ API>
74-
75-
OR pass through environment variables
76-
bundle exec rake compile p4api_dir=<absolute path to Perforce C++ API>
77-
78-
Note: If the --p4api_dir flag is not provided, P4Ruby will attempt
79-
to download and extract correct version of Perforce C++ API
62+
The official version of P4Ruby exists as source on:
63+
https://github.com/perforce/p4ruby
8064

81-
4. Test your distribution.
82-
83-
bundle exec rake test
84-
85-
Tests require the perforce server binary (p4d) present in the path.
86-
87-
5. Install P4Ruby into your local gem cache:
88-
89-
bundle exec rake install
90-
91-
SSL support
92-
-----------
93-
94-
Perforce Server 2012.1 and later supports SSL connections and the
95-
C++ API has been compiled with this support.
96-
97-
If the P4Ruby build detects that OpenSSL is available, it will be
98-
included by default. If you want to use libraries deployed to nonstandard
99-
paths, use the --ssl_dir=<path to Openssl include and lib folders>
65+
Instructions for building are in the BUILD.md file which can be found
66+
here - https://github.com/perforce/p4ruby/blob/master/build.md
10067

10168
--------------------------------------------------------------------------
10269

10370
Compatibility Statements
10471

10572
Server Compatibility
10673

107-
The 2022.1 release of P4Ruby supports the 2022.1 Perforce Server.
74+
This release of P4Ruby supports the 2023.1 Perforce Server.
10875
Older releases might work but are not supported.
10976

11077
API Compatibility
11178

112-
The 2022.1 release of P4Ruby supports the 2022.1 Perforce API.
113-
Older releases might work but are not supported.
79+
This release of P4Ruby supports the 2023.1 Perforce API
80+
(2023.1/2442900). Older releases might work but are not supported.
11481

11582
Ruby Compatibility
11683

117-
The 2022.1 release of P4Ruby is supported on Ruby versions 2.7 3.0 and 3.1
84+
This release of P4Ruby is supported on Ruby versions 2.7 3.0, 3.1
85+
and 3.2
11886

11987
For detailed compatibility, please check the following table:
12088

@@ -123,24 +91,28 @@ Compatibility Statements
12391
2.7 | 2020.1 or later
12492
3.0 | 2021.1 or later
12593
3.1 | 2022.1 or later
94+
3.2 | 2023.1 or later
12695

12796
OpenSSL Compatibility
12897

129-
P4Ruby requires OpenSSL 1.0.2+ or 1.1.1+
130-
131-
Running P4Ruby linked to an older library will
132-
fail with the error:
98+
To build P4Ruby with encrypted communication support, you must use the
99+
version of OpenSSL that Perforce C/C++ API has been built against.
133100

134-
"SSL library must be at least version 1.0.2."
101+
Beginning with the 2017.1 release of the Helix C/C++ API, the dependency
102+
on OpenSSL is now enforced and the SSL stub library has been removed.
103+
Executables linked against the P4API libraries must also be linked against
104+
real OpenSSL libraries: The latest 3.0.x or 1.1.1 patch is recommended
135105

136106
Platform Compatibility
137107

138108
While P4Ruby is generally portable, this release is certified
139109
only on the following platforms:
140110

141-
- RVM based installs for Ruby 2.7, 3.0 and 3.1 on Ubuntu and CentOS.
142-
- rubyinstaller.org for Ruby 2.7, 3.0 and 3.1
143-
on Windows Server 2016/2019, and Windows 10
111+
Windows (x64)
112+
Server 2016
113+
Linux
114+
Ubuntu 20.04, 22.04
115+
CentOS 8
144116

145117
Compiler Compatibility
146118

@@ -170,6 +142,40 @@ Key to symbols used in change notes below.
170142
*** -- requires new p4d server program
171143

172144
--------------------------------------------------------------------------
145+
--------------------------------------------------------------------------
146+
147+
New functionality in 2023.1 (2023.1/2446234) (2023/05/25)
148+
149+
#2443839 (Job #115709) * ** ***
150+
This release of P4Ruby supports P4API 2023.1 (2023.1/2442900).
151+
152+
#2443217, #2438303 (Job #115281) *
153+
Added support for Ruby 3.2.
154+
155+
#2439606 (Job #2439606) * **
156+
Windows gems for P4Ruby are now shipped with OpenSSL 3.0.8
157+
158+
--------------------------------------------------------------------------
159+
--------------------------------------------------------------------------
160+
161+
New functionality in 2022.1 Patch 2 (2022.1/2405581) (2023/02/10)
162+
163+
Important security note
164+
This version addresses vulnerabilities in OpenSSL (CVE-2023-0286,
165+
CVE-2023-0215, CVE-2022-4450, CVE-2022-4304) by linking in version
166+
1.1.1t of the library.
167+
168+
--------------------------------------------------------------------------
169+
--------------------------------------------------------------------------
170+
171+
Bugs fixed in 2022.1 Patch 1 (2022.1/2368511) (2022/11/10)
172+
173+
(Job #113209) * **
174+
Correct the handling of untranslated text left in the
175+
compression buffer on Close(). Build only change.
176+
177+
--------------------------------------------------------------------------
178+
--------------------------------------------------------------------------
173179

174180
New functionality in 2022.1 (2022.1/2359956) (2022/10/26)
175181

ext/P4/extconf.rb

Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
$:.push File.expand_path("../../../lib", __FILE__)
44

55
require 'mkmf'
6-
require 'net/ftp'
76
require 'P4/version'
87
require 'rbconfig'
98
require 'openssl'
9+
require 'net/http'
1010

1111
# Set this to the main version directory we look up in ftp.perforce.com for the P4API
1212
# This is ignored if you specify the version on the command line.
@@ -266,9 +266,9 @@ def P4ApiVersion.load(dir)
266266
# subdirectory. Look there if we can't find it in the API root
267267
#
268268
ver_file = dir + "/Version"
269-
unless File.exists?(ver_file)
269+
unless File.exist?(ver_file)
270270
ver_file = dir + "/sample/Version"
271-
return nil unless File.exists?(ver_file)
271+
return nil unless File.exist?(ver_file)
272272
end
273273

274274
re = Regexp.new('^RELEASE = (\d+)\s+(\d+)\s+(\w*\S*)\s*;')
@@ -390,7 +390,7 @@ def resolve_p4api_dir
390390
end
391391

392392
if !p4api_dir && !with_config('p4api-dir') && enable_config('p4api-download', true)
393-
download_api_via_ftp
393+
download_api_via_https
394394
unzip_file
395395
p4api_dir = downloaded_p4api_dir
396396
dir_config('p4api', "#{p4api_dir}/include", "#{p4api_dir}/lib")
@@ -468,7 +468,7 @@ def platform_dir_name
468468
"bin.#{p4_platform_label}"
469469
end
470470

471-
def ftp_download_dir(version)
471+
def download_dir(version)
472472
"perforce/#{version}/#{platform_dir_name}"
473473
end
474474

@@ -484,7 +484,9 @@ def filename
484484
filename = 'p4api-openssl1.1.1.zip'
485485
when /1.0/
486486
filename = 'p4api-openssl1.0.2.zip'
487-
end
487+
when /3.0/
488+
filename = 'p4api-openssl3.zip'
489+
end
488490
end
489491
elsif RbConfig::CONFIG['target_os'].downcase =~ /darwin19|darwin[2-9][0-9]/
490492
filename = 'p4api-openssl1.1.1.tgz'
@@ -496,69 +498,30 @@ def filename
496498
filename = 'p4api-glibc2.3-openssl1.1.1.tgz'
497499
when /1.0/
498500
filename = 'p4api-glibc2.3-openssl1.0.2.tgz'
501+
when /3.0/
502+
filename = 'p4api-glibc2.3-openssl3.tgz'
499503
end
500504
end
501505
end
502506
return filename
503507
end
504508

505-
506-
def remote_files_matching(ftp, dir, regex)
507-
ftp.ls(dir.to_s).map { |entry|
508-
if match = entry.match(regex)
509-
yield match
510-
else
511-
nil
512-
end
513-
}.reject { |entry|
514-
entry.nil?
515-
}
516-
end
517-
518-
def find_latest_with_p4api(ftp, versions)
519-
versions.reverse_each { |v|
520-
begin
521-
remote_files_matching(ftp, "r#{v}/#{platform_dir_name}/", /p4api/) do
522-
return v
523-
end
524-
rescue
525-
next
526-
end
527-
}
528-
end
529-
530-
def find_latest_version_dir(ftp)
531-
ftp.chdir('perforce')
532-
533-
# Capture all versions
534-
versions = remote_files_matching(ftp, '.', /r(1\d\.\d)/) { |m| m.captures.first }.sort
535-
536-
version = find_latest_with_p4api(ftp, versions)
537-
538-
ftp.chdir('..')
539-
540-
"r#{version}"
541-
end
542-
543-
# Downloads the C++ P4API via FTP to the local directory, then 'initializes' it
509+
#############################################
510+
# Downloads the C++ P4API via HTTPS to the local directory, then 'initializes' it
544511
# by unpacking it.
545-
def download_api_via_ftp
546-
ftp = Net::FTP.new('ftp.perforce.com')
547-
ftp.passive=true
548-
ftp.login
549-
550-
# At one point, we allowed the gem build to just find the most recent p4api build.
551-
# P4Ruby probably shouldn't do that by default.
552-
#version_dir = find_latest_version_dir(ftp)
512+
def download_api_via_https
553513

554-
dir = ftp_download_dir(p4api_version_dir)
555-
ftp.chdir(dir)
514+
uri=URI('https://ftp.perforce.com:443')
515+
dir = download_dir(p4api_version_dir)
556516

557-
puts "downloading #{filename} from #{dir} on ftp.perforce.com"
558-
ftp.getbinaryfile(filename)
517+
puts "Downloading #{filename} from #{dir} on https://ftp.perforce.com"
559518

560-
ensure
561-
ftp.close if ftp and !ftp.closed?
519+
Net::HTTP.start(uri.host, uri.port, :use_ssl =>true) do |http|
520+
resp = http.get("/" + dir + "/" + filename)
521+
open(filename, "wb") do |file|
522+
file.write(resp.body)
523+
end
524+
end
562525
end
563526

564527
def unzip_file

ext/P4/p4.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,11 @@ void Init_P4()
15021502

15031503
// P4::Progress class.
15041504
cP4Prog = rb_define_class_under( cP4, "Progress", rb_cObject );
1505+
1506+
rb_undef_alloc_func(cP4);
1507+
rb_undef_alloc_func(cP4MD);
1508+
rb_undef_alloc_func(cP4Map);
1509+
rb_undef_alloc_func(cP4Msg);
15051510

15061511
};
15071512

ext/P4/specmgr.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ struct defaultspec {
9292
"AltRoots;code:308;type:llist;len:64;;"
9393
"Options;code:309;type:line;len:64;val:"
9494
"noallwrite/allwrite,noclobber/clobber,nocompress/compress,"
95-
"unlocked/locked,nomodtime/modtime,normdir/rmdir;;"
95+
"unlocked/locked,nomodtime/modtime,normdir/rmdir,"
96+
"noaltsync/altsync;;"
9697
"SubmitOptions;code:313;type:select;fmt:L;len:25;val:"
9798
"submitunchanged/submitunchanged+reopen/revertunchanged/"
9899
"revertunchanged+reopen/leaveunchanged/leaveunchanged+reopen;;"
@@ -128,6 +129,7 @@ struct defaultspec {
128129
"MaxScanRows;code:403;type:word;len:12;;"
129130
"MaxLockTime;code:407;type:word;len:12;;"
130131
"MaxOpenFiles;code:413;type:word;len:12;;"
132+
"MaxMemory;code:NNN;type:word;len:12;;"
131133
"Timeout;code:406;type:word;len:12;;"
132134
"PasswordTimeout;code:409;type:word;len:12;;"
133135
"LdapConfig;code:410;type:line;len:128;;"

lib/P4/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class P4
2-
Version = VERSION = '2020.1.1970474'
2+
Version = VERSION = '2023.1.2443531'
33
end

0 commit comments

Comments
 (0)