Skip to content

Commit 8806654

Browse files
2025.1 release code drop
Release 2025.1
1 parent d83a1ab commit 8806654

File tree

13 files changed

+264
-376
lines changed

13 files changed

+264
-376
lines changed

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

P4.py

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
This uses the Python type P4API.P4Adapter, which is a wrapper for the
88
Perforce ClientApi object.
99
10-
$Id: //depot/main/p4-python/P4.py#114 $
10+
$Id: //depot/main/p4-python/P4.py#115 $
1111
1212
#*******************************************************************************
1313
# Copyright (c) 2007-2010, Perforce Software, Inc. All rights reserved.
@@ -762,28 +762,44 @@ def run_print(self, *args, **kargs):
762762
result = []
763763
if raw:
764764
debugResult = []
765+
file_contents = None
766+
767+
def flush_file_contents():
768+
nonlocal file_contents
769+
if file_contents is None:
770+
return
771+
elif len(file_contents) == 0:
772+
# If no file contents, assume string (text)
773+
result.append("")
774+
else:
775+
# Ensure all elements in file_contents are of the same type
776+
content_type = type(file_contents[0])
777+
if any(not isinstance(x, content_type) for x in file_contents):
778+
raise TypeError("Mixed types in file content.")
779+
if content_type is bytes:
780+
result.append(b"".join(file_contents))
781+
else:
782+
result.append("".join(file_contents))
783+
file_contents = None
784+
765785
for line in raw:
766786
if isinstance(line, dict):
787+
flush_file_contents()
767788
result.append(line)
768789
if logger:
769790
debugResult.append(line)
770-
result.append("")
791+
file_contents = []
771792
else:
772-
# to support encoding for Python 3, we have to do a little dance
773-
# we cannot add bytes to the str "", but we expect that all lines
774-
# are either str or bytes. So if we encounter bytes, we replace the content
775-
try:
776-
result[-1] += line
777-
except TypeError:
778-
if type(line) == bytes and type(result[-1]) == str and result[-1] == "":
779-
result[-1] = line
780-
else:
781-
raise
793+
if file_contents is None:
794+
file_contents = []
795+
file_contents.append(line)
796+
797+
flush_file_contents()
798+
782799
if logger:
783800
logger.debug(debugResult)
784-
return result
785-
else:
786-
return []
801+
802+
return result
787803

788804
def run_resolve(self, *args, **kargs):
789805
if self.resolver:

P4API.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2828
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*
30-
* $Id: //depot/main/p4-python/P4API.cpp#64 $
30+
* $Id: //depot/main/p4-python/P4API.cpp#65 $
3131
*
3232
* Build instructions:
3333
* Use Distutils - see accompanying setup.py
@@ -338,7 +338,7 @@ static PyObject * P4API_dvcs_init(P4Adapter * self, PyObject * args, PyObject *
338338
return NULL;
339339

340340

341-
auto_ptr<ServerHelperApi> personalServer( create_server(user, client, directory, &ui) );
341+
unique_ptr<ServerHelperApi> personalServer( create_server(user, client, directory, &ui) );
342342

343343
if( personalServer.get() == NULL)
344344
return NULL;
@@ -400,7 +400,7 @@ static PyObject * P4API_dvcs_clone(P4Adapter * self, PyObject * args, PyObject *
400400
&progress))
401401
return NULL;
402402

403-
auto_ptr<ServerHelperApi> personalServer( create_server(user, client, directory, &ui) );
403+
unique_ptr<ServerHelperApi> personalServer( create_server(user, client, directory, &ui) );
404404

405405
if( personalServer.get() == NULL)
406406
return NULL;

RELNOTES.txt

Lines changed: 66 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Release Notes for
2-
P4Python, Helix Core API for Python
2+
P4Python, P4 API for Python
33

4-
Version 2024.2
4+
Version 2025.1
55

66
Introduction
77

@@ -23,11 +23,22 @@ Introduction
2323

2424
--------------------------------------------------------------------------
2525

26+
Important Product Rebrand Notice
27+
28+
Helix Core is now P4
29+
Perforce has a new look and logo that reflects our place in DevOps
30+
workflows. As part of these changes, Helix Core is now P4. Name updates
31+
and new icons to align with the P4 branding will be rolled out soon.
32+
To learn more, see:
33+
https://www.perforce.com/blog/vcs/introducing-the-p4-platform
34+
35+
--------------------------------------------------------------------------
36+
2637
Important End-of-Life Notice
2738

28-
This major release of P4Python would be the last to provide wheels for and
29-
test against Python 3.8. This is part of our commitment to focus on
30-
supported technology platforms
39+
This release of P4Python would be the last to support and test against
40+
Python 3.9, which is in EOL status. This is part of our commitment to
41+
focus on supported technology platforms.
3142

3243
--------------------------------------------------------------------------
3344

@@ -47,9 +58,10 @@ Installation
4758

4859
python3 -m pip install --upgrade p4python
4960

50-
P4Python is distributed as a binary wheels for Python 3.8, 3.9, 3.10,
51-
3.11, 3.12 and 3.13. In order for the binary wheel to be used, the ABI tag needs to
52-
match.This often requires updated pip, to do so issue:
61+
P4Python is distributed as a binary wheels for Python 3.9, 3.10,
62+
3.11, 3.12 and 3.13. In order for the binary wheel to be used, the ABI
63+
tag needs to match. This often requires updated pip, to do so issue:
64+
5365
python3 -m pip install --upgrade pip
5466

5567
Installation using Linux binary packages
@@ -112,24 +124,23 @@ Compatibility Statements
112124

113125
Server Compatibility
114126

115-
You can use any release of P4Python with any release of the
116-
Perforce server later than 2001.1
127+
This release of P4Python supports the 2025.1 P4 Server.
128+
Older releases might work but are not supported.
117129

118130
API Compatibility
119131

120-
This release of P4Python requires at least 2024.2 Perforce API
121-
(2024.2/2675662). Older releases will not compile and are not supported.
132+
This release of P4Python requires at least 2025.1 P4 C/C++ API
133+
(2025.1/2761706). Older releases will not compile and are not supported.
122134

123135
Python Compatibility
124136

125137
This release of P4Python is supported building from source with
126-
Python 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13.
138+
Python 3.9, 3.10, 3.11, 3.12 and 3.13.
127139

128140
For detailed compatibility, please check the following table:
129141

130142
Python Release | P4Python Release
131143
======================================
132-
3.8 | 2020.1 or later
133144
3.9 | 2021.1 or later
134145
3.10 | 2022.1 or later
135146
3.11 | 2022.2 or later
@@ -139,11 +150,11 @@ Compatibility Statements
139150
OpenSSL Compatibility
140151

141152
To build P4Python with encrypted communication support, you must use the
142-
version of OpenSSL that Perforce C/C++ API has been built against.
153+
version of OpenSSL that P4 C/C++ API has been built against.
143154

144-
Beginning with the 2017.1 release of the Helix C/C++ API, the dependency on
155+
Beginning with the 2017.1 release of the P4 C/C++ API, the dependency on
145156
OpenSSL is now enforced and the SSL stub library has been removed.
146-
Executables linked against the P4API libraries must also be linked against
157+
Executables linked against the P4 C/C++ API libraries must also be linked against
147158
real OpenSSL libraries: The latest 3.0.x or 1.1.1 patch is recommended
148159

149160
Platform Compatibility
@@ -172,33 +183,29 @@ Compatibility Statements
172183
Compiler Compatibility
173184

174185
To build P4Python from source, you must use a version of P4Python that has
175-
been compiled with the same compiler used to build the Perforce C++ API.
186+
been compiled with the same compiler used to build the P4 C/C++ API.
176187
For most platforms, use gcc/g++.
177188

178-
On Linux since the 2019.1 P4API release, due to a change in library
189+
On Linux since the 2019.1 P4 C/C++ API release, due to a change in library
179190
dependencies, the source code requires gcc 6 or above to be used.
180191

181192
Attempting to use a different compiler or a different version of the
182193
compiler will cause link errors due to differences in name handling.
183194

184-
For more information about P4API compiler requirements, please see this link:
195+
For more information about P4 C/C++ API compiler requirements, please see this link:
185196
https://www.perforce.com/manuals/p4api/Content/P4API/client.programming.compiling.html
186197

187-
On Windows platforms, the P4Python installer is build with Python from
188-
python.org. The installer for Python 3.x was built with Visual Studio 2017
189-
and Visual Studio 2008 for Python 2.
190-
191198
To run Python 3.x on Windows, it might be necessary to install the
192199
redistributable version of the 2017 libraries, vc_redist.x64.exe or
193200
vc_redist.x86.exe, respectively for 64 bit and 32 bit.
194-
Without these libraries the DLL for P4API will not load into Python and
201+
Without these libraries the DLL for P4 C/C++ API will not load into Python and
195202
the command 'import P4' will fail.
196203

197204
Known Limitations
198205

199-
The Perforce client-server protocol is not designed to support
206+
The P4 client-server protocol is not designed to support
200207
multiple concurrent queries over the same connection. For this
201-
reason, multi-threaded applications using the C++ API or the
208+
reason, multi-threaded applications using the P4 C/C++ API or the
202209
script APIs (P4Perl, P4Ruby, etc.) should ensure that a
203210
separate connection is used for each thread or that only one
204211
thread may use a shared connection at a time.
@@ -212,7 +219,7 @@ Compatibility Statements
212219

213220
Attributes
214221

215-
Perforce P4Python provides the attributes listed below. Attributes
222+
P4Python provides the attributes listed below. Attributes
216223
can be set in the P4() constructor or by using their setters and
217224
getters. For example:
218225

@@ -277,7 +284,7 @@ Attributes
277284

278285
Tagged mode and form parsing
279286

280-
In Perforce P4Python 2007.3 and later, form parsing and tagged
287+
In P4Python 2007.3 and later, form parsing and tagged
281288
output are enabled by default. (In Public Depot P4Python,
282289
tagged output and form parsing mode were disabled by default,
283290
but most scripts enabled them immediately.)
@@ -297,8 +304,36 @@ Tagged mode and form parsing
297304
Key to symbols used in change notes below.
298305

299306
* -- requires new P4Python
300-
** -- requires new p4d server program
301-
*** -- requires new P4API
307+
** -- requires new P4 server program
308+
*** -- requires new P4 C/C++ API
309+
310+
--------------------------------------------------------------------------
311+
312+
New functionalities in 2025.1 (2025.1/2767466) (2025/05/21)
313+
314+
#2757777 (Job #125785)
315+
Built P4Python with P4 C/C++ API 2025.1 (2025.1/2761706)
316+
317+
Bugs fixed in 2025.1
318+
319+
#2744582 (Job #123978)
320+
Eliminated hardcoded bash paths, improving portability and flexibility.
321+
Replaced shell=True with safer subprocess calls using command lists.
322+
323+
#2743827 (Job #124153)
324+
Updated P4Python build behavior to disable silent OPENSSL installation.
325+
Users must now explicitly set the env variable "P4PYTHON_BUILD_SSL=yes"
326+
to enable OPENSSL support during build.
327+
If enabled, OPENSSL sources will be downloaded from the HTTPS-based
328+
URL: https://www.openssl.org/source.
329+
Added the support to build P4Python with OPENSSL 3.x.
330+
331+
#2705918 (Job #124154)
332+
Change auto_ptr into unique_ptr as auto_ptr is obsoleted from C++11.
333+
334+
#2743928 (Job #124332)
335+
Fixed exponential rise of the time needed to run p4.run_print() with
336+
growing file size.
302337

303338
--------------------------------------------------------------------------
304339

SpecMgr.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2424
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
26-
$Id: //depot/main/p4-python/SpecMgr.cpp#58 $
26+
$Id: //depot/main/p4-python/SpecMgr.cpp#59 $
2727
*******************************************************************************/
2828

2929
/*******************************************************************************
@@ -60,7 +60,7 @@ struct specdata {
6060
const char *type;
6161
const char *spec;
6262
} speclist[] = {
63-
63+
6464
{
6565
"branch",
6666
"Branch;code:301;rq;ro;fmt:L;len:32;;"
@@ -140,6 +140,7 @@ struct specdata {
140140
"MaxOpenFiles;code:413;type:word;len:12;;"
141141
"MaxMemory;code:NNN;type:word;len:12;;"
142142
"Timeout;code:406;type:word;len:12;;"
143+
"IdleTimeout;code:NNN;type:word;len:12;;"
143144
"PasswordTimeout;code:409;type:word;len:12;;"
144145
"LdapConfig;code:410;type:line;len:128;;"
145146
"LdapSearchQuery;code:411;type:line;len:128;;"

Version

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# SUPPDATE = 2010 06 17 ;
1212
# Of the build. The copyright date is derived from SUPPDATE.
1313

14-
RELEASE = 2024 2;
15-
PATCHLEVEL = 2676807 ;
16-
SUPPDATE = 2024 11 07 ;
14+
RELEASE = 2025 1;
15+
PATCHLEVEL = 2756918 ;
16+
SUPPDATE = 2025 02 05 ;
1717

build.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,37 @@
3434
export apidir=<Perforce C++ API absolute path>
3535
export ssl=<OpenSSL library path>
3636
```
37+
38+
5. **[Optional] Control SSL Build Behavior**
39+
40+
By default, if SSL is not available in the root environment, P4Python will attempt to build SSL silently during installation.
41+
Since `pip install` is non-interactive, users cannot choose whether to build SSL or not during the process.
42+
43+
To explicitly control this behavior, you can use the `P4PYTHON_BUILD_SSL` environment variable as a prefix to the install command:
44+
45+
- If set to `"no"`, the build process will skip building SSL.
46+
- If set to `"yes"`, the build process will proceed to build SSL if needed.
47+
- If not set, the default is `"no"` (SSL will not be built).
48+
49+
**Example usage:**
50+
```
51+
P4PYTHON_BUILD_SSL=yes python3 -m pip install .
52+
```
3753
38-
5. To install P4Python, execute the following command from P4Python source code directory:
54+
6. To install P4Python, execute the following command from P4Python source code directory:
3955
4056
```
4157
python3 -m pip install .
4258
```
4359
**Note:** In order to cleanly reinstall P4Python, remove the directory named "build".
4460
45-
6. To test your P4Python install, execute p4test.py:
61+
7. To test your P4Python install, execute p4test.py:
4662
```
4763
python3 p4test.py
4864
```
4965
**Note:** This test requires the Perforce server executable p4d 17.1 or better to be installed and in the PATH.
5066
51-
7. To build P4Python wheel, execute the following command:
67+
8. To build P4Python wheel, execute the following command:
5268
5369
```
5470
python3 -m pip wheel . -w dist

linux_build/build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -eEx
33
ARCH=$(arch)
44

p4test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def resolve(self, mergeData):
508508
return "at"
509509

510510
def actionResolve(self, mergeData):
511-
self.t.assertEqual(mergeData.merge_action, "(text+wx)",
511+
self.t.assertEqual(mergeData.merge_action, "(text+Dwx)",
512512
"Unexpected mergeAction: '%s'" % mergeData.merge_action )
513513
self.t.assertEqual(mergeData.yours_action, "(text+w)",
514514
"Unexpected mergeAction: '%s'" % mergeData.yours_action )

0 commit comments

Comments
 (0)