Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/branch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ jobs:
SHORT_SHA=$(git rev-parse --short=7 HEAD)
SAFE_BRANCH="${{ needs.check-authorization.outputs.safe_tag }}"
cd _build/stage/app
ditto -c -k --keepParent UTV.app "${GITHUB_WORKSPACE}/_dist/UTV-${SAFE_BRANCH}-${SHORT_SHA}-macOS-arm64.zip"
ditto -c -k --sequesterRsrc --keepParent UTV.app "${GITHUB_WORKSPACE}/_dist/UTV-${SAFE_BRANCH}-${SHORT_SHA}-macOS-arm64.zip"
shell: bash

- name: Upload macOS Branch Artifact
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,20 +250,20 @@ jobs:
export COPYFILE_DISABLE=1
find "$APP_PATH" -name "._*" -delete
cd _build/stage/app
/usr/bin/ditto -c -k --keepParent UTV.app "$ZIP_NAME"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent UTV.app "$ZIP_NAME"

if [ -n "${APPLE_API_KEY_ID}" ] && [ -n "${APPLE_API_ISSUER}" ] && [ -n "${APPLE_API_KEY}" ]; then
KEY_FILE=$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8
echo "$APPLE_API_KEY" | base64 --decode > "$KEY_FILE"
xcrun notarytool submit "$ZIP_NAME" --key "$KEY_FILE" --key-id "$APPLE_API_KEY_ID" --issuer "$APPLE_API_ISSUER" --wait
xcrun stapler staple UTV.app
rm -f "$ZIP_NAME"
/usr/bin/ditto -c -k --keepParent UTV.app "$ZIP_NAME"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent UTV.app "$ZIP_NAME"
fi
else
codesign --force --deep --sign - "$APP_PATH"
cd _build/stage/app
/usr/bin/ditto -c -k --keepParent UTV.app "$ZIP_NAME"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent UTV.app "$ZIP_NAME"
fi
shell: bash

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ jobs:
export COPYFILE_DISABLE=1
find "$APP_PATH" -name "._*" -delete
cd _build/stage/app
/usr/bin/ditto -c -k --keepParent UTV.app "$ZIP_NAME"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent UTV.app "$ZIP_NAME"

if [ -n "${APPLE_API_KEY_ID}" ] && [ -n "${APPLE_API_ISSUER}" ] && [ -n "${APPLE_API_KEY}" ]; then
echo "--- Submitting to Apple Notary Service ---"
Expand Down Expand Up @@ -352,15 +352,15 @@ jobs:
xcrun stapler staple UTV.app
xcrun stapler validate UTV.app
rm -f "$ZIP_NAME"
/usr/bin/ditto -c -k --keepParent UTV.app "$ZIP_NAME"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent UTV.app "$ZIP_NAME"
else
echo "Apple Notary API credentials not configured; skipping notarization submission."
fi
else
echo "No Developer ID certificate configured. Applying Ad-Hoc code signature."
codesign --force --deep --sign - "$APP_PATH"
cd _build/stage/app
/usr/bin/ditto -c -k --keepParent UTV.app "$ZIP_NAME"
/usr/bin/ditto -c -k --sequesterRsrc --keepParent UTV.app "$ZIP_NAME"
fi
shell: bash

Expand Down
12 changes: 12 additions & 0 deletions src/lib/app/DarwinBundle/DarwinBundle.mm
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ - (void) getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDesc
setEnvVar("PYTHONHOME", SYSTEM_PYTHONHOME, true);
#endif
}

// Keep Python's bytecode cache out of the app bundle: a __pycache__ written
// under Contents/ breaks the bundle's code signature.
if (!getenv("PYTHONPYCACHEPREFIX"))
{
NSArray *caches = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
if ([caches count] > 0)
{
NSString *prefix = [[caches objectAtIndex:0] stringByAppendingPathComponent:@"UTV/pycache"];
setEnvVar("PYTHONPYCACHEPREFIX", [prefix UTF8String], true);
}
}

bool forceToFront = (!getenv("RV_PYTHONPATH_APPEND_ONLY"));
#ifdef SYSTEM_PYTHONPATH
Expand Down
13 changes: 13 additions & 0 deletions src/lib/app/QTBundle/QTBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
//******************************************************************************
#include <QTBundle/QTBundle.h>
#include <QtCore/QStandardPaths>
#include <sstream>
#include <iostream>
#include <algorithm>
Expand Down Expand Up @@ -140,6 +141,18 @@ namespace TwkApp
setEnvVar("PYTHONHOME", resolvedPythonHome.toUtf8().constData(), true);
}

// Keep Python's bytecode cache out of the install directory, which
// usually isn't writable (Program Files, /opt), so modules are
// compiled once rather than on every launch.
if (!getenv("PYTHONPYCACHEPREFIX"))
{
QString cache = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation);
if (!cache.isEmpty())
{
setEnvVar("PYTHONPYCACHEPREFIX", QDir(cache).absoluteFilePath("UTV/pycache").toUtf8().constData(), true);
}
}

bool forceToFront = (!getenv("RV_PYTHONPATH_APPEND_ONLY"));

if (depsRoot)
Expand Down
4 changes: 4 additions & 0 deletions src/lib/base/TwkUtil/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ namespace TwkUtil

for (int f = 0; f < re.matchCount(); ++f)
{
// Skip macOS AppleDouble files ("._name"), which unzip
// and SMB shares leave next to the real ones.
if (re.fileName(f).compare(0, 2, "._") == 0)
continue;
matchedFiles.push_back(pathdirs[d] + "/" + re.fileName(f));
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/lib/ip/IPCore/BrushTextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ namespace IPCore
std::vector<std::string> files;
const QDir dir(QString::fromStdString(tipDir()));
for (const QFileInfo& fi : dir.entryInfoList(QStringList() << "*.png", QDir::Files, QDir::Name))
files.push_back(fi.fileName().toStdString());
{
if (!fi.fileName().startsWith("._"))
files.push_back(fi.fileName().toStdString());
}
return files;
}

Expand Down
4 changes: 4 additions & 0 deletions src/lib/ip/IPCore/NodeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ namespace IPCore
{
path p = di->path();

// Skip macOS AppleDouble files ("._name.gto")
if (p.filename().string().compare(0, 2, "._") == 0)
continue;

if (p.has_extension())
{
path ext = p.extension();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ip/IPCore/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace IPCore
{
path p = q->path();

if (p.extension() == ".profile")
if (p.extension() == ".profile" && p.filename().string().compare(0, 2, "._") != 0)
{
fspaths.push_back(p);
}
Expand Down
Loading