From 33ad13ca2b1dabcdcd4b9d62f08a569c42cf25b4 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Sat, 21 Nov 2026 19:58:55 -0600 Subject: [PATCH] Rebase on tessesframework 0.0.12, add offline updating of the shell --- .gitea/workflows/tag.yaml | 2 +- changelog.md | 3 +++ cmake/findtf.cmake | 2 +- cmake/version.cmake | 2 +- src/program_lib/crosslang.cpp | 43 +++++++++++++++++++++++------------ src/programs/slim.cpp | 4 +++- 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/tag.yaml b/.gitea/workflows/tag.yaml index 3f3bda7..66e5a53 100644 --- a/.gitea/workflows/tag.yaml +++ b/.gitea/workflows/tag.yaml @@ -5,7 +5,7 @@ on: - 'v*' env: - TF_VERSION: 0.0.11 + TF_VERSION: 0.0.12 PACKAGE_AND_BREW: ${{ secrets.PACKAGE_AND_BREW }} VERSION: ${{ gitea.ref_name }} RESULT_IMAGE_NAME: tesses50/crosslang diff --git a/changelog.md b/changelog.md index 88852f7..54e2548 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Changelog +## 0.0.14 +Rebase on tessesframework 0.0.12, add offline updating of the shell + ## 0.0.13 Fix the event loop so it isn't 100% CPU utilization diff --git a/cmake/findtf.cmake b/cmake/findtf.cmake index b5c4183..269baee 100644 --- a/cmake/findtf.cmake +++ b/cmake/findtf.cmake @@ -5,7 +5,7 @@ set(CROSSLANG_STATIC ${TESSESFRAMEWORK_STATIC} CACHE INTERNAL "For CrossLang" FO FetchContent_Declare( TessesFramework GIT_REPOSITORY https://git.tesses.org/tesses50/tessesframework.git - GIT_TAG 7649a1ad4c4fc230c96bcf044fd36f6cef1671be + GIT_TAG f6f81bf9099e672300a0cd51c3cb0f1c2d1e54e7 ) set(TESSESFRAMEWORK_ENABLE_EXAMPLES OFF) FetchContent_MakeAvailable(TessesFramework) diff --git a/cmake/version.cmake b/cmake/version.cmake index d34b0c4..67da227 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -1,3 +1,3 @@ set(CROSSLANG_MAJOR_VERSION 0) set(CROSSLANG_MINOR_VERSION 0) -set(CROSSLANG_PATCH_VERSION 13) +set(CROSSLANG_PATCH_VERSION 14) diff --git a/src/program_lib/crosslang.cpp b/src/program_lib/crosslang.cpp index 1f02be3..358d3a9 100644 --- a/src/program_lib/crosslang.cpp +++ b/src/program_lib/crosslang.cpp @@ -112,24 +112,37 @@ TObject CrossLangShell(GCList &ls, std::vector &argv) { auto subdir = std::make_shared( Tesses::Framework::Filesystem::LocalFS, dir); - HttpRequest req; - req.followRedirects = true; - req.url = "https://redirect.tesses.net/crosslang-shell"; - req.method = "GET"; - HttpResponse resp(req); - if (resp.statusCode == StatusCode::OK) { - auto strm = resp.ReadAsStream(); - CrossLang::CrossArchiveExtract(strm, subdir); + if (argv.size() == 2) { + HttpRequest req; + req.followRedirects = true; + req.url = "https://redirect.tesses.net/crosslang-shell"; + req.method = "GET"; + HttpResponse resp(req); + if (resp.statusCode == StatusCode::OK) { + auto strm = resp.ReadAsStream(); + CrossLang::CrossArchiveExtract(strm, subdir); - return (int64_t)0; + return (int64_t)0; + } else { + std::cout << "Error when fetching the script error: " + << std::to_string(resp.statusCode) << " " + << HttpUtils::StatusCodeString(resp.statusCode) + << std::endl; + return (int64_t)1; + } } else { - std::cout << "Error when fetching the script error: " - << std::to_string(resp.statusCode) << " " - << HttpUtils::StatusCodeString(resp.statusCode) - << std::endl; - return (int64_t)1; + if (Tesses::Framework::Filesystem::LocalFS->FileExists(argv[2])) { + auto strm = Tesses::Framework::Filesystem::LocalFS->OpenFile( + argv[2], "rb"); + CrossLang::CrossArchiveExtract(strm, subdir); + return (int64_t)0; + } else { + Tesses::Framework::Console::WriteView("Unable to open file \""); + Tesses::Framework::Console::WriteView(argv[2]); + Tesses::Framework::Console::WriteLineView("\""); + return (int64_t)1; + } } - return (int64_t)0; } if (!Tesses::Framework::Filesystem::LocalFS->RegularFileExists(filename)) { diff --git a/src/programs/slim.cpp b/src/programs/slim.cpp index ed23104..b1b1ec1 100644 --- a/src/programs/slim.cpp +++ b/src/programs/slim.cpp @@ -85,7 +85,9 @@ int main(int argc, char **argv) { "file, used to be crossdump"); Console::WriteLine("vm: interpert bytecode file, " "used to be crossvm"); - Console::WriteLine("update-shell: update the shell"); + Console::WriteLine( + "update-shell: update the shell (can update offline now " + "if you pass a crvm as another argument)"); Console::WriteLine( "configdir: print the config directory");