From b3dd6b78f6fed2604d19e59911ba19e66dc50152 Mon Sep 17 00:00:00 2001 From: David Rogers Date: Fri, 22 Aug 2025 12:36:57 -0500 Subject: [PATCH 1/4] Update to 24.1, openssl 3, windows x64 binaries and building macOS arm64 --- .gitignore | 6 + Makefile.osx | 21 ++- P4Plugin/Source/openssl/lib/osx64/libcrypto.a | 4 +- P4Plugin/Source/openssl/lib/osx64/libssl.a | 4 +- .../Source/openssl/lib/osxarm64/libcrypto.a | 3 + P4Plugin/Source/openssl/lib/osxarm64/libssl.a | 3 + P4Plugin/Source/p4api/README.md | 10 +- P4Plugin/Source/p4api/include/p4/clientapi.h | 4 +- P4Plugin/Source/p4api/include/p4/clientprog.h | 2 + .../Source/p4api/include/p4/clientscript.h | 14 +- P4Plugin/Source/p4api/include/p4/clientuser.h | 9 ++ P4Plugin/Source/p4api/include/p4/datetime.h | 43 +++--- P4Plugin/Source/p4api/include/p4/debug.h | 119 ++++++++++++++--- .../Source/p4api/include/p4/dmextension.h | 3 +- P4Plugin/Source/p4api/include/p4/error.h | 23 +++- P4Plugin/Source/p4api/include/p4/errornum.h | 1 + P4Plugin/Source/p4api/include/p4/filesys.h | 78 +++++++---- P4Plugin/Source/p4api/include/p4/ignore.h | 12 +- .../Source/p4api/include/p4/malloc_override.h | 8 +- P4Plugin/Source/p4api/include/p4/md5.h | 6 + P4Plugin/Source/p4api/include/p4/msgclient.h | 14 ++ P4Plugin/Source/p4api/include/p4/msgdb.h | 16 +++ P4Plugin/Source/p4api/include/p4/msgdm2.h | 111 +++++++++++++++- P4Plugin/Source/p4api/include/p4/msggraph.h | 2 + P4Plugin/Source/p4api/include/p4/msghelp.h | 6 +- P4Plugin/Source/p4api/include/p4/msglbr.h | 16 ++- P4Plugin/Source/p4api/include/p4/msgos.h | 3 + P4Plugin/Source/p4api/include/p4/msgrpc.h | 5 + P4Plugin/Source/p4api/include/p4/msgserver2.h | 123 +++++++++++++++++- P4Plugin/Source/p4api/include/p4/msgsupp.h | 48 +++++++ P4Plugin/Source/p4api/include/p4/netbuffer.h | 2 + P4Plugin/Source/p4api/include/p4/netconnect.h | 3 + P4Plugin/Source/p4api/include/p4/options.h | 47 ++++++- P4Plugin/Source/p4api/include/p4/p4libs.h | 8 +- P4Plugin/Source/p4api/include/p4/p4tags.h | 94 ++++++++++++- P4Plugin/Source/p4api/include/p4/pathsys.h | 17 +-- P4Plugin/Source/p4api/include/p4/runcmd.h | 4 +- P4Plugin/Source/p4api/include/p4/sanitizers.h | 31 +++-- P4Plugin/Source/p4api/include/p4/sha1.h | 2 + P4Plugin/Source/p4api/include/p4/sha256.h | 2 + P4Plugin/Source/p4api/include/p4/stdhdrs.h | 121 ++++++++++++++--- P4Plugin/Source/p4api/include/p4/strarray.h | 2 + P4Plugin/Source/p4api/include/p4/strbuf.h | 76 ++++++++--- P4Plugin/Source/p4api/include/p4/strdict.h | 34 ++++- P4Plugin/Source/p4api/include/p4/strops.h | 2 + P4Plugin/Source/p4api/include/p4/strtable.h | 8 +- P4Plugin/Source/p4api/include/p4/threading.h | 10 ++ P4Plugin/Source/p4api/include/p4/vararray.h | 7 +- P4Plugin/Source/p4api/include/p4/web822.h | 3 + P4Plugin/Source/p4api/lib/linux64/libclient.a | 4 +- P4Plugin/Source/p4api/lib/linux64/libp4api.a | 4 +- .../Source/p4api/lib/linux64/libp4script.a | 4 +- .../Source/p4api/lib/linux64/libp4script_c.a | 4 +- .../p4api/lib/linux64/libp4script_cstub.a | 3 + .../p4api/lib/linux64/libp4script_curl.a | 2 +- .../p4api/lib/linux64/libp4script_sqlite.a | 2 +- P4Plugin/Source/p4api/lib/linux64/librpc.a | 4 +- P4Plugin/Source/p4api/lib/linux64/libsupp.a | 4 +- P4Plugin/Source/p4api/lib/osx64/libclient.a | 4 +- P4Plugin/Source/p4api/lib/osx64/libp4api.a | 4 +- P4Plugin/Source/p4api/lib/osx64/libp4script.a | 4 +- .../Source/p4api/lib/osx64/libp4script_c.a | 4 +- .../p4api/lib/osx64/libp4script_cstub.a | 3 + .../Source/p4api/lib/osx64/libp4script_curl.a | 4 +- .../p4api/lib/osx64/libp4script_sqlite.a | 4 +- P4Plugin/Source/p4api/lib/osx64/librpc.a | 4 +- P4Plugin/Source/p4api/lib/osx64/libsupp.a | 4 +- .../Source/p4api/lib/osxarm64/libclient.a | 3 + P4Plugin/Source/p4api/lib/osxarm64/libp4api.a | 3 + .../Source/p4api/lib/osxarm64/libp4script.a | 3 + .../Source/p4api/lib/osxarm64/libp4script_c.a | 3 + .../p4api/lib/osxarm64/libp4script_cstub.a | 3 + .../p4api/lib/osxarm64/libp4script_curl.a | 3 + .../p4api/lib/osxarm64/libp4script_sqlite.a | 3 + P4Plugin/Source/p4api/lib/osxarm64/librpc.a | 3 + P4Plugin/Source/p4api/lib/osxarm64/libsupp.a | 3 + P4Plugin/Source/p4api/lib/win32/libclient.lib | 4 +- P4Plugin/Source/p4api/lib/win32/libp4api.lib | 4 +- .../Source/p4api/lib/win32/libp4script.lib | 4 +- .../Source/p4api/lib/win32/libp4script_c.lib | 4 +- .../p4api/lib/win32/libp4script_cstub.lib | 3 + .../p4api/lib/win32/libp4script_curl.lib | 4 +- .../p4api/lib/win32/libp4script_sqlite.lib | 4 +- P4Plugin/Source/p4api/lib/win32/librpc.lib | 4 +- P4Plugin/Source/p4api/lib/win32/libsupp.lib | 4 +- .../Source/p4api/lib/win32debug/libclient.lib | 4 +- .../Source/p4api/lib/win32debug/libp4api.lib | 4 +- .../p4api/lib/win32debug/libp4script.lib | 4 +- .../p4api/lib/win32debug/libp4script_c.lib | 4 +- .../lib/win32debug/libp4script_cstub.lib | 3 + .../p4api/lib/win32debug/libp4script_curl.lib | 4 +- .../lib/win32debug/libp4script_sqlite.lib | 4 +- .../Source/p4api/lib/win32debug/librpc.lib | 4 +- .../Source/p4api/lib/win32debug/libsupp.lib | 4 +- PerforceBinaries/OSX/arm64/p4 | 3 + PerforceBinaries/OSX/arm64/p4d | 3 + PerforceBinaries/OSX/p4 | 3 - PerforceBinaries/OSX/p4d | 3 - PerforceBinaries/OSX/x86_64/p4 | 3 + PerforceBinaries/OSX/x86_64/p4d | 3 + PerforceBinaries/Win_x64/p4.exe | 4 +- PerforceBinaries/Win_x64/p4d.exe | 4 +- PerforceBinaries/linux64/p4 | 4 +- PerforceBinaries/linux64/p4d | 4 +- README.md | 8 +- build.pl | 44 +++++-- download_perforce_binaries.ps1 | 14 +- 107 files changed, 1181 insertions(+), 272 deletions(-) create mode 100644 P4Plugin/Source/openssl/lib/osxarm64/libcrypto.a create mode 100644 P4Plugin/Source/openssl/lib/osxarm64/libssl.a create mode 100644 P4Plugin/Source/p4api/lib/linux64/libp4script_cstub.a create mode 100644 P4Plugin/Source/p4api/lib/osx64/libp4script_cstub.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libclient.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libp4api.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libp4script.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libp4script_c.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libp4script_cstub.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libp4script_curl.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libp4script_sqlite.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/librpc.a create mode 100644 P4Plugin/Source/p4api/lib/osxarm64/libsupp.a create mode 100644 P4Plugin/Source/p4api/lib/win32/libp4script_cstub.lib create mode 100644 P4Plugin/Source/p4api/lib/win32debug/libp4script_cstub.lib create mode 100755 PerforceBinaries/OSX/arm64/p4 create mode 100755 PerforceBinaries/OSX/arm64/p4d delete mode 100644 PerforceBinaries/OSX/p4 delete mode 100644 PerforceBinaries/OSX/p4d create mode 100755 PerforceBinaries/OSX/x86_64/p4 create mode 100755 PerforceBinaries/OSX/x86_64/p4d mode change 100644 => 100755 PerforceBinaries/linux64/p4 mode change 100644 => 100755 PerforceBinaries/linux64/p4d diff --git a/.gitignore b/.gitignore index d8f0ba0..b945119 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,9 @@ server.pid # JetBrains IDEs files .idea/ + +# macOS file information +**.DS_Store + +# Object files +***.o \ No newline at end of file diff --git a/Makefile.osx b/Makefile.osx index a0c5192..4531e9f 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -1,12 +1,18 @@ include Makefile.srcs -CC = gcc -CXX = g++ +CC = clang +CXX = clang AR = ar -CXXFLAGS = -O2 -arch x86_64 -mmacosx-version-min=10.11 -LDFLAGS = -arch x86_64 -lstdc++ -mmacosx-version-min=10.11 -PLATFORM = OSXx64 +ifeq ($(BUILD_TARGET),P4PluginX64) + PLATFORM = OSXx64 + CXXFLAGS = -O2 -arch x86_64 -mmacosx-version-min=10.11 + LDFLAGS = -L./P4Plugin/Source/p4api/lib/osx64 -L./P4Plugin/Source/openssl/lib/osx64 -arch x86_64 -lstdc++ -mmacosx-version-min=10.11 +else + PLATFORM = OSXarm64 + CXXFLAGS = -O2 -arch arm64 -mmacosx-version-min=12.0 + LDFLAGS = -L./P4Plugin/Source/p4api/lib/osxarm64 -L./P4Plugin/Source/openssl/lib/osxarm64 -arch arm64 -lstdc++ -mmacosx-version-min=12.0 +endif COMMON_MODULES = $(COMMON_SRCS:.c=.o) COMMON_MODULES := $(COMMON_MODULES:.cpp=.o) @@ -53,7 +59,10 @@ $(TESTSERVER_TARGET): $(COMMON_MODULES) $(TESTSERVER_MODULES) $(CXX) -g $(LDFLAGS) -o $@ $^ $(P4PLUGIN_TARGET): $(COMMON_MODULES) $(P4PLUGIN_MODULES) - $(CXX) $(LDFLAGS) -o $@ -framework Cocoa -framework Security $^ -L./P4Plugin/Source/p4api/lib/osx64 -L./P4Plugin/Source/openssl/lib/osx64 $(P4PLUGIN_LINK) + $(CXX) $(LDFLAGS) -o $@ -framework Cocoa -framework Security $^ $(P4PLUGIN_LINK) + +clean-objs: + rm -f $(COMMON_MODULES) $(P4PLUGIN_MODULES) $(TESTSERVER_MODULES) clean: rm -f Build/*.* $(COMMON_MODULES) $(P4PLUGIN_MODULES) $(TESTSERVER_MODULES) diff --git a/P4Plugin/Source/openssl/lib/osx64/libcrypto.a b/P4Plugin/Source/openssl/lib/osx64/libcrypto.a index fe11017..6e97bdd 100644 --- a/P4Plugin/Source/openssl/lib/osx64/libcrypto.a +++ b/P4Plugin/Source/openssl/lib/osx64/libcrypto.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b01905a3a24fdafd6b0f7f77aa32a436521e4ff40c39b8f4e95fd281332ff7d1 -size 3153152 +oid sha256:f2d1b7f6b4ea2853b3925c9959f17057ea675d91c206e77e41e0df3c0fa9bd12 +size 8622264 diff --git a/P4Plugin/Source/openssl/lib/osx64/libssl.a b/P4Plugin/Source/openssl/lib/osx64/libssl.a index bc85874..a064295 100644 --- a/P4Plugin/Source/openssl/lib/osx64/libssl.a +++ b/P4Plugin/Source/openssl/lib/osx64/libssl.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e61a50ceea2648f74c1122075cb628e3489cc7b3ab18c193b8144ea2dbe2b94a -size 510136 +oid sha256:c38b0e7228dac81cbb3e4787cb0d47021f24954bc5747851574e64ab64f73990 +size 1419904 diff --git a/P4Plugin/Source/openssl/lib/osxarm64/libcrypto.a b/P4Plugin/Source/openssl/lib/osxarm64/libcrypto.a new file mode 100644 index 0000000..de71958 --- /dev/null +++ b/P4Plugin/Source/openssl/lib/osxarm64/libcrypto.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f80abc55cf2a78d4d0f3c04bbe1e8566df9c8f4b5fe5260e639e0ed90b980102 +size 8315896 diff --git a/P4Plugin/Source/openssl/lib/osxarm64/libssl.a b/P4Plugin/Source/openssl/lib/osxarm64/libssl.a new file mode 100644 index 0000000..e961144 --- /dev/null +++ b/P4Plugin/Source/openssl/lib/osxarm64/libssl.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37a81d0f3bde7512c84c57deb7167ab5992867d17039023f4aa1ef805f3cfef6 +size 1456608 diff --git a/P4Plugin/Source/p4api/README.md b/P4Plugin/Source/p4api/README.md index 4099f35..4641bd4 100644 --- a/P4Plugin/Source/p4api/README.md +++ b/P4Plugin/Source/p4api/README.md @@ -1,15 +1,15 @@ Document the links from where the P4 C++ API (include files and static libraries) where downloaded: -https://filehost.perforce.com/perforce/r21.2/ p4api-2021.2.2536545 +https://filehost.perforce.com/perforce/r24.1/ p4api-2024.1.2805613 Notes: see also download_perforce_binaries.ps1 # linux64 -- https://filehost.perforce.com/perforce/r21.2/bin.linux26x86_64/p4api-glibc2.3-openssl1.0.2.tgz +- https://filehost.perforce.com/perforce/r24.1/bin.linux26x86_64/p4api-glibc2.3-openssl3.tgz # osx64 -- https://filehost.perforce.com/perforce/r21.2/bin.macosx105x86_64/p4api-openssl1.0.2.tgz +- https://filehost.perforce.com/perforce/r24.1/bin.macosx105x86_64/p4api-openssl3.tgz # Win32 -- https://filehost.perforce.com/perforce/r21.2/bin.ntx86/p4api_vs2019_static_openssl1.0.2.zip -- https://filehost.perforce.com/perforce/r21.2/bin.ntx86/p4api_vs2019_static_vsdebug_openssl1.0.2.zip +- https://filehost.perforce.com/perforce/r24.1/bin.ntx86/p4api_vs2019_static_openssl3.zip +- https://filehost.perforce.com/perforce/r24.1/bin.ntx86/p4api_vs2019_static_vsdebug_openssl3.zip diff --git a/P4Plugin/Source/p4api/include/p4/clientapi.h b/P4Plugin/Source/p4api/include/p4/clientapi.h index 339a1d9..7eef4ca 100644 --- a/P4Plugin/Source/p4api/include/p4/clientapi.h +++ b/P4Plugin/Source/p4api/include/p4/clientapi.h @@ -255,6 +255,7 @@ class ClientApi : public StrDict { const StrArray *GetConfigs(); const StrPtr &GetBuild(); const StrPtr &GetVersion(); + Error * GetTransError(); Enviro * GetEnviro(); Ignore * GetIgnore(); @@ -270,7 +271,7 @@ class ClientApi : public StrDict { bool ExtensionsEnabled(); void SetExtension( ClientScript* cs, Error* e, const bool callerOwns = false ); - + void EnableDebugHooks(); public: // The old interface, where ui was held from the start @@ -288,6 +289,7 @@ class ClientApi : public StrDict { StrPtr *VGetVar( const StrPtr &var ); void VSetVar( const StrPtr &var, const StrPtr &val ); + int VGetCount(); private: Client *client; // wrapped up RPC diff --git a/P4Plugin/Source/p4api/include/p4/clientprog.h b/P4Plugin/Source/p4api/include/p4/clientprog.h index 3272649..e072627 100644 --- a/P4Plugin/Source/p4api/include/p4/clientprog.h +++ b/P4Plugin/Source/p4api/include/p4/clientprog.h @@ -16,6 +16,7 @@ #define CPU_FILES 2 #define CPU_KBYTES 3 #define CPU_MBYTES 4 +#define CPU_DELTAS 5 class ClientProgress { @@ -49,5 +50,6 @@ class ClientProgressText : public ClientProgress int backup; StrBuf desc; bool done; + int units; }; diff --git a/P4Plugin/Source/p4api/include/p4/clientscript.h b/P4Plugin/Source/p4api/include/p4/clientscript.h index 9834c74..faac2fc 100644 --- a/P4Plugin/Source/p4api/include/p4/clientscript.h +++ b/P4Plugin/Source/p4api/include/p4/clientscript.h @@ -6,12 +6,18 @@ # ifdef HAS_EXTENSIONS +// This enum represents the result of a client-side Extension function. + enum class ClientScriptAction { - UNKNOWN, - FAIL, - PASS, - REPLACE + UNKNOWN, // Script misbehaving / crashed / etc. + FAIL, // Script says 'no'. + PASS, // Script says 'ok'. + REPLACE, // Script does something instead of what would happen. + PRE_DEBUG, // Non-functional divider between normal user-facing + // scripts and internal debug code. + ABORT, // Tell the caller to abort or otherwise exit immediately. + EARLY_RETURN // Tell the caller to return control to its parent func. }; class ClientScript diff --git a/P4Plugin/Source/p4api/include/p4/clientuser.h b/P4Plugin/Source/p4api/include/p4/clientuser.h index 964f549..01e9178 100644 --- a/P4Plugin/Source/p4api/include/p4/clientuser.h +++ b/P4Plugin/Source/p4api/include/p4/clientuser.h @@ -106,6 +106,10 @@ class ClientTransfer; class ClientSSO; class ClientApi; +# ifdef HAS_CPP11 +# include +# endif + class ClientUser { public: @@ -163,6 +167,9 @@ class ClientUser { virtual void Finished() {} + void SetVarList( StrDict *l ); + void SetEnviro( Enviro *env ); + StrDict *varList; // (cheesy) access to RPC buffer Enviro *enviro; // (cheesy) access to Client's env @@ -210,6 +217,8 @@ class ClientUser { int quiet; // OutputInfo does nothing. int autoLogin; // Can this implementation autoprompt + void* setterGuard; // Setter mutex when built with C++11+ + protected: int outputCharset; // P4CHARSET for output StrBuf editFile; diff --git a/P4Plugin/Source/p4api/include/p4/datetime.h b/P4Plugin/Source/p4api/include/p4/datetime.h index 6e7824b..5ae6968 100644 --- a/P4Plugin/Source/p4api/include/p4/datetime.h +++ b/P4Plugin/Source/p4api/include/p4/datetime.h @@ -24,11 +24,11 @@ class DateTime { DateTime( const char *date, Error *e ) { Set( date, e ); } void Set( const char *date, Error *e ); - void Set( const int date ) { wholeDay = 0; tval = (time_t)date; } + void Set( const P4INT64 date ) { wholeDay = 0; tval = (time_t)date; } void SetNow() { Set( (int)Now() ); } - int Compare( const DateTime &t2 ) const { - return (int)(tval - t2.tval); }; + P4INT64 Compare( const DateTime &t2 ) const { + return (tval - t2.tval); }; void Fmt( char *buf ) const; void FmtDay( char *buf ) const; @@ -38,31 +38,34 @@ class DateTime { void FmtElapsed( char *buf, const DateTime &t2 ); void FmtUnifiedDiff( char *buf ) const; void FmtISO8601( char *buf ) const; + void FmtISO8601Min( char *buf ) const; + + void SetRFC5322( const char *date, Error *e ); + void FmtRFC5322( char *buf ) const; void SetGit( const StrPtr &gitDate, Error *e ); void FmtGit( StrBuf &buf ) const; - int Value() const { return (int)tval; } - int Tomorrow() const { return (int)tval + 24*60*60; } + P4INT64 Value() const { return tval; } + P4INT64 Tomorrow() const { return tval + 24*60*60; } int IsWholeDay() const { return wholeDay; } - static int Never() { return 0; } - static int Forever() { return 2147483647; } + static P4INT64 Never() { return 0; } // for stat() and utime() conversion - static time_t Localize( time_t centralTime ); - static time_t Centralize( time_t localTime ); - int TzOffset( int *isdst = 0 ) const; + static P4INT64 Localize( time_t centralTime ); + static P4INT64 Centralize( time_t localTime ); + P4INT64 TzOffset( int *isdst = 0 ) const; protected: - time_t Now(); + P4INT64 Now(); private: - time_t tval; + P4INT64 tval; int wholeDay; - int ParseOffset( const char *s, const char *odate, Error *e ); + P4INT64 ParseOffset( const char *s, const char *odate, Error *e ); }; class DateTimeNow : public DateTime { @@ -84,7 +87,7 @@ class DateTimeHighPrecision public: // Orthodox Canonical Form (OCF) methods (we don't need a dtor) - DateTimeHighPrecision(time_t secs = 0, int nsecs = 0) + DateTimeHighPrecision(P4INT64 secs = 0, int nsecs = 0) : seconds( secs ), nanos( nsecs ) { } DateTimeHighPrecision(const DateTimeHighPrecision &rhs) @@ -125,9 +128,10 @@ class DateTimeHighPrecision void Now(); void Fmt( char *buf ) const; + void FmtISO8601( char *buf ) const; - time_t Seconds() const; - int Nanos() const; + P4INT64 Seconds() const; + P4INT64 Nanos() const; bool IsZero() const { return seconds == 0 && nanos == 0; } @@ -138,11 +142,12 @@ class DateTimeHighPrecision // return < 0, = 0, or > 0 if *this < rhs, *this == rhs, or *this > rhs, respectively int Compare( const DateTimeHighPrecision &rhs ) const; - private: - P4INT64 ToNanos() const; + P4INT64 ToMs() const; + + private: - time_t seconds; // Since 1/1/1970, natch + P4INT64 seconds; // Since 1/1/1970, natch int nanos; } ; diff --git a/P4Plugin/Source/p4api/include/p4/debug.h b/P4Plugin/Source/p4api/include/p4/debug.h index 44e5b4a..74c9405 100644 --- a/P4Plugin/Source/p4api/include/p4/debug.h +++ b/P4Plugin/Source/p4api/include/p4/debug.h @@ -19,6 +19,7 @@ class StrPtr; class StrBuf; class ErrorLog; class Error; +struct ErrorId; enum P4DebugType { DT_DB, // DbOpen @@ -58,7 +59,12 @@ enum P4DebugType { DT_HEARTBEAT, // Heartbeat related DT_SHELVE, // Shelving related DT_SQW, // StreamQWorker related + DT_STM, // Stream materialize for fstat,files,dirs + DT_PCHECK, // Parallel checkpoint DT_TOPOLOGY, // Topology + DT_RESOURCE, // OS resources + DT_S3, // S3 cURL client + DT_SUPTOOLS, // Support Tools DT_LAST } ; @@ -66,13 +72,90 @@ enum P4TunableType { DTT_NONE, // Unknown tuneable DTT_INT, // Numeric tuneable DTT_STR, // String tuneable -}; +} ; + +enum P4TunableApplicability { + CONFIG_APPLY_NONE = 0x0000, + CONFIG_APPLY_CLIENT = 0x0001, + CONFIG_APPLY_SERVER = 0x0002, + CONFIG_APPLY_PROXY = 0x0004, + CONFIG_APPLY_BROKER = 0x0008 + // When you add new types, update the string array in userconfig.cc +} ; + +enum P4TunableRestart { + CONFIG_RESTART_NONE, + CONFIG_RESTART_NO_RESTART, + CONFIG_RESTART_RESTART, + CONFIG_RESTART_STOP, + CONFIG_RESTART_REF_DOC + // When you add new types, update the string array in userconfig.cc +} ; + +enum P4TunableSupport { + CONFIG_SUPPORT_NONE, + CONFIG_SUPPORT_NODOC, + CONFIG_SUPPORT_UNDOC, + CONFIG_SUPPORT_DOC + // When you add new types, update the string array in userconfig.cc +} ; + +enum P4TunableCategory { + CONFIG_CAT_NONE = 0x0000, + CONFIG_CAT_MISC = 0x0001, + CONFIG_CAT_SECURITY = 0x0002, + CONFIG_CAT_STREAMS = 0x0004, + CONFIG_CAT_REPLICATION = 0x0008, + CONFIG_CAT_NETWORK = 0x0010, + CONFIG_CAT_PERFORMANCE = 0x0020, + CONFIG_CAT_MONITORING = 0x0040, + CONFIG_CAT_TRIGGERS = 0x0080, + CONFIG_CAT_EXTENSIONS = 0x0100, + CONFIG_CAT_LICENSING = 0x0200, + CONFIG_CAT_ARCHIVE_MANAGEMENT = 0x0400, + CONFIG_CAT_DVCS = 0x0800 + // When you add new types, update the string array in userconfig.cc +} ; extern P4MT int list2[]; class P4Tunable { public: + struct tunable { + const char *name; + int isSet; + int value; + int minVal; + int maxVal; + int modVal; + int k; // what's 1k? 1000 or 1024? + int original; + int sensitive; + + const ErrorId *description; + const char *recVal; // Recommended value + int svr; // Applicability - server/client/proxy/broker + int restart; // Restart requirement + int support; // Support level + int cat; // Category + }; + + struct stunable { + const char *name; + int isSet; + const char *def; + char *value; + int sensitive; + + const ErrorId *description; + const char *recVal; // Recommended value + int svr; // Applicability - server/client/proxy/broker + int restart; // Restart requirement + int support; // Support level + int cat; // Category + const char *accepted; // Comma separated accepted values + }; void Set( const char *set ); void SetTLocal( const char *set ); @@ -81,6 +164,14 @@ class P4Tunable { return t < DT_LAST && list2[t] != -1 && list2[t] > list[t].value ? list2[t] : list[t].value; } + + const tunable *GetTunable( int i ) const; + + const stunable *GetStringTunable( int i ) const; + + int GetOriginalValue( int t ) const { + return list[t].original; + } int GetLevel( const char *n ) const; StrBuf GetString( const char *n ) const; StrBuf GetString( int t ) const; @@ -105,25 +196,8 @@ class P4Tunable { protected: - static struct tunable { - const char *name; - int isSet; - int value; - int minVal; - int maxVal; - int modVal; - int k; // what's 1k? 1000 or 1024? - int original; - int sensitive; - } list[]; - - static struct stunable { - const char *name; - int isSet; - const char *def; - char *value; - int sensitive; - } slist[]; + static tunable list[]; + static stunable slist[]; } ; typedef void (*DebugOutputHook)( void *context, const StrPtr *buffer ); @@ -135,12 +209,14 @@ class P4DebugConfig { virtual void Output(); virtual StrBuf *Buffer(); virtual int Alloc( int ); + virtual P4DebugConfig *Clone(); void Install(); void SetErrorLog( ErrorLog *e ) { elog = e; } void SetOutputHook( void *ctx, DebugOutputHook hk ) { hook = hk; context = ctx; } static void TsPid2StrBuf( StrBuf &prefix ); + static P4DebugConfig *ThreadClone(); protected: StrBuf *buf; @@ -148,6 +224,7 @@ class P4DebugConfig { ErrorLog *elog; DebugOutputHook hook; void *context; + int cloned; }; class P4Debug : private P4Tunable { @@ -160,6 +237,8 @@ class P4Debug : private P4Tunable { int GetLevel( P4DebugType t ) const { return Get(t); } + int IsSet( P4DebugType t ) const { return P4Tunable::IsSet( t ); } + void ShowLevels( int showAll, StrBuf &buf ); void Event(); diff --git a/P4Plugin/Source/p4api/include/p4/dmextension.h b/P4Plugin/Source/p4api/include/p4/dmextension.h index 8bf5418..2351014 100644 --- a/P4Plugin/Source/p4api/include/p4/dmextension.h +++ b/P4Plugin/Source/p4api/include/p4/dmextension.h @@ -84,7 +84,8 @@ class Extension : public p4script void LoadFile( const char* file, Error *e ); virtual void doBindings( Error* e ); - ExtensionCallerData* GetECD(); + ExtensionCallerData* GetECD() + { return ecd ? &**ecd : nullptr; } p4_std_any::p4_any RunCallBack( const char* name, Error* e ); diff --git a/P4Plugin/Source/p4api/include/p4/error.h b/P4Plugin/Source/p4api/include/p4/error.h index 4b5d819..bc4aa7a 100644 --- a/P4Plugin/Source/p4api/include/p4/error.h +++ b/P4Plugin/Source/p4api/include/p4/error.h @@ -56,6 +56,23 @@ # ifndef __ERROR_H__ # define __ERROR_H__ +// Need P4INT64 if not already defined +// Usually expected to be defined by stdhdrs.h (duplicated from there) +# ifndef P4INT64 +# if !defined( OS_MVS ) && \ + !defined( OS_OS2 ) && \ + !defined( OS_QNX ) +# define HAVE_INT64 +# ifdef OS_NT +# define P4INT64 __int64 +# else +# define P4INT64 long long +# endif +# else +# define P4INT64 int +# endif +# endif + class StrBuf; class StrDict; class StrPtr; @@ -127,7 +144,8 @@ class Error { virtual ~Error(); void operator =( const Error &source ); - Error & Merge( const Error &source ); + Error & Merge( const Error &source, int igndups = 0 ); + virtual void Clear() { severity = E_EMPTY; } const ErrorId *MapError( const struct ErrorIdMap map[] ); @@ -159,7 +177,10 @@ class Error { Error & operator <<( const StrPtr &arg ); Error & operator <<( const StrPtr *arg ); Error & operator <<( const char *arg ); + Error & operator <<( P4INT64 arg ); Error & operator <<( int arg ); + Error & operator <<( unsigned int arg ); + Error & operator <<( long int arg ); // Save system errors diff --git a/P4Plugin/Source/p4api/include/p4/errornum.h b/P4Plugin/Source/p4api/include/p4/errornum.h index acd9ce2..c3ec3e0 100644 --- a/P4Plugin/Source/p4api/include/p4/errornum.h +++ b/P4Plugin/Source/p4api/include/p4/errornum.h @@ -57,4 +57,5 @@ enum ErrorSubsystem { ES_SCRIPT = 17, // scripting ES_SERVER2 = 18, // server overflow ES_DM2 = 19, // dm overflow + ES_CONFIG = 20, // help for configurables } ; diff --git a/P4Plugin/Source/p4api/include/p4/filesys.h b/P4Plugin/Source/p4api/include/p4/filesys.h index 22e8a3d..a3a4625 100644 --- a/P4Plugin/Source/p4api/include/p4/filesys.h +++ b/P4Plugin/Source/p4api/include/p4/filesys.h @@ -67,11 +67,14 @@ * FileSys::Chmod() - change permissions * FileSys::Compare() - compare file against target * FileSys::Copy - copy one file to another + * FileSys::CopyRange - copy a range of a file (possibly optimized) * FileSys::Digest() - return a fingerprint of the file contents * FileSys::Chmod2() - copy a file to get ownership and set perms * FileSys::Fsync() - sync file state to disk * * FileSys::CheckType() - look at the file and see if it is binary, etc + * FileSys::SetAtomicRename() - set atomic rename on this instance + * FielSys::CheckForAtomicRename() - Qualify Windows OS atomic support */ # ifdef OS_NT @@ -178,14 +181,6 @@ enum FilePerm { FPM_RWXO // set file read-write-execute (owner) } ; -enum LFNModeFlags { - LFN_ENABLED = 0x01, - LFN_UNCPATH = 0x02, - LFN_UTF8 = 0x04, - LFN_MOVEBUSY = 0x08, - LFN_CSENSITIVE = 0x10, -} ; - enum FileDigestType { FS_DIGEST_UNKNOWN = 0, @@ -199,6 +194,7 @@ class StrArray; class CharSetCvt; class MD5; class StrBuf; +class StrBufDict; class DateTimeHighPrecision; // for the high-precision modtime calls @@ -215,6 +211,7 @@ class DiskSpaceInfo { P4INT64 freeBytes; int pctUsed; StrBuf *fsType; + StrBuf *mountpoint; } ; # ifdef HAS_CPP11 @@ -223,30 +220,31 @@ class DiskSpaceInfo { class FileSys; -// Specialization to the std::default_delete template class so we can store -// a std::unique_pointer to the FileSys* returned from FileSys::Create without -// having to know which inherited class it's actually using and without having -// to use a custom deleter everywhere. +using FileSysUPtr = std::unique_ptr< FileSys >; + +# endif -namespace std +class FileSysBuffer { - template<> class default_delete< FileSys* > - { - public: - void operator()( FileSys **ptr ); - }; -} + public: + virtual ~FileSysBuffer() {} + virtual void Release() = 0; -using FileSysUPtr = std::unique_ptr< FileSys* >; + virtual void Open( StrPtr *path, FileOpenMode mode, Error *e ) = 0; + virtual void Write( const char *buf, int len, Error *e ) = 0; + virtual int Read( char *buf, int len, Error *e ) = 0; + virtual void Close( Error *e ) = 0; -# endif + virtual void Seek( offL_t /* offset */, Error* /* e */ ) {} + virtual void SizeHint( offL_t /* size */ ) {} +} ; class FileSys { public: // Creators - - static FileSys *Create( FileSysType type ); + + static FileSys *Create( FileSysType type, FileSysBuffer *buf = 0 ); static FileSys *CreateTemp( FileSysType type ) { FileSys *f = Create( type ); @@ -279,6 +277,9 @@ class FileSys { static bool IsRelative( const StrPtr &p ); + static bool MakePathWriteable( const StrPtr &oldFile, + StrBuf &newFile, Error *e ); + # ifdef OS_NT static bool IsUNC( const StrPtr &p ); # endif @@ -302,8 +303,8 @@ class FileSys { void Perms( FilePerm p ) { perms = p; } void ModTime( StrPtr *u ) { modTime = u->Atoi(); } - void ModTime( time_t t ) { modTime = (int)t; } - time_t GetModTime() { return modTime; } + void ModTime( P4INT64 t) { modTime = t; } + P4INT64 GetModTime() { return modTime; } // Set filesize hint for NT fragmentation avoidance @@ -317,10 +318,12 @@ class FileSys { // RmDir() should not erase your cwd (mainly for DVCS) void PreserveCWD() { preserveCWD = 1; } + void PreserveRoot( StrPtr root ) { preserveRoot = root; } // Initialize digest virtual void SetDigest( MD5 *m ); + virtual MD5 *GetDigest(); // Get type info @@ -351,6 +354,8 @@ class FileSys { virtual void SetLFN( const StrPtr &name ); virtual int GetLFN( ) {return LFN;} # endif + // Enable atomic rename support + virtual void SetAtomicRename(); virtual void Set( const StrPtr &name ); virtual void Set( const StrPtr &name, Error *e ); virtual StrPtr *Path() { return &path; } @@ -365,16 +370,22 @@ class FileSys { virtual int Stat() = 0; virtual int LinkCount(); - virtual int StatModTime() = 0; + virtual P4INT64 StatModTime() = 0; + virtual P4INT64 StatAccessTime() = 0; virtual void StatModTimeHP(DateTimeHighPrecision *modTime); virtual void Truncate( Error *e ) = 0; virtual void Truncate( offL_t offset, Error *e ) = 0; virtual void Unlink( Error *e = 0 ) = 0; + virtual void UnlinkNoRetry( Error* e = 0 ) { Unlink( e ); } virtual void Rename( FileSys *target, Error *e ) = 0; virtual void Chmod( FilePerm perms, Error *e ) = 0; virtual void ChmodTime( Error *e ) = 0; virtual void ChmodTimeHP( const DateTimeHighPrecision & /* modTime */, Error * /* e */ ) {}; virtual void SetAttribute( FileSysAttr, Error * ) { }; + virtual void SetExtendedAttribute( StrPtr * /* name */, StrPtr * /* val */, Error * ) {}; + virtual void SetExtendedAttributes( StrDict * /* vals */, Error * ) {}; + virtual void GetExtendedAttribute( StrPtr * /* name */, StrBuf * /* val */, Error * ) {}; + virtual void GetExtendedAttributes( StrBufDict * /* attrs */, Error * ) {}; virtual void Fsync( Error * ) { } @@ -427,6 +438,9 @@ class FileSys { virtual void RmDir( const StrPtr &p, Error *e ); void RmDir( Error *e = 0 ) { RmDir( path, e ); } + // Determine if this Windows OS supports atomic rename + static void CheckForAtomicRename( Error *e ); + FileSysType CheckType( int scan = -1 ); # if defined ( OS_MACOSX ) && OS_VER < 1010 @@ -444,6 +458,12 @@ class FileSys { void WriteFile( const StrPtr *buf, Error *e ); int Compare( FileSys *other, Error *e ); void Copy( FileSys *targetFile, FilePerm perms, Error *e ); + // Copy a range of content from one FileSys to another. + // This is intended to be used with uncompressed binary files + // (FST_BINARY) so it can use fast low-level OS operations on disk files. + void CopyRange( offL_t offIn, size_t len, + FileSys *targetFile, offL_t offOut, + Error *e ); virtual void Digest( StrBuf *digest, Error *e ); void Chmod2( FilePerm perms, Error *e ); void Chmod2( const char *p, Error *e ) @@ -456,6 +476,8 @@ class FileSys { StrBuf *digest, Error *e ); + void SetDelegate( FileSysBuffer *buf ) { delegate = buf; } + // Character Set operations void SetCharSetPriv( int x = 0 ) { charSet = x; } @@ -471,12 +493,13 @@ class FileSys { FileOpenMode mode; // read or write FilePerm perms; // leave read-only or read-write - int modTime; // stamp file mod date on close + P4INT64 modTime; // stamp file mod date on close offL_t sizeHint; // how big will the file get ? StrBuf path; FileSysType type; MD5 *checksum; // if verifying file transfer int cacheHint; // don't pollute cache + FileSysBuffer* delegate; // don't read/write from/to disk # ifdef OS_NT int LFN; @@ -486,6 +509,7 @@ class FileSys { int isTemp; int preserveCWD; + StrBuf preserveRoot; int charSet; int content_charSet; diff --git a/P4Plugin/Source/p4api/include/p4/ignore.h b/P4Plugin/Source/p4api/include/p4/ignore.h index 373ae03..983e6fe 100644 --- a/P4Plugin/Source/p4api/include/p4/ignore.h +++ b/P4Plugin/Source/p4api/include/p4/ignore.h @@ -6,10 +6,13 @@ # define DEBUG_MATCH ( p4debug.GetLevel( DT_MAP ) >= 3 ) # define DEBUG_LIST ( p4debug.GetLevel( DT_MAP ) >= 4 ) +# define DEBUG_BUILD ( p4debug.GetLevel( DT_MAP ) >= 5 ) class IgnoreTable; class IgnoreItem; +class IgnorePtrArray; +class IgnoreArray; class StrArray; class FileSys; @@ -38,18 +41,21 @@ class Ignore { void BuildIgnoreFiles( const StrPtr &ignoreName ); int Build( const StrPtr &path, const StrPtr &ignoreName, const char *configName ); - void InsertDefaults( StrArray *list, const char *cfgName ); + void InsertDefaults( IgnorePtrArray *newList ); void Insert( StrArray *subList, const char *ignore, const char *cwd, int lineno ); int ParseFile( FileSys *f, const char *cwd, - StrArray *list ); + IgnoreArray *list ); IgnoreTable *ignoreTable; - StrArray *ignoreList; + IgnorePtrArray *ignoreList; + IgnoreArray *defaultList; StrBuf dirDepth; StrBuf foundDepth; + StrBuf configName; StrArray *ignoreFiles; StrBuf ignoreStr; + int relatives; }; diff --git a/P4Plugin/Source/p4api/include/p4/malloc_override.h b/P4Plugin/Source/p4api/include/p4/malloc_override.h index 1ef1925..6c9def5 100644 --- a/P4Plugin/Source/p4api/include/p4/malloc_override.h +++ b/P4Plugin/Source/p4api/include/p4/malloc_override.h @@ -22,11 +22,15 @@ built with a memory manager. # define MI_STATIC_LIB # ifndef NDEBUG # define NDEBUG +# define DEFINED_NDEBUG # endif # define MI_STAT 1 -# define MI_NO_ENVIRO 1 +# define MI_NO_GETENV # include - +# if defined(NDEBUG) && defined(DEFINED_NDEBUG) +# undef NDEBUG +# undef DEFINED_NDEBUG +# endif # define HAS_MIMALLOC # define P4_MALLOC mi_malloc # define P4_CALLOC mi_calloc diff --git a/P4Plugin/Source/p4api/include/p4/md5.h b/P4Plugin/Source/p4api/include/p4/md5.h index e2b0cc2..496e95e 100644 --- a/P4Plugin/Source/p4api/include/p4/md5.h +++ b/P4Plugin/Source/p4api/include/p4/md5.h @@ -115,6 +115,7 @@ class MD5 { public: MD5(); + MD5( Error *e ); void Update( const StrPtr &buf ); void Final( StrBuf &output ); @@ -122,6 +123,7 @@ class MD5 { private: + void Init( Error *e ); void Transform(); count64 bits; // total @@ -145,16 +147,20 @@ class MD5 { public: MD5(); + MD5( Error *e ); ~MD5(); MD5& operator=( const MD5& rhs ); void Update( const StrPtr &buf ); + void Update( const unsigned char* buf, const size_t len ); void Final( StrBuf &output ); void Final( unsigned char digest[ 16 ] ); P4INT64 Count(); private: + void Init( Error *e ); + void* ctx; P4INT64 bits; }; diff --git a/P4Plugin/Source/p4api/include/p4/msgclient.h b/P4Plugin/Source/p4api/include/p4/msgclient.h index 3788da0..3dcea07 100644 --- a/P4Plugin/Source/p4api/include/p4/msgclient.h +++ b/P4Plugin/Source/p4api/include/p4/msgclient.h @@ -63,6 +63,7 @@ class MsgClient { static ErrorId UnknownCharset; static ErrorId FileKept; + static ErrorId DataOutOfBounds; static ErrorId ChdirFail; static ErrorId LockCheckFail; @@ -122,6 +123,19 @@ class MsgClient { static ErrorId DirectoryNotEmpty; static ErrorId CantRevertDirectoryNotEmpty; + static ErrorId BadFiletype; + static ErrorId BadLineEndingFlag; + static ErrorId BadUncompressFlag; + + static ErrorId AltSyncBadJSON; + static ErrorId AltSyncNoResult; + static ErrorId AltSyncBadResult; + static ErrorId AltSyncErr; + static ErrorId AltSyncUnhandledPass; + static ErrorId AltSyncNotSupported; + static ErrorId AltSyncFailStart; + + // Retired ErrorIds. We need to keep these so that clients // built with newer apis can commnunicate with older servers // still sending these. diff --git a/P4Plugin/Source/p4api/include/p4/msgdb.h b/P4Plugin/Source/p4api/include/p4/msgdb.h index 76329d7..3bb7a8e 100644 --- a/P4Plugin/Source/p4api/include/p4/msgdb.h +++ b/P4Plugin/Source/p4api/include/p4/msgdb.h @@ -11,6 +11,7 @@ class MsgDb { public: + static ErrorId DevErr; static ErrorId JnlEnd; static ErrorId JnlWord2Big; @@ -49,6 +50,7 @@ class MsgDb { static ErrorId DelNoLock; static ErrorId Delete; static ErrorId Locking; + static ErrorId LockingLoop; static ErrorId EndXact; static ErrorId GetNoGet; static ErrorId TableUnknown; @@ -87,10 +89,13 @@ class MsgDb { static ErrorId MustExpire; static ErrorId Checksum; static ErrorId WrongApp; + static ErrorId LicenseWrongService; static ErrorId PlatPre972; static ErrorId LicenseRead; static ErrorId LicenseBad; static ErrorId AddressChanged; + static ErrorId AddressInvalid; + static ErrorId AddressInvalidRecommend; static ErrorId LicenseNeedsApplication; static ErrorId BadIPservice; static ErrorId BadXCapLine; @@ -107,12 +112,23 @@ class MsgDb { static ErrorId TreeNewerVersion; static ErrorId TreeOlderVersion; static ErrorId DoNotBlameTheDb; + static ErrorId NoPartitionedDb; + static ErrorId NotPartitionedTable; + static ErrorId PartitionedDbUsage; + static ErrorId FailedValidation; + static ErrorId PartitionedVerify; + static ErrorId CannotUseSpecificPTable; static ErrorId MapCheckFail; static ErrorId CaseMismatch; static ErrorId GenNumPageTooNew; + static ErrorId BadRecoverTbl; + + static ErrorId DbTreeDuplicate; + static ErrorId DbTreeNotFound; + static ErrorId DbIntVBit; // Retired ErrorIds. We need to keep these so that clients // built with newer apis can commnunicate with older servers diff --git a/P4Plugin/Source/p4api/include/p4/msgdm2.h b/P4Plugin/Source/p4api/include/p4/msgdm2.h index da82301..6c3b0ad 100644 --- a/P4Plugin/Source/p4api/include/p4/msgdm2.h +++ b/P4Plugin/Source/p4api/include/p4/msgdm2.h @@ -3,18 +3,27 @@ * * This file is part of Perforce - the FAST SCM System. */ - /* * msgdm2.h - overflow definitions of errors for data manager core subsystem. */ - class MsgDm2 { public: static ErrorId ExistingStorage; static ErrorId ConfigHistData; static ErrorId LbrScanBadState; static ErrorId LbrScanCtlNotFound; + + static ErrorId IntegIntoReadOnlyOverlay; + static ErrorId IntegRequiresStream; + static ErrorId IntegStreamSyntaxHint; + + static ErrorId OpenReadOnlyOverlay; + static ErrorId OpenWarnOverlay; + static ErrorId OpenUndoConflict; + + static ErrorId UnshelveBadOverlay; static ErrorId UnshelveStreamResolve; + static ErrorId RequiresAutoIdCode; static ErrorId SpecMissingBuiltin; static ErrorId StreamSpecIntegOkay; @@ -37,6 +46,7 @@ class MsgDm2 { static ErrorId GblLockIndexMismatch; static ErrorId GblLockIndexMissing; static ErrorId GblLockMissing; + static ErrorId GblUnlockMissing; static ErrorId StreamlogInteg; static ErrorId RemoteAutoGenSpecFailed; static ErrorId StreamParentViewMustBeOpen; @@ -63,9 +73,104 @@ class MsgDm2 { static ErrorId StreamViewMatchData; static ErrorId NoTopologyRecord; static ErrorId NoServerIDSet; - static ErrorId NoPartitionedToReadonly; + static ErrorId TopologyRecDeleted; + static ErrorId TopologyRecNotFound; static ErrorId LockNameNull; static ErrorId WorkRecNotFound; + static ErrorId StreamDeletedInChange; + static ErrorId DomainObliterate; + static ErrorId StreamNotModifiedAtChange; + static ErrorId PurgeStreamSpec; + static ErrorId CannotDeleteShelvedStream; + static ErrorId RmtArchiveDeleteFailed; + static ErrorId RmtDeleteEdgeArchiveFailed; + static ErrorId ComponentStreamInvalid; + static ErrorId ComponentTypeNotAvailable; + static ErrorId TopologyDelPreview; + static ErrorId StreamHasComponentsDelete; + static ErrorId StreamHasComponentsOblit; + static ErrorId ComponentInvalidIsStream; + static ErrorId ComponentInvalidIsConsumer; + static ErrorId ComponentInvalidIsRelative; + static ErrorId ReparentFailedParentIsComponent; + static ErrorId ReparentFailedParentIsCompOfChild; + static ErrorId ReparentFailedFamilyIsComponent; + static ErrorId ReparentFailedFamilyIsCompOfChild; + static ErrorId ReparentFailedParentHasComponent; + static ErrorId ReparentFailedFamilyHasComponent; + static ErrorId StreamDeletedInChangeWarn; + static ErrorId StreamLoopFound; + static ErrorId ComponentInvalidIsDependent; + static ErrorId TopologyThresholdOutOfRange; static ErrorId ProtectsMismatch; + static ErrorId DirsDataStreamViews; + static ErrorId FilesDataStreamViews; + static ErrorId FilesDataTrait; + static ErrorId MaxMem; + static ErrorId GroupsDataVerbose222; + static ErrorId TopologyDelRecMarker; + static ErrorId TopologyMoveRecMarker; + static ErrorId TopologyAmbiguity; + static ErrorId TopologyTargetDeleted; + static ErrorId TopologyRecAlreadyDeleted; + static ErrorId ComponentWritableNoChange; + static ErrorId NoChangeOnDistribution; + static ErrorId TopologyRecAlreadyMoved; + static ErrorId TopologyRecMoved; + static ErrorId TopologyMoveSame; + static ErrorId TopologyFailedToMark; + static ErrorId TopologyMarkedMoveTo; + static ErrorId NoAltSyncChangeWithHave; + static ErrorId MaxMemOS; + static ErrorId BadLazyPipeCount; + static ErrorId StreamFieldValueError; static ErrorId StreamViewGenAtChangeSkip; + static ErrorId DepotTraitDup; + static ErrorId NoTraitDepot; + + static ErrorId ComponentStreamInvalidSparse; + static ErrorId NoReparentSparse; + static ErrorId NoSparseChildren; + static ErrorId NoStreamTypeChangeToNonSparse; + static ErrorId NoStreamTypeChangeToSparse; + static ErrorId NoVirtualParentSparseChild; + static ErrorId SparseStreamCmdChangeSpecifierOnly; + static ErrorId SparseStreamCmdMustIncludeAll; + static ErrorId SparseStreamCmdMustIncludeAll2; + static ErrorId SparseStreamCmdWrongStream; + static ErrorId SparseStreamCmdNoRevRange; + static ErrorId SparseStreamCopyOutOfDate; + static ErrorId SparseStreamCopyLatestOnly; + static ErrorId SparseStreamNoPin; + static ErrorId SparseStreamNotSupported; + static ErrorId SparseStreamOpNotAllowed; + static ErrorId SparseStreamPinChangeDown; + static ErrorId SparseStreamPinChangeUp; + static ErrorId SparseStreamPinUpdate; + static ErrorId VirtChildSparseParentOpNotAllowed; + static ErrorId UnsubmitNoStreamSpec; + static ErrorId NoTopologyActiveRec; + + static ErrorId OnlyOneClientReload; + static ErrorId UnknownParam; + static ErrorId BadS3Mode; + static ErrorId DepotBadAddress; + static ErrorId DepotBadRemoteAddress; + static ErrorId NoConfigHistory; + static ErrorId SyncToRemove; + static ErrorId DomainNoViewCmtClientBadSave; + static ErrorId ConfigNotFound; + + static ErrorId ChunkMapFormat; + static ErrorId SparseStreamNoCreateMaxCommit0; + static ErrorId SparseStreamNoUnshelvePinLower; + static ErrorId UpgradeToCreatePJnlClient; + static ErrorId DbBodTextCxEntryMissing; + static ErrorId StreamSpecIntegrationNoFrmChange; + + // Retired ErrorIds. We need to keep these so that clients + // built with newer apis can commnunicate with older servers + // still sending these. + + static ErrorId NoPartitionedToReadonly; // DEPRECATED } ; diff --git a/P4Plugin/Source/p4api/include/p4/msggraph.h b/P4Plugin/Source/p4api/include/p4/msggraph.h index 449b99a..4da8c51 100644 --- a/P4Plugin/Source/p4api/include/p4/msggraph.h +++ b/P4Plugin/Source/p4api/include/p4/msggraph.h @@ -375,6 +375,8 @@ class MsgGraph { static ErrorId RefcntInProgress; static ErrorId NoOrphanedObj; static ErrorId ObjectRecNotFound; + static ErrorId RefCntAdjustNotFound; + // Retired ErrorIds. We need to keep these so that clients // built with newer apis can commnunicate with older servers // still sending these. diff --git a/P4Plugin/Source/p4api/include/p4/msghelp.h b/P4Plugin/Source/p4api/include/p4/msghelp.h index e535544..f375198 100644 --- a/P4Plugin/Source/p4api/include/p4/msghelp.h +++ b/P4Plugin/Source/p4api/include/p4/msghelp.h @@ -35,6 +35,7 @@ class MsgHelp { static ErrorId HelpAnnotate; static ErrorId HelpAdmin; static ErrorId HelpAdministration; + static ErrorId HelpAdminResourceMonitor; static ErrorId HelpArchive; static ErrorId HelpAttribute; static ErrorId HelpBackup; @@ -52,7 +53,6 @@ class MsgHelp { static ErrorId HelpConfigure; static ErrorId HelpConfigurables; static ErrorId HelpCopy; - static ErrorId HelpCopyshelf; static ErrorId HelpCounter; static ErrorId HelpCounters; static ErrorId HelpCstat; @@ -78,6 +78,8 @@ class MsgHelp { static ErrorId HelpExtension; static ErrorId HelpClientExtensionIntro; static ErrorId HelpServerExtensionIntro; + static ErrorId HelpFailback; + static ErrorId HelpFailbackintro; static ErrorId HelpFailover; static ErrorId HelpFiles; static ErrorId HelpFilelog; @@ -156,6 +158,7 @@ class MsgHelp { static ErrorId HelpRemote; static ErrorId HelpRemotes; static ErrorId HelpRename; + static ErrorId HelpRenameClient; static ErrorId HelpRenameUser; static ErrorId HelpReconcile; static ErrorId HelpReopen; @@ -178,6 +181,7 @@ class MsgHelp { static ErrorId HelpSearch; static ErrorId HelpServer; static ErrorId HelpServerid; + static ErrorId HelpServerResources; static ErrorId HelpServers; static ErrorId HelpSet; static ErrorId HelpShelve; diff --git a/P4Plugin/Source/p4api/include/p4/msglbr.h b/P4Plugin/Source/p4api/include/p4/msglbr.h index 684adb5..bccfdba 100644 --- a/P4Plugin/Source/p4api/include/p4/msglbr.h +++ b/P4Plugin/Source/p4api/include/p4/msglbr.h @@ -45,13 +45,12 @@ class MsgLbr { static ErrorId RevLess; static ErrorId TooBig; static ErrorId RcsTooBig; - static ErrorId FmtLbrStat; - static ErrorId FmtLbrStat2; static ErrorId FmtLbrStat3; static ErrorId FmtLbrStat4; static ErrorId FmtLbrStat5; static ErrorId LbrOpenFail; static ErrorId AlreadyOpen; + static ErrorId NotOpen; static ErrorId BadKeyword; static ErrorId KeywordUnterminated; static ErrorId ObjectReadError; @@ -59,8 +58,21 @@ class MsgLbr { static ErrorId LbrTypeInsane; static ErrorId LbrTrackInsane; + static ErrorId S3UploadFailed; + static ErrorId S3DownloadFailed; + static ErrorId S3CopyFailed; + static ErrorId S3StatFailed; + static ErrorId S3DeleteFailed; + static ErrorId S3UnsupportedOpen; + static ErrorId S3LbrLockLoop; + + static ErrorId ChunkingCreateNewLbr; + + // Retired ErrorIds. We need to keep these so that clients // built with newer apis can commnunicate with older servers // still sending these. + static ErrorId FmtLbrStat; + static ErrorId FmtLbrStat2; } ; diff --git a/P4Plugin/Source/p4api/include/p4/msgos.h b/P4Plugin/Source/p4api/include/p4/msgos.h index 408b579..b386a64 100644 --- a/P4Plugin/Source/p4api/include/p4/msgos.h +++ b/P4Plugin/Source/p4api/include/p4/msgos.h @@ -42,6 +42,9 @@ class MsgOs { static ErrorId ZlibDeflateInit; static ErrorId ZlibInflateInitSeek; + static ErrorId NoAtomicRename; + static ErrorId AtomicRenameFailed; + // Retired ErrorIds. We need to keep these so that clients // built with newer apis can commnunicate with older servers // still sending these. diff --git a/P4Plugin/Source/p4api/include/p4/msgrpc.h b/P4Plugin/Source/p4api/include/p4/msgrpc.h index df02f92..cb14cc7 100644 --- a/P4Plugin/Source/p4api/include/p4/msgrpc.h +++ b/P4Plugin/Source/p4api/include/p4/msgrpc.h @@ -40,7 +40,12 @@ class MsgRpc { static ErrorId NameResolve; static ErrorId SslAccept; + static ErrorId SslAcceptFailed; + static ErrorId SslAcceptTimeout; static ErrorId SslConnect; + static ErrorId SslConnectFailed; + static ErrorId SslConnectTimeout; + static ErrorId SslCloseEOF; static ErrorId SslListen; static ErrorId SslRecv; static ErrorId SslSend; diff --git a/P4Plugin/Source/p4api/include/p4/msgserver2.h b/P4Plugin/Source/p4api/include/p4/msgserver2.h index 5e6e716..e6866dc 100644 --- a/P4Plugin/Source/p4api/include/p4/msgserver2.h +++ b/P4Plugin/Source/p4api/include/p4/msgserver2.h @@ -40,6 +40,10 @@ class MsgServer2 { static ErrorId FailoverUnCfgCommit; static ErrorId FailoverDetails; static ErrorId FailoverNeedYOK; + static ErrorId FailoverWriteFConfigs; + static ErrorId FailoverDeleteFConfigs; + static ErrorId FailoverFConfigsBad; + static ErrorId FailoverFBackOldWarn; static ErrorId ServerIDReused; static ErrorId StorageRestoreDigest; static ErrorId xuUpstream; @@ -185,9 +189,126 @@ class MsgServer2 { static ErrorId UseStreams2; static ErrorId UnknownContext; static ErrorId RplTooBig; + static ErrorId RplReduced; + static ErrorId FailbackStandbyRestrict; + static ErrorId UseP4dF; + static ErrorId P4dFBadMaster; + static ErrorId P4dFRefuseMissing; + static ErrorId P4dFFConfigsMissing; + static ErrorId P4dFStandbyNotStandby; + static ErrorId P4dFBadRplFrom; + static ErrorId P4dFPreview; + static ErrorId P4dFStarting; + static ErrorId P4dFOK; + static ErrorId P4dFSuccess; + static ErrorId P4dFFailbackNotRun; + static ErrorId P4dFRestrictedStart; static ErrorId IntegTaskNoDirect; + static ErrorId ExtraPxcIDUsage; + static ErrorId BadPxcExtraFlag; + static ErrorId FailbackWriteServerID; + static ErrorId UseFailback; + static ErrorId FailbackMasterTooOld; + static ErrorId FailbackFConfigsMissing; + static ErrorId UseFailoverB; + static ErrorId FailbackStandbyNotRestricted; + static ErrorId FailbackNeedsFm; + static ErrorId FailbackNeedsFs; + static ErrorId FailbackStandbyBad; + static ErrorId FailoverRunFailback; static ErrorId LbrDeletionFailed; + static ErrorId ThreadMustBeNumeric; + static ErrorId ThreadBiggerMinusTwo; + static ErrorId NoStdoutPDump; + static ErrorId NoDirPDump; + static ErrorId BadJournalSubOpt; + static ErrorId LicenseExpiryWarning; static ErrorId InfoProxyCacheRoot; static ErrorId InfoProxyRoot; static ErrorId UpgradeFeatureUnknown; -}; + static ErrorId NoParallelMflag; + static ErrorId NoParallelCflag; + static ErrorId NoParallelSflag; + static ErrorId BadRecoverDir; + static ErrorId BadRecoverFileName; + static ErrorId NoStorageMflag; + static ErrorId NoParallelSSflag; + static ErrorId SyncWStreamViewChange; + static ErrorId SyncWStreamViewHeadChange; + static ErrorId StreamAtChangeVsStreamViewChange; + static ErrorId UseRenameClient; + static ErrorId FromToSame; + static ErrorId ClientNotExist; + static ErrorId NewClientExists; + static ErrorId RenameClientUnloaded; + static ErrorId RenameClientPartitioned; + static ErrorId ClientOpenStream; + static ErrorId RenameNeedsMaster; + static ErrorId RenameNeedsCommit; + static ErrorId RenameNoPromoted; + static ErrorId ClientRenamed; + static ErrorId ClientNeedsRecover; + static ErrorId ClientRenameFailed; + static ErrorId ClientNotLocal; + static ErrorId RenameCommitOld; + static ErrorId UseRenameWorkspace; + static ErrorId MultiFilePara; + static ErrorId PasswordChangeSU; + static ErrorId RenameClientNotAllowed; + static ErrorId RenameClientAdminSuper; + static ErrorId RenameClientSuper; + static ErrorId RenameClientNotOwner; + static ErrorId PreserveChangeNumberConflict; + static ErrorId DistributionBlockSubmit; + static ErrorId DistributionServerOverrides; + static ErrorId MissingParallelFile; + static ErrorId AltSyncNoSupport; + static ErrorId AltSyncNotConfigured; + static ErrorId AltSyncNoVersion; + static ErrorId AltSyncBadVersion; + static ErrorId AltSyncActive; + static ErrorId UpgradeAuthDown; + static ErrorId UpgradeAuth; + static ErrorId UpgradeAuthNoLicense; + static ErrorId UpgradeAuthMaintenance; + static ErrorId UpgradeAuthRestricted; + static ErrorId LowResourceTerm; + static ErrorId ImpatientPauseTerm; + static ErrorId TooManyPausedTerm; + static ErrorId TooMuchResourceMonitor; + static ErrorId UseAdminResourceMonitor; + static ErrorId StartupCapabilities; + static ErrorId BadPressureThresholds; + static ErrorId PopulateSparseStreamDesc; + static ErrorId NonResidentOpenMustSync; + static ErrorId BadJField; + static ErrorId TooManySparseStreamFiles; + static ErrorId TraitDepotNotConfigured; + static ErrorId TraitDepotNotForCommit; + static ErrorId NoValidIPOrMACAddresses; + static ErrorId ValidIPv4Address; + static ErrorId ValidIPv6Address; + static ErrorId ValidMACAddress; + static ErrorId NoTraitValueInDepot; + static ErrorId AttributeNoWild; + static ErrorId AttributeNotFound; + static ErrorId AttributeFileEmpty; + static ErrorId UseTraitI; + static ErrorId Types64Warn; + static ErrorId Types64Err; + static ErrorId ConfigureSetComment; + static ErrorId ProxyClearCacheNotSet; + static ErrorId StreamMustBeSparse; + static ErrorId InvalidDestStreamType; + static ErrorId UseStreamConvertSparse; + static ErrorId ConfigureMandatoryComment; + static ErrorId NoJournalRotateWarning; + static ErrorId CommitVerifyNoExternalAddress; + static ErrorId SwitchStreamFailedReconcile; + static ErrorId MissingConfigDbFile; + static ErrorId MissingPcdir; + static ErrorId NoStreamSpecEditStreamAtChangeClient; + static ErrorId NoStreamSpecUnshelveStreamAtChangeClient; + static ErrorId SparseStreamOperationNotAllowed; + static ErrorId MustSetPasswordRequireSU; +} ; diff --git a/P4Plugin/Source/p4api/include/p4/msgsupp.h b/P4Plugin/Source/p4api/include/p4/msgsupp.h index af96242..b7c3252 100644 --- a/P4Plugin/Source/p4api/include/p4/msgsupp.h +++ b/P4Plugin/Source/p4api/include/p4/msgsupp.h @@ -18,6 +18,7 @@ class MsgSupp { static ErrorId InvalidCharset; static ErrorId TooMany; + static ErrorId MissingCmd; static ErrorId Invalid; static ErrorId NeedsArg; static ErrorId Needs2Arg; @@ -51,6 +52,7 @@ class MsgSupp { static ErrorId Inflate; static ErrorId InflateInit; static ErrorId MagicHeader; + static ErrorId DigestInitFailed; static ErrorId RegexError; @@ -127,6 +129,7 @@ class MsgSupp { static ErrorId OptionUnloadLimit; static ErrorId OptionOmitLazy; static ErrorId OptionLeaveKeywords; + static ErrorId OptionLeaveKeywords2; static ErrorId OptionOutputFile; static ErrorId OptionExists; static ErrorId OptionContent; @@ -356,6 +359,10 @@ class MsgSupp { static ErrorId OptionFailoverid; static ErrorId OptionFailoverQuiesce; static ErrorId OptionFailoverVerification; + static ErrorId OptionFailbackYes; + static ErrorId OptionFailbackQuiesce; + static ErrorId OptionPreFailback; + static ErrorId OptionPostFailback; static ErrorId OptionInstall; static ErrorId OptionCreateSampleExt; static ErrorId OptionUndo; @@ -398,11 +405,17 @@ class MsgSupp { static ErrorId JsmnBadSyn; static ErrorId JsmnTooFew; static ErrorId JsmnKeyNotFound; + static ErrorId ManifestKeyNotFound; static ErrorId ManifestValueEmpty; static ErrorId ManifestValueTypeInvalid; static ErrorId ManifestParseError; static ErrorId InvalidIntegerRange; + + static ErrorId CurlPerformFailed; + static ErrorId AwsRejected; + static ErrorId XmlParseFailed; + static ErrorId FatalLockError; static ErrorId MissingKeyCert; static ErrorId InternalSSLerror; @@ -418,6 +431,41 @@ class MsgSupp { static ErrorId RenameDirNotEmpty; static ErrorId OptionCleanPurge; static ErrorId OptionViewMatch; + static ErrorId OptionObliterate; + static ErrorId OptionOffset; + static ErrorId OptionSize; + static ErrorId OptionCompressed; + static ErrorId OptionStreamViews; + static ErrorId OptionUseStreamChange; + static ErrorId OptionHasStream; + static ErrorId OptionNoStream; + static ErrorId OptionPreserveChangeNumbers; + static ErrorId OptionLimit; + static ErrorId OptionType; + static ErrorId OptionResult; + static ErrorId OptionJNum; + static ErrorId OptionJField; + static ErrorId OptionIntervalMillis; + static ErrorId OptionThreshold; + static ErrorId OptionDatedEarlier; + static ErrorId OptionDeleteMarker; + static ErrorId OptionDeletePurge; + static ErrorId OptionMoveTopology; + static ErrorId OptionServerAddress; + static ErrorId OptionServerID; + static ErrorId OptionTargetAddress; + static ErrorId OptionNewServerAddress; + static ErrorId OptionNewServerID; + static ErrorId OptionNewTargetAddress; + static ErrorId OptionCreationDate; + static ErrorId OptionLastSeenDate; + static ErrorId OptionTraitStorage; + static ErrorId OptionIteration; + static ErrorId OptionListAddresses; + static ErrorId OptionTrait; + static ErrorId OptionTraitFile; + + static ErrorId AmbiguousArgs; // Retired ErrorIds. We need to keep these so that clients // built with newer apis can commnunicate with older servers diff --git a/P4Plugin/Source/p4api/include/p4/netbuffer.h b/P4Plugin/Source/p4api/include/p4/netbuffer.h index 372ee4d..b9b5a6a 100644 --- a/P4Plugin/Source/p4api/include/p4/netbuffer.h +++ b/P4Plugin/Source/p4api/include/p4/netbuffer.h @@ -111,6 +111,7 @@ class NetBuffer : public NetTransport { void Flush( Error *e ) { Flush( e, e ); } + void Shutdown( Error *e ) { Shutdown( e, e ); } void Close() { transport->Close(); } @@ -137,6 +138,7 @@ class NetBuffer : public NetTransport { int Receive( char *buf, int len, Error *re, Error *se ); void Send( const char *buf, int len, Error *re, Error *se ); void Flush( Error *re, Error *se ); + void Shutdown( Error *re, Error *se ); int Fill( Error *re, Error *se ); void SetBufferSizes( int recvSize, int sendSize ); diff --git a/P4Plugin/Source/p4api/include/p4/netconnect.h b/P4Plugin/Source/p4api/include/p4/netconnect.h index 38770f6..ddebb9a 100644 --- a/P4Plugin/Source/p4api/include/p4/netconnect.h +++ b/P4Plugin/Source/p4api/include/p4/netconnect.h @@ -146,6 +146,9 @@ class NetTransport : public KeepAlive { virtual void SetBreak( KeepAlive *breakCallback ) = 0; virtual int GetSendBuffering() = 0; virtual int GetRecvBuffering() = 0; + virtual void Shutdown( Error *re, Error *se) + { + } virtual void GetEncryptionType(StrBuf &value) { value.Clear(); diff --git a/P4Plugin/Source/p4api/include/p4/options.h b/P4Plugin/Source/p4api/include/p4/options.h index b371cb6..551ff50 100644 --- a/P4Plugin/Source/p4api/include/p4/options.h +++ b/P4Plugin/Source/p4api/include/p4/options.h @@ -141,6 +141,7 @@ class Options LabelName , // list -l RunOnMaster , // list -M LeaveKeywords , // print -k + LeaveKeywords2 , // sync -K, revert -K, integ -K... OutputFile , // print -o Content , // filelog -h OmitPromoted , // filelog -p @@ -232,6 +233,8 @@ class Options Name , // attribute -n, property -n Value , // attribute -v, property -v Propagating , // attribute -p + Storage , // attribute -T + TraitFile , // attribute -I OpenAdd , // reconcile -a OpenEdit , // reconcile -e OpenDelete , // reconcile -d @@ -299,6 +302,8 @@ class Options ForceFailover , // failover -F IgnoreMaster , // failover -i RequireMaster , // failover -m + FailbackYes , // failback -y + FailbackQuiesce, // failback -w FailoverYes , // failover -y Failoverid , // failover -s FailoverQuiesce, // failover -w @@ -313,14 +318,30 @@ class Options MissingCount , // heartbeat -c LocalLicense , // license -u -l AutoReload , // labels -R + IntervalMillis , // --interval-ms | -I + Threshold , // topology -t + DatedEarlier , // topology -e + DeleteMarker , // topology -d + DeletePurge , // topology -D + MoveTopology , // topology -m + ServerAddress , // topology -s + ServerID , // topology -i + TargetAddress , // topology -p + NewServerAddress, // topology -S + NewServerID , // topology -I + NewTargetAddress, // topology -P + CreationDate , // topology -c + LastSeenDate , // topology -l + ListAddresses , // license -L + Trait , // print -T // options which have only long-form option names go here: LongFormOnlyOptions = 2000, NoRejournal , // pull --no-rejournal - From , // renameuser --from - To , // renameuser --to + From , // renameuser or renameclient --from + To , // renameuser or renameclient --to Parallel , // sync --parallel ParallelSubmit , // submit --parallel InputFile , // reload --input-file @@ -380,6 +401,7 @@ class Options Script , // --script ScriptMaxMem , // --script-MaxMem ScriptMaxTime , // --script-MaxTime + ScriptEnableDbg, // --script-enable-debug Path , // --path (extension) NoSync , // --no-sync NoScript , // --no-script @@ -404,6 +426,25 @@ class Options ShowRealtime , // --show-realtime CleanPurge , // --purged-only ViewMatch , // --viewmatch + Obliterate , // stream --obliterate + Offset , // print --offset + Size , // print --size + Compressed , // verify --compressed=0/1 + PreFailback , // p4d --pre-failback + PostFailback , // p4d --post-failback + StreamViews , // --streamviews + UseStreamChange , // --use-stream-change + HasStream , // --stream + NoStream , // --nostream + PreserveChangeNumbers, // --preserve-change-numbers + Limit , // --limit # + Type , // --type checkpoint|dump.... + Result , // --result pass|fail + JNum , // --num # + JField , // --jfield f1,f2,f3 + ControlTweaks , // --control-tweaks + CachePurge , // --cache-purge (p4p) + Iteration , // --iteration #ifdef _DEBUG DebugBreak, // --debugbreak #endif @@ -445,6 +486,8 @@ class Options static int FindCode( const int code, Error *e ); static int GetShortForm( const int ilist, Error *e ); static const char * GetLongForm( const int ilist, Error *e ); + void Discard( int opt, char flag2 = 0, int subopt = 0 ); + void Dump( StrPtr * ); private: int optc; diff --git a/P4Plugin/Source/p4api/include/p4/p4libs.h b/P4Plugin/Source/p4api/include/p4/p4libs.h index 44bed11..fbb7ab8 100644 --- a/P4Plugin/Source/p4api/include/p4/p4libs.h +++ b/P4Plugin/Source/p4api/include/p4/p4libs.h @@ -59,13 +59,11 @@ class P4Libraries static void Initialize( const int libraries, Error* e ); static void Shutdown( const int libraries, Error* e ); - static void DisableZlibOptimization(); - static void DisableFileSysCreateOnIntr(); - static void EnableFileSysCreateOnIntr(); - // Note that these are internal routines for Perforce products - // and are not necessary to call for general P4API use. static void InitializeThread( const int libraries, Error* e ); static void ShutdownThread( const int libraries, Error* e ); + static void DisableZlibOptimization(); + static void DisableFileSysCreateOnIntr(); + static void EnableFileSysCreateOnIntr(); }; diff --git a/P4Plugin/Source/p4api/include/p4/p4tags.h b/P4Plugin/Source/p4api/include/p4/p4tags.h index 5b860bb..d7450a2 100644 --- a/P4Plugin/Source/p4api/include/p4/p4tags.h +++ b/P4Plugin/Source/p4api/include/p4/p4tags.h @@ -21,12 +21,14 @@ struct P4Tag { static const char l_proxy[]; static const char l_server[]; static const char l_server2[]; + static const char l_altSync[]; // client service methods static const char c_Ack[]; static const char c_AckMatch[]; static const char c_ActionResolve[]; + static const char c_AltSync[]; static const char c_CheckFile[]; static const char c_ReconcileEdit[]; static const char c_ChmodFile[]; @@ -71,6 +73,7 @@ struct P4Tag { static const char c_WriteFile[]; static const char c_WriteMatch[]; static const char c_WriteMerge[]; + static const char c_WriteVarPartial[]; // protocol service methods @@ -89,6 +92,13 @@ struct P4Tag { static const char v_actionOwner[]; static const char v_action[]; + static const char v_add[]; + static const char v_added[]; + static const char v_agentProgram[]; + static const char v_altSync[]; + static const char v_altSyncResults[]; + static const char v_altSyncVars[]; + static const char v_altSyncVersion[]; static const char v_api[]; static const char v_app[]; static const char v_appliedJnl[]; @@ -97,9 +107,12 @@ struct P4Tag { static const char v_associatedChange[]; static const char v_attack[]; static const char v_attr[]; + static const char v_attrName[]; + static const char v_attrStorage[]; static const char v_authServer[]; static const char v_autoLogin[]; static const char v_autoTune[]; + static const char v_badAlloc[]; static const char v_baseName[]; static const char v_behindBytes[]; static const char v_behindJnls[]; @@ -118,21 +131,35 @@ struct P4Tag { static const char v_changeImportedBy[]; static const char v_changeServer[]; static const char v_changeType[]; + static const char v_changeView[]; static const char v_charset[]; + static const char v_check[]; + static const char v_checkFile[]; static const char v_checkpoint[]; static const char v_checkLinks[]; static const char v_checkLinksN[]; + static const char v_chmod[]; + static const char v_chunking[]; + static const char v_chunkMap[]; + static const char v_chunkMapHandle[]; + static const char v_chunkWrite[]; + static const char v_chunkMapWrite[]; + static const char v_chunkToken[]; static const char v_clientAddress[]; static const char v_clientCase[]; static const char v_clientCwd[]; + static const char v_clientDepotFile[]; + static const char v_clientDepotRev[]; static const char v_clientFile[]; static const char v_clientHost[]; static const char v_clientName[]; static const char v_clientRoot[]; + static const char v_clientStatsFunc[]; static const char v_clientStream[]; static const char v_client[]; static const char v_cmpfile[]; static const char v_code[]; + static const char v_commandGroup[]; static const char v_commit[]; static const char v_commitAuthor[]; static const char v_commitAuthorEmail[]; @@ -142,6 +169,7 @@ struct P4Tag { static const char v_committerDate[]; static const char v_compare[]; static const char v_compCksum[]; + static const char v_componentDir[]; static const char v_configurableName[]; static const char v_configurableValue[]; static const char v_configurables[]; @@ -149,8 +177,10 @@ struct P4Tag { static const char v_conflict[]; static const char v_copied[]; static const char v_cumulative[]; + static const char v_count[]; static const char v_counter[]; static const char v_laddr[]; + static const char v_compression[]; static const char v_current[]; static const char v_cwd[]; static const char v_daddr[]; @@ -159,6 +189,8 @@ struct P4Tag { static const char v_date[]; static const char v_dbstat[]; static const char v_decline[]; + static const char v_depotChange[]; + static const char v_depotRev[]; static const char v_depotTime[]; static const char v_desc[]; static const char v_descKey[]; // original CL# @@ -172,6 +204,7 @@ struct P4Tag { static const char v_digestTypeSHA256[]; static const char v_dir[]; static const char v_disabled[]; + static const char v_effectiveComponentType[]; static const char v_enableStreams[]; static const char v_enableGraph[]; static const char v_endFromChange[]; @@ -179,19 +212,23 @@ struct P4Tag { static const char v_endToChange[]; static const char v_endToRev[]; static const char v_erev[]; + static const char v_executable[]; static const char v_expandAndmaps[]; static const char v_extensionsEnabled[]; static const char v_externalAuth[]; static const char v_extraTag[]; static const char v_extraTagType[]; static const char v_failoverSeen[]; + static const char v_false[]; static const char v_fatal[]; static const char v_field[]; static const char v_fileCount[]; static const char v_fileNum[]; static const char v_fileSize[]; + static const char v_fileType[]; static const char v_file[]; static const char v_filter[]; + static const char v_flushHard[]; static const char v_fmt[]; static const char v_forceType[]; static const char v_fromFile[]; @@ -205,6 +242,8 @@ struct P4Tag { static const char v_func[]; static const char v_func2[]; static const char v_handle[]; + static const char v_hash[]; + static const char v_hashType[]; static const char v_haveRev[]; static const char v_headAction[]; static const char v_headChange[]; @@ -214,29 +253,40 @@ struct P4Tag { static const char v_headRev[]; static const char v_headTime[]; static const char v_headType[]; + static const char v_hidden[]; static const char v_himark[]; static const char v_host[]; static const char v_how[]; static const char v_ignore[]; static const char v_initroot[]; + static const char v_interface[]; + static const char v_ipv4Address[]; + static const char v_ipv6Address[]; static const char v_isgroup[]; + static const char v_isMapped[]; + static const char v_isSparse[]; + static const char v_isTask[]; static const char v_journalcopyFlags[]; static const char v_job[]; static const char v_jobstat[]; static const char v_jnlBatchSize[]; static const char v_journal[]; static const char v_key[]; + static const char v_keywords[]; static const char v_language[]; + static const char v_lazyCopyFile[]; + static const char v_lazyCopyRev[]; static const char v_lbrFile[]; // also remote depot - static const char v_lbrChange[]; + static const char v_lbrChange[]; + static const char v_lbrIsLazy[]; static const char v_lbrPath[]; + static const char v_lbrRefCount[]; static const char v_lbrRelPath[]; static const char v_lbrRelTo[]; static const char v_lbrRelToPath[]; + static const char v_lbrReplication[]; static const char v_lbrRev[]; // also remote depot static const char v_lbrType[]; // also remote depot - static const char v_lbrRefCount[]; - static const char v_lbrReplication[]; static const char v_leof_num[]; static const char v_leof_sequence[]; static const char v_ldap[]; @@ -244,18 +294,22 @@ struct P4Tag { static const char v_level[]; static const char v_lfmt[]; static const char v_line[]; + static const char v_lineEnd[]; static const char v_locale[]; static const char v_lower[]; static const char v_lockGlobal[]; static const char v_lockId[]; static const char v_lockOnCommit[]; static const char v_lockStatus[]; + static const char v_macAddress[]; static const char v_mangle[]; static const char v_matchedLine[]; static const char v_matchBegin[]; static const char v_matchEnd[]; static const char v_maxLockTime[]; static const char v_maxOpenFiles[]; + static const char v_maxPauseTime[]; + static const char v_maxMem[]; static const char v_maxResults[]; static const char v_maxScanRows[]; static const char v_maxValue[]; @@ -267,6 +321,7 @@ struct P4Tag { static const char v_minClient[]; static const char v_mode[]; static const char v_monitor[]; + static const char v_move[]; static const char v_name[]; static const char v_newServerId[]; static const char v_noBase[]; @@ -274,6 +329,7 @@ struct P4Tag { static const char v_noclobber[]; static const char v_noecho[]; static const char v_noneFound[]; + static const char v_nonsequential[]; static const char v_noprompt[]; static const char v_offset[]; static const char v_oid[]; @@ -289,9 +345,12 @@ struct P4Tag { static const char v_ourLock[]; static const char v_packName[]; static const char v_parent[]; + static const char v_passFunc[]; static const char v_password[]; static const char v_path[]; static const char v_path2[]; + static const char v_pathSource[]; + static const char v_pathType[]; static const char v_peeking[]; static const char v_perm[]; static const char v_permmax[]; @@ -336,6 +395,8 @@ struct P4Tag { static const char v_rMoveReaddIntegConflictSkip[]; static const char v_rcvbuf[]; static const char v_reason[]; + static const char v_recvFileBytes[]; + static const char v_recvFileCount[]; static const char v_ref[]; static const char v_remap[]; static const char v_remoteFunc[]; @@ -346,7 +407,13 @@ struct P4Tag { static const char v_repoName[]; static const char v_reresolvable[]; static const char v_resolved[]; + static const char v_resolveAction[]; + static const char v_resolveBaseFile[]; + static const char v_resolveBaseRev[]; + static const char v_resolveEndFromRev[]; static const char v_resolveFlag[]; + static const char v_resolveFromFile[]; + static const char v_resolveStartFromRev[]; static const char v_resolveType[]; static const char v_rev[]; static const char v_rev2[]; @@ -359,6 +426,8 @@ struct P4Tag { static const char v_scope[]; static const char v_secondFactor[]; static const char v_security[]; + static const char v_sendFileBytes[]; + static const char v_sendFileCount[]; static const char v_skipped[]; static const char v_snapped[]; static const char v_sndbuf[]; @@ -400,11 +469,16 @@ struct P4Tag { static const char v_stat[]; static const char v_status[]; static const char v_svrname[]; + static const char v_svrRecType[]; + static const char v_symlink[]; static const char v_symref[]; static const char v_tableexcludelist[]; static const char v_tag[]; static const char v_tagJnl[]; + static const char v_targetAddr[]; + static const char v_targetDestAddr[]; static const char v_targetSha[]; + static const char v_targetSvrID[]; static const char v_targetType[]; static const char v_theirName[]; static const char v_theirTime[]; @@ -419,6 +493,7 @@ struct P4Tag { static const char v_track[]; static const char v_trans[]; static const char v_tree[]; + static const char v_true[]; static const char v_truncate[]; static const char v_type[]; static const char v_type2[]; @@ -433,6 +508,7 @@ struct P4Tag { static const char v_user[]; static const char v_userChanged[]; static const char v_userName[]; + static const char v_utf8bom[]; static const char v_version[]; static const char v_warning[]; static const char v_wingui[]; @@ -460,6 +536,7 @@ struct P4Tag { static const char v_baseDepotRec[]; // p4 resolve static const char v_changeNo[]; // p4 submit static const char v_checkSum[]; // p4 submit + static const char v_checkTooFar[]; // auth license check static const char v_clientEntity[]; static const char v_confirm2[]; static const char v_dataHandle[]; @@ -493,9 +570,12 @@ struct P4Tag { static const char v_movedRev[]; static const char v_needsFlushTransport[]; static const char v_noretry[]; // p4 specs + static const char v_pathPermissions[]; // readonly or writable status static const char v_peer[]; static const char v_peerAddress[]; + static const char v_preserveCNums[]; static const char v_propigate[]; // proxy chaining test + static const char v_readonly[]; static const char v_remoteFetch[]; // no on-demand fetch bg submit static const char v_reopen[]; // submit static const char v_replace[]; // shelve @@ -513,13 +593,18 @@ struct P4Tag { static const char v_shelvedStream[]; // stream is shelved static const char v_state[]; static const char v_stream[]; // stream name + static const char v_streamDir[]; + static const char v_streamFile[]; static const char v_stream2[]; // other stream name + static const char v_streamViewChange[]; // stream view change used + static const char v_submitted[]; static const char v_table[]; // remote depot static const char v_traitCount[]; // submit static const char v_tzoffset[]; // server tz offset for proxy static const char v_output[]; // proxy print kind static const char v_unloadInterval[]; // unused client unload interval static const char v_value[]; // p4 index + static const char v_writable[]; static const char v_workRec[]; static const char v_workRec2[]; static const char v_workGRec[]; @@ -536,6 +621,7 @@ struct P4Tag { static const char u_changes[]; static const char u_client[]; static const char u_clients[]; + static const char u_copy[]; static const char u_counter[]; static const char u_counters[]; static const char u_delete[]; @@ -561,6 +647,7 @@ struct P4Tag { static const char u_info[]; static const char u_integrate[]; static const char u_integrated[]; + static const char u_interchanges[]; static const char u_job[]; static const char u_jobs[]; static const char u_jobspec[]; @@ -568,6 +655,7 @@ struct P4Tag { static const char u_labels[]; static const char u_labelsync[]; static const char u_lock[]; + static const char u_merge[]; static const char u_obliterate[]; static const char u_opened[]; static const char u_passwd[]; diff --git a/P4Plugin/Source/p4api/include/p4/pathsys.h b/P4Plugin/Source/p4api/include/p4/pathsys.h index da5cce9..afacc5e 100644 --- a/P4Plugin/Source/p4api/include/p4/pathsys.h +++ b/P4Plugin/Source/p4api/include/p4/pathsys.h @@ -41,22 +41,7 @@ # include class PathSys; - -// Specialization to the std::default_delete template class so we can store -// a std::unique_pointer to the PathSys* returned from PathSys::Create without -// having to know which inherited class it's actually using and without having -// to use a custom deleter everywhere. - -namespace std -{ - template<> class default_delete< PathSys* > - { - public: - void operator()( PathSys **ptr ); - }; -} - -using PathSysUPtr = std::unique_ptr< PathSys* >; +using PathSysUPtr = std::unique_ptr< PathSys >; # endif diff --git a/P4Plugin/Source/p4api/include/p4/runcmd.h b/P4Plugin/Source/p4api/include/p4/runcmd.h index 14fa782..016c333 100644 --- a/P4Plugin/Source/p4api/include/p4/runcmd.h +++ b/P4Plugin/Source/p4api/include/p4/runcmd.h @@ -222,8 +222,10 @@ class RunCommandIo : public RunCommand { int Read( const StrPtr &out, Error *e ); StrPtr *ReadError( Error *e ); + int ReadLine( StrBuf &out, StrBuf &buf, Error *e ); + private: - int Read( char *buf, int length, Error *e ); + int Read( char *buf, int length, Error *e, int closeIn = 1 ); int fds[2]; StrBuf errBuf; diff --git a/P4Plugin/Source/p4api/include/p4/sanitizers.h b/P4Plugin/Source/p4api/include/p4/sanitizers.h index 5e3a378..67cda5d 100644 --- a/P4Plugin/Source/p4api/include/p4/sanitizers.h +++ b/P4Plugin/Source/p4api/include/p4/sanitizers.h @@ -7,25 +7,34 @@ # ifndef P4SANITIZERS_H # define P4SANITIZERS_H -// NO-OP definitions -# define NO_SANITIZE_ADDRESS_UNDEFINED -# define NO_SANITIZE_ADDRESS -# define NO_SANITIZE_UNDEFINED - -# ifdef __has_feature // There's no feature test for UBSAN, so assume that if we've got one, // we've got the other. + +// Clang. +# if defined(__has_feature) # if __has_feature(address_sanitizer) -# undef NO_SANITIZE_ADDRESS_UNDEFINED -# undef NO_SANITIZE_ADDRESS -# undef NO_SANITIZE_UNDEFINED +# define CAN_SANITIZE +# endif +# endif + +// GCC +# if defined(__GNUG__) && defined(__SANITIZE_ADDRESS__) +# define CAN_SANITIZE +# endif + +# ifdef CAN_SANITIZE +# undef CAN_SANITIZE // Note that it's possible to specify specific parts of the sanitizers to disable, // so if a function is only offending a particular check, we can disable them // more selectively if necessary. # define NO_SANITIZE_ADDRESS_UNDEFINED __attribute__((no_sanitize("address","undefined"))) # define NO_SANITIZE_ADDRESS __attribute__((no_sanitize("address"))) # define NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined"))) -# endif -# endif +# else +// NO-OP definitions +# define NO_SANITIZE_ADDRESS_UNDEFINED +# define NO_SANITIZE_ADDRESS +# define NO_SANITIZE_UNDEFINED +# endif // CAN_SANITIZE # endif // P4SANITIZERS_H diff --git a/P4Plugin/Source/p4api/include/p4/sha1.h b/P4Plugin/Source/p4api/include/p4/sha1.h index fbe4bde..f08a40c 100644 --- a/P4Plugin/Source/p4api/include/p4/sha1.h +++ b/P4Plugin/Source/p4api/include/p4/sha1.h @@ -53,6 +53,7 @@ class Sha1Digester public: Sha1Digester(); + Sha1Digester( Error *e ); ~Sha1Digester(); void Update( const StrPtr &buf ); void Final( StrBuf &output ); @@ -60,6 +61,7 @@ class Sha1Digester void Final( Sha1 &sha ); private: + void Init( Error *e ); void *ctx; }; diff --git a/P4Plugin/Source/p4api/include/p4/sha256.h b/P4Plugin/Source/p4api/include/p4/sha256.h index 09feb09..9d0c631 100644 --- a/P4Plugin/Source/p4api/include/p4/sha256.h +++ b/P4Plugin/Source/p4api/include/p4/sha256.h @@ -53,6 +53,7 @@ class Sha256Digester public: Sha256Digester(); + Sha256Digester( Error *e ); ~Sha256Digester(); void Update( const StrPtr &buf ); void Final( StrBuf &output ); @@ -60,6 +61,7 @@ class Sha256Digester void Final( Sha256 &sha ); private: + void Init( Error *e ); void *ctx; }; diff --git a/P4Plugin/Source/p4api/include/p4/stdhdrs.h b/P4Plugin/Source/p4api/include/p4/stdhdrs.h index 53d50d8..ebfffe1 100644 --- a/P4Plugin/Source/p4api/include/p4/stdhdrs.h +++ b/P4Plugin/Source/p4api/include/p4/stdhdrs.h @@ -1,6 +1,5 @@ /* - * Copyright 1995, 1996 Perforce Software. All rights reserved. - * + * Copyright 1995, 1996 Perforce Software. All rights reserved. * * This file is part of Perforce - the FAST SCM System. */ @@ -32,6 +31,7 @@ # include # include # include +# include // needed by datetime.h # if !defined( OS_QNX ) && !defined( OS_VMS ) # include @@ -77,6 +77,7 @@ * NEED_TYPES - off_t, etc (always set) * NEED_UTIME - utime() * NEED_WIN32FIO - Native Windows file I/O + * NEED_XATTRS - getxattr() setxattr() */ # if defined( NEED_ACCESS ) || \ @@ -353,6 +354,10 @@ extern "C" int __stdcall gethostname( char * name, int namelen ); # include +# ifdef OS_LINUX +# include +# endif + # ifndef S_ISLNK /* NCR */ # define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK) # endif @@ -517,6 +522,10 @@ extern "C" int socketpair(int, int, int, int*); # include # endif +# if defined(NEED_TIMER) && !defined(OS_NT) +# include +# endif + # if defined(NEED_TIME_HP) # if defined( OS_LINUX ) # define HAVE_CLOCK_GETTIME @@ -568,8 +577,8 @@ using namespace std; # endif # endif -# define HAVE_UTIMES # ifdef NEED_UTIMES +# define HAVE_UTIMES # if ( defined( OS_NT ) || defined( OS_OS2 ) ) && !defined(__BORLANDC__) # include # else @@ -579,6 +588,13 @@ using namespace std; # endif # endif +# ifdef NEED_XATTRS +# if defined( OS_LINUX ) || defined( OS_DARWIN ) || defined( OS_MACOSX ) +# define HAVE_XATTRS +# include +# endif +# endif + # ifdef NEED_SLEEP # ifdef OS_NT # define WIN32_LEAN_AND_MEAN @@ -722,23 +738,30 @@ enum LineType { LineTypeRaw, LineTypeCr, LineTypeCrLf, LineTypeLfcrlf }; /* * P4INT64 - a 64 bit int + * Duplicated in error.h in case external includes including error.h first */ -# if !defined( OS_MVS ) && \ - !defined( OS_OS2 ) && \ - !defined( OS_QNX ) -# define HAVE_INT64 -# ifdef OS_NT -# define P4INT64 __int64 -# else -# define P4INT64 long long -# endif -# endif - # ifndef P4INT64 -# define P4INT64 int +# if !defined( OS_MVS ) && \ + !defined( OS_OS2 ) && \ + !defined( OS_QNX ) +# define HAVE_INT64 +# ifdef OS_NT +# define P4INT64 __int64 +# else +# define P4INT64 long long +# endif +# else +# define P4INT64 int +# endif # endif +/* + * P4UINT64 - an unsigned 64 bit int. + */ + +# define P4UINT64 unsigned P4INT64 + /* * offL_t - size of files or offsets into files */ @@ -795,6 +818,11 @@ typedef unsigned int p4size_t; # define HAS_BROKEN_CPP11 # endif +# if defined(_MSC_VER) && _MSC_VER < 1915 +// C2970 +# define HAS_BROKEN_CPP11_TEMPLATE_INTERNAL_LINKAGE +# endif + # ifdef HAS_CPP11 # define HAS_PARALLEL_SYNC_THREADS # endif @@ -858,7 +886,11 @@ typedef struct P4_FD { HANDLE fh; int flags; - int isStd; + int mode; + int lock; + int dounicode; + int lfn; + int fdFlags; unsigned char *ptr; DWORD rcv; int iobuf_siz; @@ -873,6 +905,23 @@ typedef struct P4_FD* FD_TYPE; # define FD_ERR NULL typedef void* FD_PTR; +# define FD_INIT NULL +# define FD_ERR NULL +typedef void* FD_PTR; + +# define FD_IsSTD 0x001 +# define FD_LOCKED 0x002 +# define FD_REOPEN 0x004 +# define FD_CLOSED 0x008 + +enum LFNModeFlags { + LFN_ENABLED = 0x01, + LFN_UNCPATH = 0x02, + LFN_UTF8 = 0x04, + LFN_ATOMIC_RENAME = 0x08, + LFN_CSENSITIVE = 0x10, +} ; + # else // OS_NT # define FD_INIT -1 @@ -882,9 +931,49 @@ typedef int FD_PTR; # endif // !OS_NT + # if !defined( HAS_CPP11 ) && !defined( LLONG_MIN ) # define LLONG_MIN (-9223372036854775807LL - 1) # define LLONG_MAX 9223372036854775807LL # endif +# if defined( HAS_CPP11 ) +# if defined( NEED_THREAD ) && ( defined( OS_NT ) || !defined( USE_SMARTHEAP ) ) +# define HAVE_THREAD +# include +# include +# endif +# endif + + +// endian defines. +# undef P4_LITTLE_ENDIAN +# undef P4_BIG_ENDIAN + +# if defined( OS_LINUX ) || defined(OS_MACOSX) || defined(OS_DARWIN) +# if defined( __BYTE_ORDER) && defined(__LITTLE_ENDIAN) +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define P4_LITTLE_ENDIAN 1 +# endif +# if __BYTE_ORDER == __BIG_ENDIAN +# define P4_BIG_ENDIAN 1 +# endif +# else +// If there are no defines to tell us, then guess. +# define P4_LITTLE_ENDIAN 1 +# endif +# endif + +# if defined( OS_NT ) + +# define P4_LITTLE_ENDIAN 1 + +# endif + +# if !defined( P4_LITTLE_ENDIAN ) && !defined( P4_BIG_ENDIAN ) +// Endian defines not working on builds (php) that +// do not define OS type. Disable this guard until fixed. +//# error "Unable to determine the endianess of the platform" +# endif + # endif // P4STDHDRS_H diff --git a/P4Plugin/Source/p4api/include/p4/strarray.h b/P4Plugin/Source/p4api/include/p4/strarray.h index 35aaecc..31aa3a4 100644 --- a/P4Plugin/Source/p4api/include/p4/strarray.h +++ b/P4Plugin/Source/p4api/include/p4/strarray.h @@ -22,6 +22,7 @@ class StrArray { public: StrArray(); + StrArray( int max ); ~StrArray(); StrBuf * Put(); @@ -33,6 +34,7 @@ class StrArray { void Remove( int i ); int Search( const StrBuf *key ); const StrBuf * Find( const StrBuf *key ); + int GetIndex( const StrBuf *key ); void Copy( const StrArray *other ); private: diff --git a/P4Plugin/Source/p4api/include/p4/strbuf.h b/P4Plugin/Source/p4api/include/p4/strbuf.h index 177c8b0..be59c28 100644 --- a/P4Plugin/Source/p4api/include/p4/strbuf.h +++ b/P4Plugin/Source/p4api/include/p4/strbuf.h @@ -51,6 +51,7 @@ * StrPtr::[] - get a single character * StrPtr::XCompare() - case exact string compare * StrPtr::CCompare() - case folding string compare + * StrPtr::CCompareN() - case folding string compare, length-limited * StrPtr::SCompare() - case aware string compare -- see strbuf.cc * StrPtr::SEqual() - case aware character compare -- see strbuf.cc * StrPtr::Contains() - finds a substring @@ -134,6 +135,7 @@ class StrPtr { { return Atoi64( buffer ); } static bool Atoi64( const char *p, P4INT64 *result ); + static bool Atoi64Lite( const char *p, P4INT64 *result ); bool Atoi64( P4INT64 *result ) const { return Atoi64( buffer, result ); } @@ -160,6 +162,9 @@ class StrPtr { int CCompare( const StrPtr &s ) const { return CCompare( buffer, s.buffer ); } + int CCompareN( const StrPtr &s, p4size_t len ) const + { return CCompareN( buffer, s.buffer, len ); } + int SCompare( const StrPtr &s ) const { return SCompare( buffer, s.buffer ); } @@ -167,6 +172,7 @@ class StrPtr { { return NCompare( buffer, s.buffer ); } static int CCompare( const char *a, const char *b ); + static int CCompareN( const char *a, const char *b, p4size_t len ); static int SCompare( const char *a, const char *b ); static int NCompare( const char *a, const char *b ); @@ -261,6 +267,7 @@ class StrPtr { static P4INT64 Atoi64( const char *buffer ); static char *Itoa64( P4INT64 v, char *endbuf ); static char *Itox( unsigned int v, char *endbuf ); + static char *Itox64( P4UINT64 v, char *endbuf ); friend class StrBuf; friend class StrRef; @@ -522,8 +529,16 @@ class StrBuf : public StrPtr { StrBuf& operator <<( const StrNum &s ) { UAppend( (const StrPtr *)&s ); return *this; } + StrBuf& operator <<( P4INT64 v ); + StrBuf& operator <<( int v ); + StrBuf& operator <<( long int v ); /* time_t */ + + StrBuf& operator <<( unsigned int v ); /* p4size_t */ + + StrBuf& operator <<( long unsigned int v ); + private: p4size_t size; @@ -557,25 +572,43 @@ class StrNum : public StrPtr { public: StrNum() {} + StrNum( P4INT64 v ) + { Set( v ); } + + StrNum( long int v ) + { Set( ( P4INT64 ) v ); } + StrNum( int v ) { Set( v ); } - StrNum( int ok, int v ) + StrNum( int ok, P4INT64 v ) { if( ok ) Set( v ); else buffer = buf, length = 0; } + void Set( P4INT64 v ) + { + buffer = Itoa64( v, buf + sizeof( buf ) ); + length = (p4size_t)(buf + sizeof( buf ) - buffer - 1); + } + void Set( int v ) { buffer = Itoa( v, buf + sizeof( buf ) ); length = (p4size_t)(buf + sizeof( buf ) - buffer - 1); } + void SetHex( P4INT64 v ) + { + buffer = Itox64( v, buf + sizeof( buf ) ); + length = (p4size_t)(buf + sizeof( buf ) - buffer - 1); + } + void SetHex( int v ) { buffer = Itox( v, buf + sizeof( buf ) ); length = (p4size_t)(buf + sizeof( buf ) - buffer - 1); } - void Set( int v, int digits ) + void Set( P4INT64 v, int digits ) { Set( v ); @@ -583,21 +616,6 @@ class StrNum : public StrPtr { *--buffer = '0', ++length; } -# ifdef HAVE_INT64 - - StrNum( long v ) { Set( (P4INT64)v ); } - - StrNum( P4INT64 v ) - { Set( v ); } - - void Set( P4INT64 v ) - { - buffer = Itoa64( v, buf + sizeof( buf ) ); - length = (p4size_t)(buf + sizeof( buf ) - buffer - 1); - } - -# endif - private: char buf[24]; } ; @@ -625,8 +643,32 @@ class StrHuman : public StrPtr char buf[24]; } ; +inline StrBuf & +StrBuf::operator <<( P4INT64 v ) +{ + return operator <<( StrNum( v ) ); +} + inline StrBuf & StrBuf::operator <<( int v ) { return operator <<( StrNum( v ) ); } + +inline StrBuf & +StrBuf::operator <<( long int v ) +{ + return operator <<( StrNum( ( P4INT64 ) v ) ); +} + +inline StrBuf & +StrBuf::operator <<( unsigned int v ) +{ + return operator <<( StrNum( ( P4INT64 ) v ) ); +} + +inline StrBuf & +StrBuf::operator <<( long unsigned int v ) +{ + return operator <<( StrNum( ( P4INT64 ) v ) ); +} diff --git a/P4Plugin/Source/p4api/include/p4/strdict.h b/P4Plugin/Source/p4api/include/p4/strdict.h index fbf7ef7..507e459 100644 --- a/P4Plugin/Source/p4api/include/p4/strdict.h +++ b/P4Plugin/Source/p4api/include/p4/strdict.h @@ -36,10 +36,19 @@ class StrVarName : public StrRef { char varName[64]; } ; +class StrDictIterator { + public: + virtual ~StrDictIterator(){}; + virtual int Get( StrRef &var, StrRef &val ) = 0; + virtual void Next() = 0; + virtual void Reset() = 0; +} ; + class StrDict { public: + StrDict() : iterator( 0 ) {} virtual ~StrDict(); // Handy wrappers @@ -76,6 +85,8 @@ class StrDict { int GetVarCCompare( const char *var, StrBuf &val ); int GetVarCCompare( const StrPtr &var, StrBuf &val ); + int GetCount() + { return VGetCount(); }; void ReplaceVar( const char *var, const char *value ); void ReplaceVar( const StrPtr &var, const StrPtr &value ); @@ -89,7 +100,9 @@ class StrDict { int Save( FILE * out ); int Load( FILE * out ); - + + virtual StrDictIterator *GetIterator(); + protected: // Get/Set vars, provided by subclass @@ -101,5 +114,24 @@ class StrDict { virtual void VSetError( const StrPtr &var, Error *e ); virtual void VClear(); virtual void VReset(); + virtual int VGetCount() = 0; + StrDictIterator *iterator; } ; + +class StrDictBasicIterator : public StrDictIterator { + public: + StrDictBasicIterator( StrDict *dict ) { i = 0; this->dict = dict; } + + virtual int Get(StrRef &var, StrRef &val) { + return dict->GetVar( i, var, val ); } + + virtual void Next() { i++; } + + virtual void Reset() { i = 0; } + + private: + int i; + StrDict *dict; +} ; + diff --git a/P4Plugin/Source/p4api/include/p4/strops.h b/P4Plugin/Source/p4api/include/p4/strops.h index da51ead..54f41be 100644 --- a/P4Plugin/Source/p4api/include/p4/strops.h +++ b/P4Plugin/Source/p4api/include/p4/strops.h @@ -146,6 +146,7 @@ class StrOps { static void PackInt( StrBuf &o, int v ); static void PackIntA( StrBuf &o, int v ); static void PackInt64( StrBuf &o, P4INT64 v ); + static void PackIntV( StrBuf &o, P4INT64 v ); static void PackChar( StrBuf &o, const char *c, int len ); static void PackOctet( StrBuf &o, const StrPtr &s ); static void PackString( StrBuf &o, const StrPtr &s ); @@ -154,6 +155,7 @@ class StrOps { static int UnpackInt( StrRef &o ); static int UnpackIntA( StrRef &o ); static P4INT64 UnpackInt64( StrRef &o ); + static P4INT64 UnpackIntV( StrRef &o ); static void UnpackChar( StrRef &o, char *c, int length ); static void UnpackOctet( StrRef &o, const StrPtr &s ); static void UnpackString( StrRef &o, StrBuf &s ); diff --git a/P4Plugin/Source/p4api/include/p4/strtable.h b/P4Plugin/Source/p4api/include/p4/strtable.h index 052ade7..4997c25 100644 --- a/P4Plugin/Source/p4api/include/p4/strtable.h +++ b/P4Plugin/Source/p4api/include/p4/strtable.h @@ -39,6 +39,7 @@ class StrPtrDict : public StrDict { void VRemoveVar( const StrPtr &var ); int VGetVarX( int x, StrRef &var, StrRef &val ); void VClear() { tabLength = 0; } + int VGetCount() { return tabLength; } private: @@ -56,11 +57,6 @@ class StrBufDict : public StrDict { StrBufDict & operator =( StrDict & dict ); ~StrBufDict(); - int GetCount() - { - return tabLength; - } - // virtuals of StrDict StrPtr * VGetVar( const StrPtr &var ); @@ -68,6 +64,7 @@ class StrBufDict : public StrDict { void VRemoveVar( const StrPtr &var ); int VGetVarX( int x, StrRef &var, StrRef &val ); void VClear() { tabLength = 0; } + int VGetCount() { return tabLength; } StrPtr * GetVarN( const StrPtr &var ); StrBuf * KeepOne( const StrPtr &var ); @@ -96,6 +93,7 @@ class BufferDict : public StrDict { void VSetVar( const StrPtr &var, const StrPtr &val ); void VClear() { buf.Clear(); count = 0; } void VRemoveVar( const StrPtr &var ); + int VGetCount() { return count; } protected: StrPtr * GetBuffer() { return &buf; } diff --git a/P4Plugin/Source/p4api/include/p4/threading.h b/P4Plugin/Source/p4api/include/p4/threading.h index 8637fba..e921610 100644 --- a/P4Plugin/Source/p4api/include/p4/threading.h +++ b/P4Plugin/Source/p4api/include/p4/threading.h @@ -100,6 +100,9 @@ class Process { virtual void Child() = 0; virtual void Cancel() = 0; +# ifndef OS_NT + virtual void Cleanup ( pid_t pid ) {} +# endif } ; class Threader { @@ -120,6 +123,9 @@ class Threader { virtual void Quiesce(); virtual void Reap(); +# ifndef OS_NT + virtual void Cleanup( pid_t pid ); +# endif virtual int GetThreadCount(); // varies on each system int cancelled; @@ -156,6 +162,10 @@ class Threading { { return current ? current->GetThreadCount() : -1; } static void LaunchCurrentThread( Thread *t ) { if( current ) current->Launch( t ); } +# ifndef OS_NT + static void Cleanup( pid_t pid ) { if( current ) current->Cleanup( pid ); } +# endif + private: Threader *threader; diff --git a/P4Plugin/Source/p4api/include/p4/vararray.h b/P4Plugin/Source/p4api/include/p4/vararray.h index 8e9318e..a82a5da 100644 --- a/P4Plugin/Source/p4api/include/p4/vararray.h +++ b/P4Plugin/Source/p4api/include/p4/vararray.h @@ -24,7 +24,9 @@ * VarArray::Put(v) - set a new slot to v * VarArray::WillGrow(i) - returns size of new vararray if it * would have to grow in the next i rows. - * + * VarArray::Capacity() - returns the maximum number of elements + * that can be stored before growing. + * * VVarArray::Diff() - subtract/compare/add to VarArrays * OpDiff - substract two VarArrays and drop duplicates * OpIntersect - compare VarArrays to find matches @@ -56,6 +58,7 @@ class VarArray { void * Put( void *v ) { return *New() = v; } void SetCount( int i ) { numElems = i; } int WillGrow( int interval ); + int Capacity() const { return maxElems; } void * Replace( int i, void *newValue ); void Exchange( int i, int j ) @@ -98,6 +101,8 @@ class VVarArray : public VarArray { void Uniq(); private: + friend class DbArray; + void Sort( int l, int u ); int Med3( int i, int j, int k ) const; diff --git a/P4Plugin/Source/p4api/include/p4/web822.h b/P4Plugin/Source/p4api/include/p4/web822.h index 2bc236e..c76540d 100644 --- a/P4Plugin/Source/p4api/include/p4/web822.h +++ b/P4Plugin/Source/p4api/include/p4/web822.h @@ -44,6 +44,9 @@ class Web822 : public StrDict { int VGetVarX( int x, StrRef &var, StrRef &val ) { return recvHeaders.VGetVarX( x, var, val ); } + + int VGetCount() + { return recvHeaders.GetCount(); } // Send a response diff --git a/P4Plugin/Source/p4api/lib/linux64/libclient.a b/P4Plugin/Source/p4api/lib/linux64/libclient.a index 1a545e4..0237aff 100644 --- a/P4Plugin/Source/p4api/lib/linux64/libclient.a +++ b/P4Plugin/Source/p4api/lib/linux64/libclient.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2de482e97fda66ebcbe5b97da0988b6b1d6a81a3a3da938d1c20a7afad419817 -size 3543570 +oid sha256:ea2d4af266a09e7d6120af157898cf7e376789fd588203de371733e755ea7f65 +size 3918334 diff --git a/P4Plugin/Source/p4api/lib/linux64/libp4api.a b/P4Plugin/Source/p4api/lib/linux64/libp4api.a index b4e1341..04c4cb5 100644 --- a/P4Plugin/Source/p4api/lib/linux64/libp4api.a +++ b/P4Plugin/Source/p4api/lib/linux64/libp4api.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6f5f4676df934b41a1f17ccc42908bc72ee79290c15a61142f80b3ee2bc93fdf -size 14969848 +oid sha256:f612a652cd88715200d13660e5938d30effb69f7b75246382a618c40287846c9 +size 16568860 diff --git a/P4Plugin/Source/p4api/lib/linux64/libp4script.a b/P4Plugin/Source/p4api/lib/linux64/libp4script.a index 02e29b7..4730d5f 100644 --- a/P4Plugin/Source/p4api/lib/linux64/libp4script.a +++ b/P4Plugin/Source/p4api/lib/linux64/libp4script.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f17f737ae2c186914a483ca7e4d5677b208625a00086fe7efd8d66b4947c6f38 -size 263788 +oid sha256:e7d044435a06db9696cbcaa40c73ac7e1cd96d8418fcd666345955b55b7c11dd +size 280540 diff --git a/P4Plugin/Source/p4api/lib/linux64/libp4script_c.a b/P4Plugin/Source/p4api/lib/linux64/libp4script_c.a index 4004b55..401bb18 100644 --- a/P4Plugin/Source/p4api/lib/linux64/libp4script_c.a +++ b/P4Plugin/Source/p4api/lib/linux64/libp4script_c.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ac3b093a98009c666ecd0299716233257a1d3a639c188d61f06eb9f97999519 -size 30436 +oid sha256:57a4e6b9a8ca48788aa6d2ca58a06d40526f74cb823c8f10d9b473c69b118e81 +size 40744 diff --git a/P4Plugin/Source/p4api/lib/linux64/libp4script_cstub.a b/P4Plugin/Source/p4api/lib/linux64/libp4script_cstub.a new file mode 100644 index 0000000..9b03783 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/linux64/libp4script_cstub.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3686d6307240b548f1b0293454edcad3fa6fccc8c9ddc7ce738a3c96436d6116 +size 19136 diff --git a/P4Plugin/Source/p4api/lib/linux64/libp4script_curl.a b/P4Plugin/Source/p4api/lib/linux64/libp4script_curl.a index 009cfd2..c3f292a 100644 --- a/P4Plugin/Source/p4api/lib/linux64/libp4script_curl.a +++ b/P4Plugin/Source/p4api/lib/linux64/libp4script_curl.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4133234e2ca3eb8d25f2ae9e9365bc280c097f549c661e2c5d7068a0aa72f524 +oid sha256:77e4cd06dbe59fa0a5d68ed1343273f8d383785e8d2dda26c3a8e92376f2083b size 1370 diff --git a/P4Plugin/Source/p4api/lib/linux64/libp4script_sqlite.a b/P4Plugin/Source/p4api/lib/linux64/libp4script_sqlite.a index 35ffe9a..240191c 100644 --- a/P4Plugin/Source/p4api/lib/linux64/libp4script_sqlite.a +++ b/P4Plugin/Source/p4api/lib/linux64/libp4script_sqlite.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6bb798288dbf880cca8f7cae38c3c1174e8102cbb58de1fdd7583eeb83a5eeb +oid sha256:523ef11d97c96fcde4e3804de1896c6861ddb490bbdf7038e3c83fa3d80485c1 size 1372 diff --git a/P4Plugin/Source/p4api/lib/linux64/librpc.a b/P4Plugin/Source/p4api/lib/linux64/librpc.a index 136cc90..4a45d5c 100644 --- a/P4Plugin/Source/p4api/lib/linux64/librpc.a +++ b/P4Plugin/Source/p4api/lib/linux64/librpc.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2fbd28cf1e53d5c0acc5adbf91071f19095ab8fd0e6cd4022253a45c54b81104 -size 2529426 +oid sha256:c2d9a45e0bc0f8a31524e854968a4db3c46665ceae243a861da3ba9ef43cb79a +size 2531182 diff --git a/P4Plugin/Source/p4api/lib/linux64/libsupp.a b/P4Plugin/Source/p4api/lib/linux64/libsupp.a index 6328899..6238795 100644 --- a/P4Plugin/Source/p4api/lib/linux64/libsupp.a +++ b/P4Plugin/Source/p4api/lib/linux64/libsupp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04899cfe35c81923064a9cb7fd40a7779cae996f1d0e137686a2796f8964d831 -size 8600562 +oid sha256:ddccee76aa2607578ea699f4e4368965c90d15204f1c97b60d86ea6642a0a9ff +size 9795996 diff --git a/P4Plugin/Source/p4api/lib/osx64/libclient.a b/P4Plugin/Source/p4api/lib/osx64/libclient.a index 5bb12ba..6ddecfa 100644 --- a/P4Plugin/Source/p4api/lib/osx64/libclient.a +++ b/P4Plugin/Source/p4api/lib/osx64/libclient.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:28f6b58ce1ec66086ab1dad248a55194eb3155d792f4a5f15ebb99bbe38eda1a -size 3292400 +oid sha256:b08274deeb452add900dbac15e25856cfe70c213ce5eadb4cd719a3cf23dff1f +size 8100048 diff --git a/P4Plugin/Source/p4api/lib/osx64/libp4api.a b/P4Plugin/Source/p4api/lib/osx64/libp4api.a index 96cc735..10b40b5 100644 --- a/P4Plugin/Source/p4api/lib/osx64/libp4api.a +++ b/P4Plugin/Source/p4api/lib/osx64/libp4api.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b2aa94d1a0681ffdc17c3687ea91aa286d0de9f63e7f5a59595dd9bed5f6b3a -size 13269080 +oid sha256:d8d552b031d5f09c3df7ce2e6082b7a305e535849766afafc57b3b586e4f001b +size 96192952 diff --git a/P4Plugin/Source/p4api/lib/osx64/libp4script.a b/P4Plugin/Source/p4api/lib/osx64/libp4script.a index 25d7225..75e35c6 100644 --- a/P4Plugin/Source/p4api/lib/osx64/libp4script.a +++ b/P4Plugin/Source/p4api/lib/osx64/libp4script.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:577e0e3b2c29fcedf096e583d11f613665deeae265079cf29a689378fe3dd498 -size 149640 +oid sha256:71fd3a12c0340d2fbce6f1204d499c17a6363b0706f69f905faa0f8f6e76e5df +size 51374080 diff --git a/P4Plugin/Source/p4api/lib/osx64/libp4script_c.a b/P4Plugin/Source/p4api/lib/osx64/libp4script_c.a index d6a1520..14742ce 100644 --- a/P4Plugin/Source/p4api/lib/osx64/libp4script_c.a +++ b/P4Plugin/Source/p4api/lib/osx64/libp4script_c.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1fde0ccc46fb84498a3959d7d7cfea7f6c9b38dd90e73804c735eb528129b215 -size 15048 +oid sha256:9d386dfd68cc995f6a0305a41863858fd7163f92d5c8426e121501228a882e5c +size 11049472 diff --git a/P4Plugin/Source/p4api/lib/osx64/libp4script_cstub.a b/P4Plugin/Source/p4api/lib/osx64/libp4script_cstub.a new file mode 100644 index 0000000..3d88858 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osx64/libp4script_cstub.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:991384966a5e25ef81f7a8eb660cd73818457525b6a5820c361462e76e1678ef +size 589128 diff --git a/P4Plugin/Source/p4api/lib/osx64/libp4script_curl.a b/P4Plugin/Source/p4api/lib/osx64/libp4script_curl.a index 2487f8c..fb1fdbf 100644 --- a/P4Plugin/Source/p4api/lib/osx64/libp4script_curl.a +++ b/P4Plugin/Source/p4api/lib/osx64/libp4script_curl.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7e0e6f906f9d788910bfb9602b740dd28155b3e5e4df95d5e0b6c156506bde3 -size 1712 +oid sha256:431b892ae1e6ae44a523b6e08fd0e1595f687baa10a0f45462a8f9dfddb8125b +size 5718448 diff --git a/P4Plugin/Source/p4api/lib/osx64/libp4script_sqlite.a b/P4Plugin/Source/p4api/lib/osx64/libp4script_sqlite.a index d5d9b17..03866bf 100644 --- a/P4Plugin/Source/p4api/lib/osx64/libp4script_sqlite.a +++ b/P4Plugin/Source/p4api/lib/osx64/libp4script_sqlite.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c52a7e2770042b8dcd1aac2575e8b05f0c8d3964eff5d0e3ffcc7e33340774f1 -size 1720 +oid sha256:1e3065c841af9c2b5602823f11ad8ecc61f0417a720f9c7fc57b10515f83f6f2 +size 3889688 diff --git a/P4Plugin/Source/p4api/lib/osx64/librpc.a b/P4Plugin/Source/p4api/lib/osx64/librpc.a index 259e34f..2bf0c0e 100644 --- a/P4Plugin/Source/p4api/lib/osx64/librpc.a +++ b/P4Plugin/Source/p4api/lib/osx64/librpc.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:15f113fce46f55c82d3ab46a8d4f5237f1423d3b50ec48078785be862383c902 -size 2020624 +oid sha256:aeb785c0ee473563ab22f309d9c25b15dd7cd1bd18f76e7d854f6422fe12ab1c +size 2090680 diff --git a/P4Plugin/Source/p4api/lib/osx64/libsupp.a b/P4Plugin/Source/p4api/lib/osx64/libsupp.a index 23d50ed..3870b19 100644 --- a/P4Plugin/Source/p4api/lib/osx64/libsupp.a +++ b/P4Plugin/Source/p4api/lib/osx64/libsupp.a @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:726fba8a8d6ca510a2059a29dc2b57d291ba06df8df3a35bdc23399a18e88fe3 -size 7788520 +oid sha256:be982bb81025a41d09c491e8e4b303a657d51b886eb6ac91890a4ba64979879c +size 13971136 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libclient.a b/P4Plugin/Source/p4api/lib/osxarm64/libclient.a new file mode 100644 index 0000000..371265e --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libclient.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dca78b1563557b93d684c708f7edfedecfdd8a8ef3d804d6a211f8e275ec275 +size 6632520 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libp4api.a b/P4Plugin/Source/p4api/lib/osxarm64/libp4api.a new file mode 100644 index 0000000..ae7d801 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libp4api.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b3100c18e3831baa29d6c76fd61b3e0e5fead33b22ecfa2e3dda3d810a07e28 +size 75325576 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libp4script.a b/P4Plugin/Source/p4api/lib/osxarm64/libp4script.a new file mode 100644 index 0000000..522ab77 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libp4script.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9813e62b5435e0006d5564d96c52d51b71f615f402ea1b8279eb55963e46aa1b +size 36302824 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libp4script_c.a b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_c.a new file mode 100644 index 0000000..af44cfe --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_c.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edb2e93fd24c99dd712f54649b39d784ffcdb719c25edea85985a31a51f53f88 +size 8270888 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libp4script_cstub.a b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_cstub.a new file mode 100644 index 0000000..3c67682 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_cstub.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14e3581ba2d546a55d1adc83dc0064ed9ae35c345d38566e7a2e19a4c7ba0881 +size 472800 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libp4script_curl.a b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_curl.a new file mode 100644 index 0000000..9857c44 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_curl.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03410334d03b26a7bfdc0895f50c502bd2d7ac332148ea42fe0b43313573869d +size 5803160 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libp4script_sqlite.a b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_sqlite.a new file mode 100644 index 0000000..19c3a7d --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libp4script_sqlite.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dd977e5e6a34312e2c86229d4e4a466769c1480eef80d40af0f87f304507699 +size 3951240 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/librpc.a b/P4Plugin/Source/p4api/lib/osxarm64/librpc.a new file mode 100644 index 0000000..7d57fc5 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/librpc.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa54d8ee5c039c62a1f5a7a6733c3a91579952b7604e73b88742485f91ec297b +size 1924712 diff --git a/P4Plugin/Source/p4api/lib/osxarm64/libsupp.a b/P4Plugin/Source/p4api/lib/osxarm64/libsupp.a new file mode 100644 index 0000000..2f91cad --- /dev/null +++ b/P4Plugin/Source/p4api/lib/osxarm64/libsupp.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e7f5fda263fc16fa14e546db51b314df1d9108b8544d9cbc46406b3d64d1c56 +size 12440824 diff --git a/P4Plugin/Source/p4api/lib/win32/libclient.lib b/P4Plugin/Source/p4api/lib/win32/libclient.lib index 4aedebd..fbbd898 100644 --- a/P4Plugin/Source/p4api/lib/win32/libclient.lib +++ b/P4Plugin/Source/p4api/lib/win32/libclient.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1e698e7bc003cc1f0d302c83d7be0522044e9cac0ac3c13f639ac92189bd225b -size 11650708 +oid sha256:7fa31d226f33c946e26d593e44e80cd0cf18d74f185810ac0c0f966cc8252531 +size 20359760 diff --git a/P4Plugin/Source/p4api/lib/win32/libp4api.lib b/P4Plugin/Source/p4api/lib/win32/libp4api.lib index 7748138..f00ba28 100644 --- a/P4Plugin/Source/p4api/lib/win32/libp4api.lib +++ b/P4Plugin/Source/p4api/lib/win32/libp4api.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5962c397bf7d84b7098a41317c60bef981467e80690018597beee4bceb4c0b9 -size 178015930 +oid sha256:b2749d0b3dc55db749668ad2bebe6418553acfee112d23266dacf724d60fc77c +size 217276874 diff --git a/P4Plugin/Source/p4api/lib/win32/libp4script.lib b/P4Plugin/Source/p4api/lib/win32/libp4script.lib index 704601e..5cd8383 100644 --- a/P4Plugin/Source/p4api/lib/win32/libp4script.lib +++ b/P4Plugin/Source/p4api/lib/win32/libp4script.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0ea6e0296d4757311f3701e236ee5a02c2a6717e45b9ae142a546f4e31ebd1ca -size 114554160 +oid sha256:3e9997a36ea238ae03287a1b47f515dbdc31b6aff365a7588e5d8d516986a743 +size 130993892 diff --git a/P4Plugin/Source/p4api/lib/win32/libp4script_c.lib b/P4Plugin/Source/p4api/lib/win32/libp4script_c.lib index 6b088a2..f11f19e 100644 --- a/P4Plugin/Source/p4api/lib/win32/libp4script_c.lib +++ b/P4Plugin/Source/p4api/lib/win32/libp4script_c.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:86fff78963df36f969d68b5993a1e42e4e66c069d12862a2b7ec93ced284ab17 -size 22569194 +oid sha256:0eac95d316e5a9cc9e49c2968e09421db08e2f525d94cd0ace753bd19cd9c4fc +size 25272816 diff --git a/P4Plugin/Source/p4api/lib/win32/libp4script_cstub.lib b/P4Plugin/Source/p4api/lib/win32/libp4script_cstub.lib new file mode 100644 index 0000000..8720d59 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/win32/libp4script_cstub.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cb10a936339f168c72480408992bbd9dff49b1ded0656a820890411d50eae82 +size 1160430 diff --git a/P4Plugin/Source/p4api/lib/win32/libp4script_curl.lib b/P4Plugin/Source/p4api/lib/win32/libp4script_curl.lib index 49a0f93..15dba7d 100644 --- a/P4Plugin/Source/p4api/lib/win32/libp4script_curl.lib +++ b/P4Plugin/Source/p4api/lib/win32/libp4script_curl.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cafe12ded4a0a71597a84ec7e5bbd9f98d53236564aef05bad0634c618ff9a2a -size 8011744 +oid sha256:ab3eff6294c46562ff000b34c0835d2a1999774a64a5bc6feb4f0ebe572ebac4 +size 9918618 diff --git a/P4Plugin/Source/p4api/lib/win32/libp4script_sqlite.lib b/P4Plugin/Source/p4api/lib/win32/libp4script_sqlite.lib index 188eee0..edec5cf 100644 --- a/P4Plugin/Source/p4api/lib/win32/libp4script_sqlite.lib +++ b/P4Plugin/Source/p4api/lib/win32/libp4script_sqlite.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3141ec3240d2ad613470ed39887d7fa6bce3a6b5b161aed3d59dcc637db791e9 -size 4453190 +oid sha256:272eaf0bf9aed8404c5f9295951b3d637eaebc596121a805f4820b6ba23ffd49 +size 5104818 diff --git a/P4Plugin/Source/p4api/lib/win32/librpc.lib b/P4Plugin/Source/p4api/lib/win32/librpc.lib index da15f6d..35d3c3d 100644 --- a/P4Plugin/Source/p4api/lib/win32/librpc.lib +++ b/P4Plugin/Source/p4api/lib/win32/librpc.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04a4a439746c6d645f9cd58deb20c0896d17d07741c3bd2358051480598f84f2 -size 2938680 +oid sha256:c819c5dddaff0e038987c828643ef440c6e9fc181fd9d2e913348f5b9a88b795 +size 3209432 diff --git a/P4Plugin/Source/p4api/lib/win32/libsupp.lib b/P4Plugin/Source/p4api/lib/win32/libsupp.lib index 6d87c18..93de99a 100644 --- a/P4Plugin/Source/p4api/lib/win32/libsupp.lib +++ b/P4Plugin/Source/p4api/lib/win32/libsupp.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:576a39f177d72378b7b719eb0c06739f9411df5efa7e2f70d5db3b66c02f1b78 -size 16525890 +oid sha256:8147a0460c52fd63da485ff8fa1c0375d07eab1ece966523c246bc2b9f3b7355 +size 26210054 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libclient.lib b/P4Plugin/Source/p4api/lib/win32debug/libclient.lib index a410b2d..dcfd5f3 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/libclient.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/libclient.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b1a4ac54dcf3550ea6b6b1596e44fed81ee87ebb8f1591d775d97de8db483be9 -size 12673390 +oid sha256:76c5a17754d78237ee1359d806598b647eaefc57ef94313d9fc442e0ebf254bf +size 22486636 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libp4api.lib b/P4Plugin/Source/p4api/lib/win32debug/libp4api.lib index b16d70b..48ada99 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/libp4api.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/libp4api.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e1f1d84a36812b32f9291f879013b321197a767e30e298a08850fa9adf4b95de -size 188227696 +oid sha256:042f9d632c5a4ad74db09b75c68d515afc5134b02e825b0bbafea4e183b8122d +size 232526224 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libp4script.lib b/P4Plugin/Source/p4api/lib/win32debug/libp4script.lib index 0d8031a..cfcc5ad 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/libp4script.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/libp4script.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b275af1ef78342ed456d1d458a859bc5d102b76a6fa00fde763824c803a532c3 -size 120912784 +oid sha256:a347278d36fc6d508d014f609b5c0ef2802fef01724926ec4290d76aca9dbeec +size 139643768 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libp4script_c.lib b/P4Plugin/Source/p4api/lib/win32debug/libp4script_c.lib index 4717564..01d0bf1 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/libp4script_c.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/libp4script_c.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:796376b1d50f57a8e07bff42f1f52e9281a1245752f40e8d8cc257b3227808ec -size 25250240 +oid sha256:2d6a9cd28a19fb79dd4a6fd97ededf0457defce2ec5166cd0fda0b2095a33263 +size 28714626 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libp4script_cstub.lib b/P4Plugin/Source/p4api/lib/win32debug/libp4script_cstub.lib new file mode 100644 index 0000000..7a26b40 --- /dev/null +++ b/P4Plugin/Source/p4api/lib/win32debug/libp4script_cstub.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e885e5fe2edc135198ef556cc123b9c3d479adf520f21f6a30c18b0770f6fd3 +size 1182926 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libp4script_curl.lib b/P4Plugin/Source/p4api/lib/win32debug/libp4script_curl.lib index 09cd910..6725a77 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/libp4script_curl.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/libp4script_curl.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e1bf0a4ad47cd2e3850106dd8adfc895dc8a80efaad74159046bacf874e583a -size 8041254 +oid sha256:2771658216e476e5ca6517483ba2c296f4b95c7090cd3fd463a19b1194640a1d +size 9954808 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libp4script_sqlite.lib b/P4Plugin/Source/p4api/lib/win32debug/libp4script_sqlite.lib index 6586c26..6f205f8 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/libp4script_sqlite.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/libp4script_sqlite.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:061b942c94f46428a3bc3604ba2986f1530220c59ec5f724bba7adf45b5e1590 -size 4453270 +oid sha256:8a77d77022d5bca7132483b5f08c9b848e6ab61f6712984aa07050b958a4bcfc +size 5104898 diff --git a/P4Plugin/Source/p4api/lib/win32debug/librpc.lib b/P4Plugin/Source/p4api/lib/win32debug/librpc.lib index 100b05e..0f78aa4 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/librpc.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/librpc.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6756ed917b88e51868d4b021c19c4f1b6285874e44380a3a615b27815686c6a1 -size 2938946 +oid sha256:da668e0266512ba04b5b88e33c40897e12fffa448ce07a6500c4c4b0397e23b2 +size 3209856 diff --git a/P4Plugin/Source/p4api/lib/win32debug/libsupp.lib b/P4Plugin/Source/p4api/lib/win32debug/libsupp.lib index d5357f1..bb048f4 100644 --- a/P4Plugin/Source/p4api/lib/win32debug/libsupp.lib +++ b/P4Plugin/Source/p4api/lib/win32debug/libsupp.lib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9600aa44e61ecef4e6dc3ad580d7b2171148ecbdb89cf77d487fdee0cd69ff2 -size 16895002 +oid sha256:d40b76e9c69f1fa13613f1d639c0933f8f6dabee91d8ab130618f5320a1dbe5b +size 27576798 diff --git a/PerforceBinaries/OSX/arm64/p4 b/PerforceBinaries/OSX/arm64/p4 new file mode 100755 index 0000000..43a13e4 --- /dev/null +++ b/PerforceBinaries/OSX/arm64/p4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2971578318a042183e09c68f7f06dd0c4820387116e15132b77980a854b2e839 +size 9302416 diff --git a/PerforceBinaries/OSX/arm64/p4d b/PerforceBinaries/OSX/arm64/p4d new file mode 100755 index 0000000..f92c921 --- /dev/null +++ b/PerforceBinaries/OSX/arm64/p4d @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82e397f0e4335f98e0049db40f8d75a3a35b7e1b47c99da574e56417b8202603 +size 15762336 diff --git a/PerforceBinaries/OSX/p4 b/PerforceBinaries/OSX/p4 deleted file mode 100644 index 0101201..0000000 --- a/PerforceBinaries/OSX/p4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f3ce186e969fa6ba3492046939a18f729cfd19f228fe79fd31413575d4ecaa20 -size 10136576 diff --git a/PerforceBinaries/OSX/p4d b/PerforceBinaries/OSX/p4d deleted file mode 100644 index c0ad874..0000000 --- a/PerforceBinaries/OSX/p4d +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5cc31ec639bfe2889e948eefdde6292fa1ad6589297b832187517570e0d90bf3 -size 16625856 diff --git a/PerforceBinaries/OSX/x86_64/p4 b/PerforceBinaries/OSX/x86_64/p4 new file mode 100755 index 0000000..16f240a --- /dev/null +++ b/PerforceBinaries/OSX/x86_64/p4 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4af459aa8fa5a0f064471c9468a4885fb0b03b032007fbc8573f9d97fd1acb48 +size 10639968 diff --git a/PerforceBinaries/OSX/x86_64/p4d b/PerforceBinaries/OSX/x86_64/p4d new file mode 100755 index 0000000..369fe08 --- /dev/null +++ b/PerforceBinaries/OSX/x86_64/p4d @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67be27312d3cdd7376fee993f3213e47d59bc4af1ae1bfc4c707496c60089283 +size 18071312 diff --git a/PerforceBinaries/Win_x64/p4.exe b/PerforceBinaries/Win_x64/p4.exe index 175eef2..f8b9ed6 100644 --- a/PerforceBinaries/Win_x64/p4.exe +++ b/PerforceBinaries/Win_x64/p4.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:daf7ecd942a98fca907e7a62d83b04467446a55fc79b18707fd7b4de85d25a07 -size 9064848 +oid sha256:bc272522d849610eb508b5b493618399e25c436044f334314759bae970cc666e +size 9594824 diff --git a/PerforceBinaries/Win_x64/p4d.exe b/PerforceBinaries/Win_x64/p4d.exe index abe423f..4e25de2 100644 --- a/PerforceBinaries/Win_x64/p4d.exe +++ b/PerforceBinaries/Win_x64/p4d.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c657ea46b14559a8f80d2b90bc029d5faa7ec52c366629d7bce40ff4d773d591 -size 14452112 +oid sha256:8ccb0e1af93f9f08007161d1912ca6a6c95a4a1e1d05896a979632fad9343a8d +size 15718344 diff --git a/PerforceBinaries/linux64/p4 b/PerforceBinaries/linux64/p4 old mode 100644 new mode 100755 index 382fc0d..c327b6b --- a/PerforceBinaries/linux64/p4 +++ b/PerforceBinaries/linux64/p4 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7831f142de71f0a4b976e16c25c486db44b35dc99bd2f0dfd391e3e27e8f5565 -size 10172296 +oid sha256:035dea7ef6abfb496259f64847954924d7479d096226fb961e13fb4e849ec6ca +size 10670792 diff --git a/PerforceBinaries/linux64/p4d b/PerforceBinaries/linux64/p4d old mode 100644 new mode 100755 index e04c6b6..4a45aac --- a/PerforceBinaries/linux64/p4d +++ b/PerforceBinaries/linux64/p4d @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4029b4246a43ea1397282be3a78ee7eb228db27ddbaba7748196964d06dcbb4d -size 17046504 +oid sha256:136ed308f1a003a2e8bfc75a8b862436aa1904fb5f19339ea02b2c7c51fbfe87 +size 18529160 diff --git a/README.md b/README.md index 3c3cb63..ae8ee44 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,15 @@ perl ./build.pl -test The Perforce plugin source code is located under `P4Plugin/Source`. It references the Perforce APIs, located under `P4Plugin/Source/p4api`. -We are targeting the 21.2 release of Perforce API includes and libraries, that were downloaded from -the [Perforce downloads page](http://filehost.perforce.com/perforce/r21.2/). +We are targeting the 24.1 release of Perforce API includes and libraries, that were downloaded from +the [Perforce downloads page](http://filehost.perforce.com/perforce/r24.1/). The `PerforceBinaries` where downloaded the same locations to run the integrations tests on. ```bash mkdir -p 'PerforceBinaries\Win_x64' -curl -ssL -o 'PerforceBinaries\Win_x64\p4.exe' 'https://filehost.perforce.com/perforce/r21.2/bin.ntx64/p4.exe' -curl -ssL -o 'PerforceBinaries\Win_x64\p4d.exe' 'https://filehost.perforce.com/perforce/r21.2/bin.ntx64/p4d.exe' +curl -ssL -o 'PerforceBinaries\Win_x64\p4.exe' 'https://filehost.perforce.com/perforce/r24.1/bin.ntx64/p4.exe' +curl -ssL -o 'PerforceBinaries\Win_x64\p4d.exe' 'https://filehost.perforce.com/perforce/r24.1/bin.ntx64/p4d.exe' ``` #### Windows diff --git a/build.pl b/build.pl index 6f79b41..fc45c04 100755 --- a/build.pl +++ b/build.pl @@ -64,7 +64,9 @@ } else { - TestMac(); + # Need to test both architectures if possible + TestMacX64(); + TestMacArm64(); } } elsif ($target eq "win32") @@ -126,18 +128,44 @@ () sub BuildMac { rmtree("Build"); - system("make" , "-f", "Makefile.osx", "all") && die ("Failed to build PerforcePlugin for macOS"); + system("make", "-f", "Makefile.osx", "clean-objs") && die ("Failed to clean build artifacts"); + + $ENV{'BUILD_TARGET'} = "P4PluginX64"; + system("make", "-f", "Makefile.osx", "all") && die ("Failed to macOS x64 build version control plugins"); + + # In between architectures clean up object files so they are not reused. + system("make", "-f", "Makefile.osx", "clean-objs") && die ("Failed to clean build artifacts"); + + $ENV{'BUILD_TARGET'} = "P4PluginArm64"; + system("make", "-f", "Makefile.osx", "all") && die ("Failed to macOS arm64 build version control plugins"); + + system("mkdir -p Build/OSX"); + system("lipo", "-create", "Build/OSXarm64/PerforcePlugin", "Build/OSXx64/PerforcePlugin", "-output", "Build/OSX/PerforcePlugin") && die ("Failed to create a universal macOS build version control plugin"); + system("lipo", "-create", "Build/OSXarm64/TestServer", "Build/OSXx64/TestServer", "-output", "Build/OSX/TestServer") && die ("Failed to create a universal macOS test server"); +} + +sub TestMacX64 +{ + $ENV{'P4DEXEC'} = "PerforceBinaries/OSX/x86_64/p4d"; + $ENV{'P4EXEC'} = "PerforceBinaries/OSX/x86_64/p4"; + $ENV{'P4PLUGIN'} = "Build/OSX/PerforcePlugin"; + $ENV{'TESTSERVER'} = "Build/OSX/TestServer"; + + # Teamcity artifacts looses their file attributes on transfer + chmod 0755, glob("Build/OSX/*"); + + TestPerforce(); } -sub TestMac +sub TestMacArm64 { - $ENV{'P4DEXEC'} = "PerforceBinaries/OSX/p4d"; - $ENV{'P4EXEC'} = "PerforceBinaries/OSX/p4"; - $ENV{'P4PLUGIN'} = "Build/OSXx64/PerforcePlugin"; - $ENV{'TESTSERVER'} = "Build/OSXx64/TestServer"; + $ENV{'P4DEXEC'} = "PerforceBinaries/OSX/arm64/p4d"; + $ENV{'P4EXEC'} = "PerforceBinaries/OSX/arm64/p4"; + $ENV{'P4PLUGIN'} = "Build/OSX/PerforcePlugin"; + $ENV{'TESTSERVER'} = "Build/OSX/TestServer"; # Teamcity artifacts looses their file attributes on transfer - chmod 0755, glob("Build/OSXx64/*"); + chmod 0755, glob("Build/OSX/*"); TestPerforce(); } diff --git a/download_perforce_binaries.ps1 b/download_perforce_binaries.ps1 index f0890b6..8a2a86f 100644 --- a/download_perforce_binaries.ps1 +++ b/download_perforce_binaries.ps1 @@ -1,10 +1,12 @@ Set-PSDebug -Trace 1 -curl -fssL -o 'PerforceBinaries/linux64/p4' 'https://filehost.perforce.com/perforce/r21.2/bin.linux26x86_64/p4' -curl -fssL -o 'PerforceBinaries/linux64/p4d' 'https://filehost.perforce.com/perforce/r21.2/bin.linux26x86_64/p4d' -curl -fssL -o 'PerforceBinaries/OSX/p4' 'https://filehost.perforce.com/perforce/r21.2/bin.macosx1015x86_64/p4' -curl -fssL -o 'PerforceBinaries/OSX/p4d' 'https://filehost.perforce.com/perforce/r21.2/bin.macosx1015x86_64/p4d' -curl -fssL -o 'PerforceBinaries\Win_x64\p4.exe' 'https://filehost.perforce.com/perforce/r21.2/bin.ntx64/p4.exe' -curl -fssL -o 'PerforceBinaries\Win_x64\p4d.exe' 'https://filehost.perforce.com/perforce/r21.2/bin.ntx64/p4d.exe' +curl -fssL -o 'PerforceBinaries/linux64/p4' 'https://filehost.perforce.com/perforce/r24.1/bin.linux26x86_64/p4' +curl -fssL -o 'PerforceBinaries/linux64/p4d' 'https://filehost.perforce.com/perforce/r24.1/bin.linux26x86_64/p4d' +curl -fssL -o 'PerforceBinaries/OSX/arm64/p4' 'https://filehost.perforce.com/perforce/r24.1/bin.macosx12arm64/p4' +curl -fssL -o 'PerforceBinaries/OSX/arm64/p4d' 'https://filehost.perforce.com/perforce/r24.1/bin.macosx12arm64/p4d' +curl -fssL -o 'PerforceBinaries/OSX/x86_64/p4' 'https://filehost.perforce.com/perforce/r24.1/bin.macosx1015x86_64/p4' +curl -fssL -o 'PerforceBinaries/OSX/x86_64/p4d' 'https://filehost.perforce.com/perforce/r24.1/bin.macosx1015x86_64/p4d' +curl -fssL -o 'PerforceBinaries\Win_x64\p4.exe' 'https://filehost.perforce.com/perforce/r24.1/bin.ntx64/p4.exe' +curl -fssL -o 'PerforceBinaries\Win_x64\p4d.exe' 'https://filehost.perforce.com/perforce/r24.1/bin.ntx64/p4d.exe' Set-PSDebug -Trace 0 From ff6073528c9bc381c6d1f42138e96a6357c43abe Mon Sep 17 00:00:00 2001 From: David Rogers Date: Wed, 10 Sep 2025 09:36:01 -0500 Subject: [PATCH 2/4] Update yamato images to match trunk --- .yamato/linux-build.yml | 4 ++-- .yamato/osx-build.yml | 3 ++- .yamato/windows-build.yml | 4 ++-- .yamato/zipVCSPlugins.yml | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.yamato/linux-build.yml b/.yamato/linux-build.yml index f58a93e..46c1dce 100644 --- a/.yamato/linux-build.yml +++ b/.yamato/linux-build.yml @@ -1,8 +1,8 @@ name: Linux - Build & Test VCS plugins agent: type: Unity::VM - image: cds-ops/ubuntu-16.04-katana-agent - flavor: b1.large + image: build-system/unity-extra-ubuntu-18.04:v0.1-551070 + flavor: b1.xlarge commands: # Build PerforcePlugin and TestServer diff --git a/.yamato/osx-build.yml b/.yamato/osx-build.yml index 52e54a4..3ed8622 100644 --- a/.yamato/osx-build.yml +++ b/.yamato/osx-build.yml @@ -1,8 +1,9 @@ name: Mac - Build & Test VCS plugins agent: type: Unity::VM::osx - image: desktop/unity-macos-10.15-xcode-12.2:stable + image: build-system/unity-macos-13:v2.4453738 flavor: b1.large + model: M1 commands: # Build PerforcePlugin and TestServer diff --git a/.yamato/windows-build.yml b/.yamato/windows-build.yml index ac63fbe..f18e23a 100644 --- a/.yamato/windows-build.yml +++ b/.yamato/windows-build.yml @@ -1,8 +1,8 @@ name: Win - Build & Test VCS plugins agent: type: Unity::VM - image: build-system/unity-win10-22H2-vs2022-unity:v2.4386385 - flavor: b1.large + image: build-system/unity-extra-windows-10:v0.3-553488 + flavor: b1.xlarge commands: # Build PerforcePlugin and TestServer diff --git a/.yamato/zipVCSPlugins.yml b/.yamato/zipVCSPlugins.yml index 10b82da..5bb33ee 100644 --- a/.yamato/zipVCSPlugins.yml +++ b/.yamato/zipVCSPlugins.yml @@ -1,8 +1,8 @@ name: Zip VCS plugins agent: type: Unity::VM - image: core-kaunas/win10-vs2010:latest - flavor: b1.small + image: build-system/unity-extra-windows-10:v0.3-553488 + flavor: b1.xlarge interpreter: powershell commands: From cbf4e29c1f626e65f816fe68acbae3905b2736e2 Mon Sep 17 00:00:00 2001 From: David Rogers Date: Wed, 10 Sep 2025 09:38:29 -0500 Subject: [PATCH 3/4] Use the arm image --- .yamato/osx-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.yamato/osx-build.yml b/.yamato/osx-build.yml index 3ed8622..fc12202 100644 --- a/.yamato/osx-build.yml +++ b/.yamato/osx-build.yml @@ -1,8 +1,8 @@ name: Mac - Build & Test VCS plugins agent: type: Unity::VM::osx - image: build-system/unity-macos-13:v2.4453738 - flavor: b1.large + image: build-system/unity-macos-13-arm64-unity:v2.4499056 + flavor: b1.xlarge model: M1 commands: From b846411eb4190dbb9976602ada671c27d03090ec Mon Sep 17 00:00:00 2001 From: David Rogers Date: Wed, 10 Sep 2025 09:47:21 -0500 Subject: [PATCH 4/4] Update macOS build commands --- .yamato/osx-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.yamato/osx-build.yml b/.yamato/osx-build.yml index fc12202..77aec6d 100644 --- a/.yamato/osx-build.yml +++ b/.yamato/osx-build.yml @@ -10,7 +10,8 @@ commands: - perl build.pl # Perforce CLI and server - - chmod +x PerforceBinaries/OSX/p4 PerforceBinaries/OSX/p4d + - chmod +x PerforceBinaries/OSX/arm64/p4 PerforceBinaries/OSX/arm64/p4d + - chmod +x PerforceBinaries/OSX/x86_64/p4 PerforceBinaries/OSX/x86_64/p4d # Run Perforce integration tests with the TestServer - perl build.pl -test @@ -18,4 +19,4 @@ commands: artifacts: builds: paths: - - "Build/OSXx64/PerforcePlugin" + - "Build/OSX/PerforcePlugin"