From 76c57401fa7cf751be3e642c6b11879f72323ff2 Mon Sep 17 00:00:00 2001 From: Brian Bockelman Date: Mon, 29 Jan 2024 08:32:22 -0600 Subject: [PATCH] Change OSX build script to patch in `pelican://` protocol support Note the patchfile itself ran afoul of the precommit cleanup; it has been added to the exclude path. --- .pre-commit-config.yaml | 1 + github_scripts/osx_install.sh | 6 ++- github_scripts/pelican_protocol.patch | 77 +++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 github_scripts/pelican_protocol.patch diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e882b4950..a782ff8fb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ repos: rev: v3.2.0 hooks: - id: trailing-whitespace + exclude: github_scripts/pelican_protocol.patch - id: end-of-file-fixer - id: check-yaml # Multi-documents are yaml files with multiple --- separating blocks, like diff --git a/github_scripts/osx_install.sh b/github_scripts/osx_install.sh index d8580c93f..b6dffb9a8 100755 --- a/github_scripts/osx_install.sh +++ b/github_scripts/osx_install.sh @@ -19,6 +19,8 @@ # Mac OS X instance in GitHub. # +scriptdir=`dirname $0` + brew install minio xrootd ninja mkdir dependencies @@ -60,11 +62,13 @@ popd git clone --depth=1 https://github.com/xrootd/xrootd.git pushd xrootd +patch -p1 $scriptdir/pelican_protocol.patch mkdir build cd build cmake .. -GNinja -ninja libXrdAccSciTokens-5.so +ninja libXrdAccSciTokens-5.so libXrdPss-5.so sudo ln -s $PWD/src/libXrdAccSciTokens-5.so $xrootd_libdir +sudo ln -s $PWD/src/libXrdPss-5.so $xrootd_libdir popd popd diff --git a/github_scripts/pelican_protocol.patch b/github_scripts/pelican_protocol.patch new file mode 100644 index 000000000..87bf34195 --- /dev/null +++ b/github_scripts/pelican_protocol.patch @@ -0,0 +1,77 @@ +From 5b7357cb59a1ffe2fb99b68c1dc5796fd063acdb Mon Sep 17 00:00:00 2001 +From: Brian Bockelman +Date: Thu, 25 Jan 2024 09:46:39 -0600 +Subject: [PATCH] Add support for pelican:// protocol + +In https://github.com/PelicanPlatform/xrdcl-pelican, we are developing +a XrdCl plugin that can talk to the infrastructure for a new project, +christening the URL scheme `pelican://`. + +This commit adds the new schema so it can be utilized from both +xrdcp (primarily for testing) and XCache. +--- + src/XrdApps/XrdCpConfig.cc | 2 ++ + src/XrdApps/XrdCpFile.cc | 1 + + src/XrdApps/XrdCpFile.hh | 2 +- + src/XrdPss/XrdPssUtils.cc | 3 ++- + 4 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/XrdApps/XrdCpConfig.cc b/src/XrdApps/XrdCpConfig.cc +index 890f80198cc..7f8e8702efa 100644 +--- a/src/XrdApps/XrdCpConfig.cc ++++ b/src/XrdApps/XrdCpConfig.cc +@@ -385,6 +385,7 @@ do{while(optind < Argc && Legacy(optind)) {} + if (dstFile->Protocol != XrdCpFile::isFile + && dstFile->Protocol != XrdCpFile::isStdIO + && dstFile->Protocol != XrdCpFile::isXroot ++ && dstFile->Protocol != XrdCpFile::isPelican + && (!Want(DoAllowHttp) && ((dstFile->Protocol == XrdCpFile::isHttp) || + (dstFile->Protocol == XrdCpFile::isHttps)))) + {FMSG(dstFile->ProtName <<"file protocol is not supported.", 22)} +@@ -903,6 +904,7 @@ void XrdCpConfig::ProcFile(const char *fname) + } + else if (!((pFile->Protocol == XrdCpFile::isXroot) || + (pFile->Protocol == XrdCpFile::isXroots) || ++ (pFile->Protocol == XrdCpFile::isPelican) || + (Want(DoAllowHttp) && ((pFile->Protocol == XrdCpFile::isHttp) || + (pFile->Protocol == XrdCpFile::isHttps))))) + {FMSG(pFile->ProtName <<" file protocol is not supported.", 22)} +diff --git a/src/XrdApps/XrdCpFile.cc b/src/XrdApps/XrdCpFile.cc +index a6f8a6496e2..e1e5dc98086 100644 +--- a/src/XrdApps/XrdCpFile.cc ++++ b/src/XrdApps/XrdCpFile.cc +@@ -56,6 +56,7 @@ XrdCpFile::XrdCpFile(const char *FSpec, int &badURL) + {"root://", 7, isXroot}, + {"roots://", 8, isXroots}, + {"http://", 7, isHttp}, ++ {"pelican://", 10, isPelican}, + {"https://", 8, isHttps} + }; + static int pTnum = sizeof(pTab)/sizeof(struct proto); +diff --git a/src/XrdApps/XrdCpFile.hh b/src/XrdApps/XrdCpFile.hh +index ef09301b56c..03972c360d8 100644 +--- a/src/XrdApps/XrdCpFile.hh ++++ b/src/XrdApps/XrdCpFile.hh +@@ -38,7 +38,7 @@ class XrdCpFile + public: + + enum PType {isOther = 0, isDir, isFile, isStdIO, +- isXroot, isXroots, isHttp, isHttps, isDevNull, isDevZero ++ isXroot, isXroots, isHttp, isHttps, isPelican, isDevNull, isDevZero + }; + + XrdCpFile *Next; // -> Next file in list +diff --git a/src/XrdPss/XrdPssUtils.cc b/src/XrdPss/XrdPssUtils.cc +index be14fa55c9a..42f37534f14 100644 +--- a/src/XrdPss/XrdPssUtils.cc ++++ b/src/XrdPss/XrdPssUtils.cc +@@ -42,7 +42,8 @@ namespace + struct pEnt {const char *pname; int pnlen;} pTab[] = + {{ "https://", 8}, { "http://", 7}, + { "roots://", 8}, { "root://", 7}, +- {"xroots://", 9}, {"xroot://", 8} ++ {"xroots://", 9}, {"xroot://", 8}, ++ {"pelican://", 10} + }; + int pTNum = sizeof(pTab)/sizeof(pEnt); + int xrBeg = 2;