aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/update-flake.yml26
-rw-r--r--flake.lock48
-rw-r--r--launcher/FileSystem.cpp9
-rw-r--r--launcher/FileSystem.h9
4 files changed, 77 insertions, 15 deletions
diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml
new file mode 100644
index 00000000..c790c9c6
--- /dev/null
+++ b/.github/workflows/update-flake.yml
@@ -0,0 +1,26 @@
+name: Update Flake Lockfile
+
+on:
+ schedule:
+ # run weekly on sunday
+ - cron: "0 0 * * 0"
+ workflow_dispatch:
+
+permissions:
+ pull-requests: write
+
+jobs:
+ update-flake:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - uses: cachix/install-nix-action@v22
+
+ - uses: DeterminateSystems/update-flake-lock@v19
+ with:
+ commit-msg: "chore(nix): update lockfile"
+ pr-title: "chore(nix): update lockfile"
+ pr-labels: |
+ Linux
+ simple change
diff --git a/flake.lock b/flake.lock
index 87586643..91a67f08 100644
--- a/flake.lock
+++ b/flake.lock
@@ -21,11 +21,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
- "lastModified": 1683560683,
- "narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=",
+ "lastModified": 1688254665,
+ "narHash": "sha256-8FHEgBrr7gYNiS/NzCxIO3m4hvtLRW9YY1nYo1ivm3o=",
"owner": "hercules-ci",
"repo": "flake-parts",
- "rev": "006c75898cf814ef9497252b022e91c946ba8e17",
+ "rev": "267149c58a14d15f7f81b4d737308421de9d7152",
"type": "github"
},
"original": {
@@ -35,12 +35,15 @@
}
},
"flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
"locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
+ "lastModified": 1685518550,
+ "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
+ "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
@@ -88,11 +91,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1685012353,
- "narHash": "sha256-U3oOge4cHnav8OLGdRVhL45xoRj4Ppd+It6nPC9nNIU=",
+ "lastModified": 1688221086,
+ "narHash": "sha256-cdW6qUL71cNWhHCpMPOJjlw0wzSRP0pVlRn2vqX/VVg=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "aeb75dba965e790de427b73315d5addf91a54955",
+ "rev": "cd99c2b3c9f160cd004318e0697f90bbd5960825",
"type": "github"
},
"original": {
@@ -105,11 +108,11 @@
"nixpkgs-lib": {
"locked": {
"dir": "lib",
- "lastModified": 1682879489,
- "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=",
+ "lastModified": 1688049487,
+ "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0",
+ "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9",
"type": "github"
},
"original": {
@@ -135,11 +138,11 @@
]
},
"locked": {
- "lastModified": 1684842236,
- "narHash": "sha256-rYWsIXHvNhVQ15RQlBUv67W3YnM+Pd+DuXGMvCBq2IE=",
+ "lastModified": 1688386108,
+ "narHash": "sha256-Vffto9QaVonzYAcPlAzd0soqWYpPpKk60dfNLSIXcFA=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
- "rev": "61e567d6497bc9556f391faebe5e410e6623217f",
+ "rev": "42587d3414d1747999a5f71e92a83cf6547b62da",
"type": "github"
},
"original": {
@@ -156,6 +159,21 @@
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp
index 3ce8dd2c..812d45eb 100644
--- a/launcher/FileSystem.cpp
+++ b/launcher/FileSystem.cpp
@@ -36,6 +36,7 @@
*/
#include "FileSystem.h"
+#include <QPair>
#include "BuildConfig.h"
@@ -246,6 +247,7 @@ bool copy::operator()(const QString& offset, bool dryRun)
{
using copy_opts = fs::copy_options;
m_copied = 0; // reset counter
+ m_failedPaths.clear();
// NOTE always deep copy on windows. the alternatives are too messy.
#if defined Q_OS_WIN32
@@ -277,6 +279,9 @@ bool copy::operator()(const QString& offset, bool dryRun)
qWarning() << "Failed to copy files:" << QString::fromStdString(err.message());
qDebug() << "Source file:" << src_path;
qDebug() << "Destination file:" << dst_path;
+ m_failedPaths.append(dst_path);
+ emit copyFailed(relative_dst_path);
+ return;
}
m_copied++;
emit fileCopied(relative_dst_path);
@@ -1077,6 +1082,7 @@ bool clone::operator()(const QString& offset, bool dryRun)
}
m_cloned = 0; // reset counter
+ m_failedClones.clear();
auto src = PathCombine(m_src.absolutePath(), offset);
auto dst = PathCombine(m_dst.absolutePath(), offset);
@@ -1097,6 +1103,9 @@ bool clone::operator()(const QString& offset, bool dryRun)
qDebug() << "Failed to clone files: error" << err.value() << "message" << QString::fromStdString(err.message());
qDebug() << "Source file:" << src_path;
qDebug() << "Destination file:" << dst_path;
+ m_failedClones.append(qMakePair(src_path, dst_path));
+ emit cloneFailed(src_path, dst_path);
+ return;
}
m_cloned++;
emit fileCloned(src_path, dst_path);
diff --git a/launcher/FileSystem.h b/launcher/FileSystem.h
index cb581d0c..f8a82bae 100644
--- a/launcher/FileSystem.h
+++ b/launcher/FileSystem.h
@@ -43,6 +43,7 @@
#include <system_error>
#include <QDir>
+#include <QPair>
#include <QFlags>
#include <QLocalServer>
#include <QObject>
@@ -112,9 +113,12 @@ class copy : public QObject {
bool operator()(bool dryRun = false) { return operator()(QString(), dryRun); }
int totalCopied() { return m_copied; }
+ int totalFailed() { return m_failedPaths.length(); }
+ QStringList failed() { return m_failedPaths; }
signals:
void fileCopied(const QString& relativeName);
+ void copyFailed(const QString& relativeName);
// TODO: maybe add a "shouldCopy" signal in the future?
private:
@@ -127,6 +131,7 @@ class copy : public QObject {
QDir m_src;
QDir m_dst;
int m_copied;
+ QStringList m_failedPaths;
};
struct LinkPair {
@@ -471,6 +476,9 @@ class clone : public QObject {
bool operator()(bool dryRun = false) { return operator()(QString(), dryRun); }
int totalCloned() { return m_cloned; }
+ int totalFailed() { return m_failedClones.length(); }
+
+ QList<QPair<QString, QString>> failed() { return m_failedClones; }
signals:
void fileCloned(const QString& src, const QString& dst);
@@ -485,6 +493,7 @@ class clone : public QObject {
QDir m_src;
QDir m_dst;
int m_cloned;
+ QList<QPair<QString, QString>> m_failedClones;
};
/**