Skip to content

Update P4 C++ API and PerforcePlugin infrastructure #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

SRombautsU
Copy link
Contributor

@SRombautsU SRombautsU commented Jul 23, 2025

This is a Work In Progress to simplify, fix and document how the P4 C++ API are downloaded and linked into the PerforcePlugin

Perhaps the most notable change 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. => WIP updating the API from r19.1 to 2021.2 (the minimum for cloud support) to 2025.1 (the latest)
  2. => WIP fix CI to fail, and disable login2 failing test
  3. update the OpenSSL lib from deprecated 1.0.1 to 1.1.1w (eol 2023) to 3.x (the only one supported)
  4. update Visual Studio from 2010 to 2019 (max for p4api 2021.2) - might skip this stage !
  5. update the API to 2023.2 (the first with support VS2022)
  6. update Visual Studio to 2022 (the only one supported) - require p4api 2023.2
  7. update the API to 2024.1 ?

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
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.

1 participant