Skip to content

Commit

Permalink
Change OSX build script to patch in pelican:// protocol support
Browse files Browse the repository at this point in the history
Note the patchfile itself ran afoul of the precommit cleanup; it has
been added to the exclude path.
  • Loading branch information
bbockelm committed Jan 29, 2024
1 parent 69b10fc commit 76c5740
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion github_scripts/osx_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# Mac OS X instance in GitHub.
#

scriptdir=`dirname $0`

brew install minio xrootd ninja

mkdir dependencies
Expand Down Expand Up @@ -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
Expand Down
77 changes: 77 additions & 0 deletions github_scripts/pelican_protocol.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
From 5b7357cb59a1ffe2fb99b68c1dc5796fd063acdb Mon Sep 17 00:00:00 2001
From: Brian Bockelman <[email protected]>
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;

0 comments on commit 76c5740

Please sign in to comment.