Compare commits
85 Commits
v0.7.2-rc1
...
master
Author | SHA1 | Date |
---|---|---|
|
41b8761590 | 1 week ago |
|
89a6f016a4 | 2 weeks ago |
|
f8fb9aaa7d | 2 weeks ago |
|
41f2cf74de | 3 weeks ago |
|
2937785446 | 3 weeks ago |
|
eaa96ecfba | 3 weeks ago |
|
4a34502aeb | 3 weeks ago |
|
4307450c02 | 3 weeks ago |
|
a4393e0e42 | 3 weeks ago |
|
511b7a6f2a | 3 weeks ago |
|
391c52271c | 3 weeks ago |
|
e6b7304ec5 | 3 weeks ago |
|
b217d75917 | 3 weeks ago |
|
7b80f733b6 | 4 weeks ago |
|
038478a96a | 4 weeks ago |
|
f22d3221a3 | 4 weeks ago |
|
d8ed2331c3 | 4 weeks ago |
|
6312c46663 | 4 weeks ago |
|
78a892e1af | 4 weeks ago |
|
63eaf1489a | 4 weeks ago |
|
4cbcec30b8 | 4 weeks ago |
|
dc7ec94549 | 4 weeks ago |
|
faa3b1c22f | 4 weeks ago |
|
0caded833e | 1 month ago |
|
872a564889 | 1 month ago |
|
5c1fe0a5e6 | 1 month ago |
|
6ab4624cfb | 1 month ago |
|
f0407636d3 | 1 month ago |
|
5d744d328a | 1 month ago |
|
4ee8a9aac4 | 1 month ago |
|
31f2ca5e30 | 1 month ago |
|
57cd928c63 | 1 month ago |
|
32c6cf0ebd | 1 month ago |
|
ec1b9c017f | 1 month ago |
|
55712618fa | 1 month ago |
|
a0a31b4f64 | 2 months ago |
|
4cad060334 | 2 months ago |
|
121cf54d9b | 2 months ago |
|
7497b1da3f | 2 months ago |
|
0e92ec4790 | 2 months ago |
|
44eb25e10e | 2 months ago |
|
046b6cecdd | 2 months ago |
|
b6291a51e6 | 2 months ago |
|
ba220022d0 | 2 months ago |
|
8491ff5aa9 | 2 months ago |
|
c363c96cd5 | 2 months ago |
|
23a2d53a3b | 2 months ago |
|
4f43b260cc | 2 months ago |
|
6ec1f8c80e | 2 months ago |
|
d23b4cde8c | 2 months ago |
|
4d0b1e1fb8 | 2 months ago |
|
366c1a233f | 2 months ago |
|
86668eeb96 | 2 months ago |
|
e99284aadd | 2 months ago |
|
5912cce19f | 2 months ago |
|
1e13c385fe | 2 months ago |
|
291ffd263c | 2 months ago |
|
ffff9b83b2 | 2 months ago |
|
14b1d87ad8 | 2 months ago |
|
f7d291bbe9 | 2 months ago |
|
c39984da9e | 2 months ago |
|
a65d1d8a2b | 2 months ago |
|
054f4cc9e3 | 2 months ago |
|
66b103ac55 | 2 months ago |
|
33b8924384 | 2 months ago |
|
4aa92187a7 | 2 months ago |
|
976ae0f75a | 2 months ago |
|
77d6244cea | 2 months ago |
|
cdd8043489 | 2 months ago |
|
fb0b559d04 | 2 months ago |
|
7f439879e0 | 2 months ago |
|
a41e8e0d1f | 2 months ago |
|
01b81d068b | 2 months ago |
|
6e5581ba79 | 2 months ago |
|
dbf0c91f47 | 3 months ago |
|
bcaccc8bd4 | 3 months ago |
|
ad1d03d257 | 3 months ago |
|
94449aa324 | 3 months ago |
|
325498d1d6 | 3 months ago |
|
3c743a9e92 | 3 months ago |
|
bdd2a02a10 | 3 months ago |
|
3f0ecf769d | 3 months ago |
|
8732ada5a6 | 3 months ago |
|
12151d2ae2 | 3 months ago |
|
4eb75cf4fb | 3 months ago |
@ -0,0 +1,70 @@
|
||||
name: Update Meson Version and Recreate Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install GitHub CLI
|
||||
run: sudo apt-get install -y gh
|
||||
|
||||
- name: Extract version from release
|
||||
id: extract_version
|
||||
run: echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Fetch release description
|
||||
id: fetch_description
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
TAG_NAME=${{ env.version }}
|
||||
DESCRIPTION=$(gh release view $TAG_NAME --json body -q .body)
|
||||
echo "description=$DESCRIPTION" >> $GITHUB_ENV
|
||||
|
||||
- name: Update meson.build
|
||||
run: |
|
||||
VERSION=${{ env.version }}
|
||||
sed -i "s/^\(\s*version\s*:\s*'\)[^']*'/\1${VERSION}'/" meson.build
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add meson.build
|
||||
git commit -m "Update version to ${{ env.version }}"
|
||||
git push origin HEAD:refs/heads/master
|
||||
|
||||
- name: Force-update tag
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
TAG_NAME=${{ env.version }}
|
||||
git tag -fa $TAG_NAME -m "Update tag to include version update"
|
||||
git push origin --force $TAG_NAME
|
||||
|
||||
- name: Recreate release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
TAG_NAME=${{ env.version }}
|
||||
DESCRIPTION=${{ env.description }}
|
||||
gh release delete $TAG_NAME --yes
|
||||
gh release create $TAG_NAME --target $(git rev-parse HEAD) --title "$TAG_NAME" --notes "$DESCRIPTION"
|
||||
|
||||
- name: Trigger other workflows
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
TAG_NAME=${{ env.version }}
|
||||
gh workflow run .github/workflows/build-source.yml --ref $TAG_NAME
|
||||
gh workflow run .github/workflows/build-package.yml --ref $TAG_NAME
|
@ -0,0 +1,92 @@
|
||||
#include "shell.h"
|
||||
#include <thread>
|
||||
#include <iostream>
|
||||
#include <sys/wait.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "string_utils.h"
|
||||
#include <array>
|
||||
|
||||
std::string Shell::readOutput() {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
|
||||
std::array<char, 128> buffer;
|
||||
std::string result;
|
||||
ssize_t count;
|
||||
while ((count = ::read(from_shell[0], buffer.data(), buffer.size())) > 0) {
|
||||
result.append(buffer.data(), count);
|
||||
}
|
||||
|
||||
// Split the result into lines and return the last line
|
||||
std::istringstream stream(result);
|
||||
std::string line;
|
||||
std::string last_line;
|
||||
while (std::getline(stream, line)) {
|
||||
last_line = line;
|
||||
}
|
||||
|
||||
SPDLOG_DEBUG("Shell: recieved output: {}", last_line);
|
||||
return last_line;
|
||||
}
|
||||
|
||||
Shell::Shell() {
|
||||
static bool failed;
|
||||
if (pipe(to_shell) == -1) {
|
||||
SPDLOG_ERROR("Failed to create to_shell pipe: {}", strerror(errno));
|
||||
failed = true;
|
||||
}
|
||||
|
||||
if (pipe(from_shell) == -1) {
|
||||
SPDLOG_ERROR("Failed to create from_shell pipe: {}", strerror(errno));
|
||||
failed = true;
|
||||
}
|
||||
|
||||
// if either pipe fails, there's no point in continuing.
|
||||
if (failed){
|
||||
SPDLOG_ERROR("Shell has failed, will not be able to use exec");
|
||||
return;
|
||||
}
|
||||
|
||||
shell_pid = fork();
|
||||
|
||||
if (shell_pid == 0) { // Child process
|
||||
close(to_shell[1]);
|
||||
close(from_shell[0]);
|
||||
|
||||
dup2(to_shell[0], STDIN_FILENO);
|
||||
dup2(from_shell[1], STDOUT_FILENO);
|
||||
dup2(from_shell[1], STDERR_FILENO);
|
||||
execl("/bin/sh", "sh", "-c", "unset LD_PRELOAD; exec /bin/sh", nullptr);
|
||||
exit(1); // Exit if execl fails
|
||||
} else {
|
||||
close(to_shell[0]);
|
||||
close(from_shell[1]);
|
||||
|
||||
// Set the read end of the from_shell pipe to non-blocking
|
||||
setNonBlocking(from_shell[0]);
|
||||
}
|
||||
success = true;
|
||||
}
|
||||
|
||||
std::string Shell::exec(std::string cmd) {
|
||||
if (!success)
|
||||
return "";
|
||||
|
||||
writeCommand(cmd);
|
||||
return readOutput();
|
||||
}
|
||||
|
||||
void Shell::writeCommand(std::string command) {
|
||||
if (write(to_shell[1], command.c_str(), command.length()) == -1)
|
||||
SPDLOG_ERROR("Failed to write to shell");
|
||||
|
||||
trim(command);
|
||||
SPDLOG_DEBUG("Shell: wrote command: {}", command);
|
||||
}
|
||||
|
||||
Shell::~Shell() {
|
||||
if (write(to_shell[1], "exit\n", 5) == -1)
|
||||
SPDLOG_ERROR("Failed exit shell");
|
||||
close(to_shell[1]);
|
||||
close(from_shell[0]);
|
||||
waitpid(shell_pid, nullptr, 0);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <cstring>
|
||||
#ifdef __linux__
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
class Shell {
|
||||
private:
|
||||
int to_shell[2];
|
||||
int from_shell[2];
|
||||
pid_t shell_pid;
|
||||
bool success;
|
||||
|
||||
#ifdef __linux__
|
||||
void setNonBlocking(int fd) {
|
||||
int flags = fcntl(fd, F_GETFL, 0);
|
||||
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
||||
}
|
||||
#endif
|
||||
|
||||
void writeCommand(std::string command);
|
||||
std::string readOutput();
|
||||
|
||||
public:
|
||||
Shell();
|
||||
~Shell();
|
||||
std::string exec(std::string cmd);
|
||||
|
||||
};
|
||||
|
||||
extern std::unique_ptr<Shell> shell;
|
@ -1,13 +1,13 @@
|
||||
[wrap-file]
|
||||
directory = spdlog-1.13.0
|
||||
source_url = https://github.com/gabime/spdlog/archive/refs/tags/v1.13.0.tar.gz
|
||||
source_filename = spdlog-1.13.0.tar.gz
|
||||
source_hash = 534f2ee1a4dcbeb22249856edfb2be76a1cf4f708a20b0ac2ed090ee24cfdbc9
|
||||
patch_filename = spdlog_1.13.0-1_patch.zip
|
||||
patch_url = https://wrapdb.mesonbuild.com/v2/spdlog_1.13.0-1/get_patch
|
||||
patch_hash = 556b539cf582a46673ede4202ac037b891328dd5ea76862ffe05b060fc4f4775
|
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/spdlog_1.13.0-1/spdlog-1.13.0.tar.gz
|
||||
wrapdb_version = 1.13.0-1
|
||||
directory = spdlog-1.14.1
|
||||
source_url = https://github.com/gabime/spdlog/archive/refs/tags/v1.14.1.tar.gz
|
||||
source_filename = spdlog-1.14.1.tar.gz
|
||||
source_hash = 1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b
|
||||
patch_filename = spdlog_1.14.1-1_patch.zip
|
||||
patch_url = https://wrapdb.mesonbuild.com/v2/spdlog_1.14.1-1/get_patch
|
||||
patch_hash = ae878e732330ea1048f90d7e117c40c0cd2a6fb8ae5492c7955818ce3aaade6c
|
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/spdlog_1.14.1-1/spdlog-1.14.1.tar.gz
|
||||
wrapdb_version = 1.14.1-1
|
||||
|
||||
[provide]
|
||||
spdlog = spdlog_dep
|
||||
|
Loading…
Reference in New Issue