Skip to content

Conversation

@SRombautsU
Copy link
Contributor

@SRombautsU SRombautsU commented Jul 23, 2025

VCS-1007369 [PerforcePlugin] rebuild with P4 API 2021.2/2201121 and test with Perforce Cloud

Simplify, fix infrastructure, and document how the P4 C++ API are downloaded and linked into the PerforcePlugin

"Your client does not support Helix Core Cloud. Upgrade to version 2021.2/2201121 or later"
Perforce plugin unusable with a Perforce Helix Core Cloud server #23

When trying to connect to our newly set up Perforce Helix Core Cloud server I get the following error: "Your client does not support Helix Core Cloud. Upgrade to version 2021.2/2201121 or later". The server then rejects the connection completely, making the Perforce plugin unusable. From what I can tell, the version of the P4 API included in the plugin right now is still 2019.1.

While troubleshooting I found a community maintained updated version of the Perforce plugin in a repo over on the Perforce GH org: https://github.com/perforce/unity-p4-plugin. This alternative plugin has worked for me but requires overwriting the plugin executable included in the Unity Editor install directory, which is not ideal. It also seems to not be under the same license so maybe that's why they didn't want to upstream the changes? Not sure.

In any case it would be good if the P4 API was updated here so that Helix Core Cloud servers would be supported OOTB.

The only change in the code itself is that now the plugin has a version number, and log it and the P4 API:

UNITY > c:pluginConfig end
Got config end = ''
PerforcePlugin 1.2.1
Client API: 86
Client Build: P4API/NTX86/2019.1/2135798
Perforce password is empty. Ignoring login request.
v1:'login' not necessary, no password set for this user.
Is logged in: yes
spec::Run()
v1:client -o "unity-perforce_3G4NJ84" 

From these more solid foundations, I'll want to update one thing without changing anything, and testing if it still works as expected, then moving to the next (stopping when it breaks or doesn't bring any more value):

  1. (this task) add a version to the plugin, and log them
  2. (this task) cleanup Perl build and test scripts
  3. (this task) fix CI to fail on failures (!), and disable login2 failing test
  4. (this task) update the API from r19.1 to 2021.2 (the minimum for cloud support) to 2025.1 (the latest)
  5. (future) update Visual Studio from 2010 to 2019 (max for p4api 2021.2)
  6. (future) update the OpenSSL lib from deprecated 1.0.1 to 1.1.1w (eol 2023) to 3.x (the only one supported)
  7. (future) update the API to 2023.2 (the first with support VS2022)
  8. (future) update Visual Studio to 2022 (the only one supported) - require p4api 2023.2
  9. (future) update the API to 2024.1 (latest community supported)?
  10. (future) update the API to 2025.1 (FAILED)

from a versioned P4Plugin/Source/r19.1/ to a generic P4Plugin/Source/p4api

Build scripts where adjusted one last time with the new path

This allow to update the API in places without making other changes
and while make it trivial to keep the history of these files
They are not used by CI for the builds.zip artifacts (and not shipped with the Unity Editor)
@SRombautsU SRombautsU force-pushed the update-p4api branch 2 times, most recently from e8621dd to c09e19e Compare July 23, 2025 14:25
@SRombautsU SRombautsU self-assigned this Jul 23, 2025
@SRombautsU SRombautsU changed the title Update p4api Update P4 C++ API and PerforcePlugin infrastructure Jul 23, 2025
@SRombautsU SRombautsU force-pushed the update-p4api branch 2 times, most recently from d3614d4 to 0842e1a Compare July 24, 2025 16:51
from P4Plugin/Source/p4api/lib/xxx to P4Plugin/Source/openssl/lib/xxx

Moreover, the libeay32.lib and ssleay32.lib for Win32 where duplicated for Win32Debug
Setup correctly for Perl scripts (tabs) and Yamato Yaml job (2 spaces)
Also convert spaces to tabs as per Makefile standard
Added a little backward changelog

1.0.x Initial versions from long ago
1.1.0 2022/02/10 Support TLSv1.2 in Perforce Plugin
1.2.0 2022/08/05 Added MFA login2 support
1.2.1 2024/03/15 Fix login failure license about to expire
No risk in getting rid of these (it's not even the plugin) and this makes the build log much cleaner
Before I start to make actual modifications
@SRombautsU SRombautsU force-pushed the update-p4api branch 7 times, most recently from 6559549 to 35203eb Compare July 25, 2025 11:20
@SRombautsU SRombautsU force-pushed the update-p4api branch 2 times, most recently from 38ac5d4 to 3cc647b Compare July 25, 2025 12:40
The issue is that the logs are piped using `tee` to create a clean log file
See for instance:

   perl build.pl | tee linux_build.txt

That's the wrong idea in the first place, the logs in Yamato have colors, are searchable etc.

I initially provided a complex solution
(Using Bash set -o pipefail to fail the whole pipeline if the first command file, and PowerShell $LASTEXITCODE to fail in case of an error)
but I believe the simplicity here should be the key
Don't return on the first test failure in a suite, count the failures
Don't exit 1 on the first PerforceIntegrationTests() failure, add the failures

Count the number of tests passed, ignored/filtered ones
Display progresse with prefixes for the test suite and the test in it:
[5-7][2/13] Running test 'xxx.txt'
[5-7] Success: 13 of 13 tests passed.

Add extra empty lines for readability of the logs
@SRombautsU SRombautsU force-pushed the update-p4api branch 2 times, most recently from dd28005 to 59d0d07 Compare July 25, 2025 13:21
Remove Mercurial steps to download the PerforceBinaries

hg clone --config extensions.largefiles= http://hg-mirror-slo.hq.unity3d.com/unity-extra/perforce PerforceBinaries

Submit a copy of the p4 & p4d binaries downloaded alongside the static libraries from https://filehost.perforce.com/perforce/r19.1

This is the correct way to manage dependencies (especially if we want to have branches using different versions) allowing to update it more easily to match the version of the p4api

It will allow us to update to any Bokken image that wouldn't have Mercurial "hg" installed
@SRombautsU SRombautsU changed the title Update P4 C++ API and PerforcePlugin infrastructure Update P4 C++ API to P4 API 2021.2/2201121 and PerforcePlugin infrastructure Jul 27, 2025
@SRombautsU SRombautsU marked this pull request as ready for review July 27, 2025 17:09
@SRombautsU SRombautsU requested a review from juliomaqueda July 27, 2025 17:21
@SRombautsU SRombautsU changed the title Update P4 C++ API to P4 API 2021.2/2201121 and PerforcePlugin infrastructure Update P4 C++ API to 2021.2/2201121 and PerforcePlugin infrastructure Jul 28, 2025
2025/07/29 P4 API 2021.2 for Perforce Cloud
@SRombautsU SRombautsU merged commit 3ecc549 into master Jul 30, 2025
8 checks passed
@SRombautsU SRombautsU deleted the update-p4api branch July 30, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants