Skip to content

Commit a97115e

Browse files
2024.2 Patch 1 release code drop
1 parent 55afc5a commit a97115e

7 files changed

Lines changed: 79 additions & 8 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) 2024, Perforce Software, Inc. All rights reserved.
1+
Copyright (c) 2025, 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-2024, Perforce Software, Inc.
35+
Copyright (c) 1995-2025, Perforce Software, Inc.
3636
All rights reserved.
3737

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

RELNOTES.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ Introduction
2424
P4API it has been built with, issue the following command:
2525
ruby -rP4 -e "puts P4.identify"
2626

27+
28+
--------------------------------------------------------------------------
29+
30+
Important End-of-Life Notice
31+
32+
This release of P4Ruby would be the last to support and test against
33+
Ruby 3.1 which is in EOL status. This is part of our commitment to
34+
focus on supported technology platforms.
35+
2736
--------------------------------------------------------------------------
2837

2938
Installation
@@ -74,8 +83,8 @@ Compatibility Statements
7483

7584
Ruby Compatibility
7685

77-
This release of P4Ruby is supported on Ruby versions 3.1, 3.2
78-
and 3.3
86+
This release of P4Ruby is supported on Ruby versions 3.1, 3.2, 3.3
87+
and 3.4
7988

8089
For detailed compatibility, please check the following table:
8190

@@ -84,6 +93,7 @@ Compatibility Statements
8493
3.1 | 2022.1 or later
8594
3.2 | 2023.1 or later
8695
3.3 | 2024.2 or later
96+
3.4 | 2024.2.1 or later
8797

8898
OpenSSL Compatibility
8999

@@ -142,6 +152,23 @@ Key to symbols used in change notes below.
142152
--------------------------------------------------------------------------
143153
--------------------------------------------------------------------------
144154

155+
New functionality in 2024.2 Patch 1 (2024.2/2736761) (2025/03/19)
156+
157+
#2733739 #2736249 (Job #124477) *
158+
Added support for Ruby 3.4
159+
160+
Bugs fixed in 2024.2 Patch 1 (2024.2/2736761) (2025/03/19)
161+
162+
#2733739 (Job #123477) *
163+
Fixed windows build issues for ruby versions > 3.3.0
164+
165+
#2724187 (Job #123781) *
166+
Updated the retrieval mechanism to handle OpenSSL 3.* properly,
167+
ensuring p4api can be fetched successfully.
168+
169+
--------------------------------------------------------------------------
170+
--------------------------------------------------------------------------
171+
145172
New functionality in 2024.2 (2024.2/2682777) (2024/11/15)
146173

147174
#2678428 (Job #122585) * ** ***

ext/P4/extconf.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def p4_platform_label
454454
# There are too many permutations of Windows p4api, to automate.
455455
raise 'Automatic fetching of p4api from perforce FTP is not supported on Windows'
456456
when /darwin19|darwin[2-9][0-9]/
457-
"macosx1015#{p4_cpu(:darwin)}"
457+
"macosx12#{p4_cpu(:darwin)}"
458458
when /darwin/
459459
"darwin90#{p4_cpu(:darwin)}"
460460
when /solaris/
@@ -484,7 +484,7 @@ def filename
484484
filename = 'p4api-openssl1.1.1.zip'
485485
when /1.0/
486486
filename = 'p4api-openssl1.0.2.zip'
487-
when /3.0/
487+
when /3.*/
488488
filename = 'p4api-openssl3.zip'
489489
end
490490
end
@@ -493,7 +493,7 @@ def filename
493493
case openssl_number.to_s
494494
when /1.1/
495495
filename = 'p4api-openssl1.1.1.tgz'
496-
when /3.0/
496+
when /3.*/
497497
filename = 'p4api-openssl3.tgz'
498498
end
499499
end
@@ -505,7 +505,7 @@ def filename
505505
filename = 'p4api-glibc2.3-openssl1.1.1.tgz'
506506
when /1.0/
507507
filename = 'p4api-glibc2.3-openssl1.0.2.tgz'
508-
when /3.0/
508+
when /3.*/
509509
filename = 'p4api-glibc2.3-openssl3.tgz'
510510
end
511511
end

ext/P4/p4.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,14 @@ static VALUE p4_set_evar( VALUE self, VALUE var, VALUE val )
333333
return Qtrue;
334334
}
335335

336+
static VALUE p4_set_var( VALUE self, VALUE var, VALUE val )
337+
{
338+
P4ClientApi *p4;
339+
Data_Get_Struct( self, P4ClientApi, p4 );
340+
p4->SetVar( StringValuePtr( var ), StringValuePtr( val ) );
341+
return Qtrue;
342+
}
343+
336344
static VALUE p4_get_host( VALUE self )
337345
{
338346
P4ClientApi *p4;
@@ -1366,6 +1374,7 @@ void Init_P4()
13661374
rb_define_method( cP4, "enviro_file=", RUBY_METHOD_FUNC(p4_set_enviro_file), 1);
13671375
rb_define_method( cP4, "evar", RUBY_METHOD_FUNC(p4_get_evar) , 1 );
13681376
rb_define_method( cP4, "set_evar", RUBY_METHOD_FUNC(p4_set_evar) , 2 );
1377+
rb_define_method( cP4, "set_var", RUBY_METHOD_FUNC(p4_set_var) , 2 );
13691378
rb_define_method( cP4, "host", RUBY_METHOD_FUNC(p4_get_host) , 0 );
13701379
rb_define_method( cP4, "host=", RUBY_METHOD_FUNC(p4_set_host) , 1 );
13711380
rb_define_method( cP4, "ignore_file",RUBY_METHOD_FUNC(p4_get_ignore) , 0 );

ext/P4/p4clientapi.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ P4ClientApi::SetEVar( const char *var, const char *val )
151151
client.SetEVar( sVar, sVal );
152152
}
153153

154+
void
155+
P4ClientApi::SetVar( const char *var, const char *val )
156+
{
157+
StrRef sVar( var );
158+
StrRef sVal( val );
159+
client.SetVar( sVar, sVal );
160+
}
161+
154162
const StrPtr *
155163
P4ClientApi::GetEVar( const char *var )
156164
{

ext/P4/p4clientapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class P4ClientApi
7474
void SetCwd( const char *c );
7575
void SetEnviroFile( const char *c );
7676
void SetEVar( const char *var, const char *val );
77+
void SetVar( const char *var, const char *val );
7778
void SetHost( const char *h ) { client.SetHost( h ); }
7879
void SetIgnoreFile( const char *f ) { client.SetIgnoreFile( f ); }
7980
void SetMaxResults( int v ) { maxResults = v; }

lib/P4.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,32 @@
3333
#*******************************************************************************
3434

3535
require 'P4/version'
36+
require 'fiddle'
37+
38+
#
39+
# Ruby 3.4 introduced a change affecting DLL loading behavior, which impacts
40+
# how dependent DLLs are resolved. Specifically, libwinpthread-1.dll is no
41+
# longer automatically loaded from ruby_builtin_dlls, causing potential failures
42+
# in extensions relying on it.
43+
#
44+
# To address this, we must explicitly define the DLL path for libwinpthread-1.dll
45+
# before loading dependent libraries in windows.
46+
#
47+
if Gem.win_platform?
48+
dll_path = File.join(RbConfig::CONFIG['bindir'], 'ruby_builtin_dlls', 'libwinpthread-1.dll')
49+
50+
if File.exist?(dll_path)
51+
begin
52+
Fiddle.dlopen(dll_path)
53+
rescue Fiddle::DLError => e
54+
puts "Failed to load #{dll_path}: #{e.message}"
55+
exit 1
56+
end
57+
else
58+
puts "Error: DLL not found at #{dll_path}"
59+
exit 1
60+
end
61+
end
3662

3763
#
3864
# Get the bulk of the definition of the P4 class from the API interface.

0 commit comments

Comments
 (0)