Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nix] build errors with poco 1.14.1 #391

Open
dwt opened this issue Feb 16, 2025 · 0 comments
Open

[nix] build errors with poco 1.14.1 #391

dwt opened this issue Feb 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@dwt
Copy link

dwt commented Feb 16, 2025

Describe the bug
When building craftos with poco 1.14.1 the build fails with build errors like this:

src/main.cpp: In function 'void migrateData(bool)':
src/main.cpp:494:34: error: 'JSONException' in namespace 'Poco::JSON' does not name a type
  494 |             } catch (Poco::JSON::JSONException &e) {
      |                                  ^~~~~~~~~~~~~
src/main.cpp:495:76: error: 'e' was not declared in this scope
  495 |                 fprintf(stderr, "Could not read CCEmuX config file: %s\n", e.displayText().c_str());
      |                                                                            ^

To Reproduce
Steps to reproduce the behavior:

  1. Checkout poco: 1.13.3 -> 1.14.1 NixOS/nixpkgs#369312
  2. Build with nix-build --attr craftos-pc --system aarch64-linux (--system is only required if you are on MacOS and requires a linux builder connected or running in a VM, see my config for an example if you are interested)
  3. See error

Expected behavior
It should build

Environment (please complete the following information):

  • OS:
    ❯ sw_vers
    ProductName:		macOS
    ProductVersion:		15.3
    BuildVersion:		24D60
    
    But the is actually al linux problem and is best observed on linux (aarch64 or x86_64-linux)
  • CraftOS-PC Version: latest release 2.8.3
  • Compiled from source? [Yes]

I was work around these issues by adding this patch

diff --git a/src/configuration.cpp b/src/configuration.cpp
index 2196121..0c5cf27 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -11,6 +11,7 @@
 #include <fstream>
 #include <unordered_map>
 #include <configuration.hpp>
+#include <Poco/JSON/JSONException.h>
 #include "platform.hpp"
 #include "runtime.hpp"
 #include "terminal/SDLTerminal.hpp"
diff --git a/src/main.cpp b/src/main.cpp
index 9ab0814..38976a2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -34,6 +34,7 @@ static void* releaseNotesThread(void* data);
 #include <Poco/URI.h>
 #include <Poco/Checksum.h>
 #include <Poco/JSON/Parser.h>
+#include <Poco/JSON/JSONException.h>
 #ifndef __EMSCRIPTEN__
 #include <Poco/Net/HTTPSClientSession.h>
 #include <Poco/Net/HTTPRequest.h>
diff --git a/src/util.hpp b/src/util.hpp
index b8ab2d1..c643b96 100644
--- a/src/util.hpp
+++ b/src/util.hpp
@@ -21,6 +21,8 @@ extern "C" {
 #include <string>
 #include <vector>
 #include <Poco/JSON/JSON.h>
+#include <Poco/JSON/Object.h>
+#include <Poco/JSON/Array.h>
 #include <Poco/JSON/Parser.h>
 #include <Poco/Net/HTTPResponse.h>
 #include <Computer.hpp>

I am not sure why this was not necessary with older versions of Poco, as the source does not seem to indicate that these includes where unnecessary in the past. But I am also not very fluent in C++.

Would you consider taking this patch for the next version?

@dwt dwt added the bug Something isn't working label Feb 16, 2025
dwt added a commit to dwt/nixpkgs that referenced this issue Feb 16, 2025
Upstream seems to have errors, where it doesn't include all the poco headers it requires for it to build. I've provided a patch and [opened a pull request upstream to get it merged](MCJack123/craftos2#391].
trofi pushed a commit to trofi/nixpkgs that referenced this issue Feb 16, 2025
Upstream seems to have errors, where it doesn't include all the poco headers it requires for it to build. I've provided a patch and [opened a pull request upstream to get it merged](MCJack123/craftos2#391].
trofi pushed a commit to trofi/nixpkgs that referenced this issue Feb 16, 2025
Upstream seems to have errors, where it doesn't
include all the poco headers it requires for it
to build. I've provided a patch and
[opened a pull request upstream to get it merged](MCJack123/craftos2#391].
dwt added a commit to dwt/nixpkgs that referenced this issue Feb 18, 2025
Upstream seems to have errors, where it doesn't
include all the poco headers it requires for it
to build. I've provided a patch and
[opened a pull request upstream to get it merged](MCJack123/craftos2#391].
dwt added a commit to dwt/nixpkgs that referenced this issue Feb 18, 2025
Upstream seems to have errors, where it doesn't
include all the poco headers it requires for it
to build. I've provided a patch and
[opened a pull request upstream to get it merged](MCJack123/craftos2#391].
dwt added a commit to dwt/nixpkgs that referenced this issue Feb 19, 2025
Upstream seems to have errors, where it doesn't
include all the poco headers it requires for it
to build. I've provided a patch and
[opened a pull request upstream to get it merged](MCJack123/craftos2#391].
dwt added a commit to dwt/nixpkgs that referenced this issue Feb 21, 2025
Upstream seems to have errors, where it doesn't
include all the poco headers it requires for it
to build. I've provided a patch and
opened a pull request upstream to get it
merged: MCJack123/craftos2#391
dwt added a commit to dwt/nixpkgs that referenced this issue Feb 21, 2025
Upstream seems to have errors, where it doesn't
include all the poco headers it requires for it
to build. I've provided a patch and
opened a pull request upstream to get it
merged: MCJack123/craftos2#391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant