Skip to content

Commit cdc5986

Browse files
authored
Merge pull request #577 from mtconnect/fix_docker_build_issues_with_alpine
For docker alpine build, added bash because of m4 and changed verion to 3.22
2 parents aab0080 + e702b37 commit cdc5986

22 files changed

+708
-715
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set(AGENT_VERSION_MAJOR 2)
33
set(AGENT_VERSION_MINOR 6)
44
set(AGENT_VERSION_PATCH 0)
5-
set(AGENT_VERSION_BUILD 6)
5+
set(AGENT_VERSION_BUILD 7)
66
set(AGENT_VERSION_RC "")
77

88
# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent

agent_lib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ target_include_directories(
393393
target_link_libraries(
394394
agent_lib
395395
PUBLIC
396-
boost::boost LibXml2::LibXml2 date::date-tz openssl::openssl
396+
boost::boost LibXml2::LibXml2 date::date openssl::openssl
397397
nlohmann_json::nlohmann_json mqtt_cpp::mqtt_cpp
398398
rapidjson BZip2::BZip2
399399

cmake/osx_no_app_or_frameworks.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ set(CMAKE_FIND_FRAMEWORK NEVER FORCE)
88
# ms suffix which was added post 11.
99
if (APPLE)
1010
# set(COVERAGE_FLAGS "-fcoverage-mapping -fprofile-instr-generate")
11-
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++17")
11+
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++20")
1212
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedef -Wno-deprecated-declarations -Wall")
1313
endif()

conanfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class MTConnectAgentConan(ConanFile):
6868

6969
"openssl*:shared": False,
7070

71-
"date*:use_system_tz_db": True
71+
"date*:header_only": True
7272
}
7373

7474
exports_sources = "*", "!build", "!test_package/build", "!*~"
@@ -112,14 +112,14 @@ def tool_requires_version(self, package, version):
112112
def build_requirements(self):
113113
self.tool_requires_version("cmake", [3, 26, 4])
114114
if self.options.with_docs:
115-
self.tool_requires_version("doxygen", [1, 14, 0])
115+
self.tool_requires_version("doxygen", [1, 15, 0])
116116

117117
def requirements(self):
118118
self.requires("boost/1.88.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
119119
self.requires("libxml2/2.14.5", headers=True, libs=True, visible=True, transitive_headers=True, transitive_libs=True)
120120
self.requires("date/3.0.4", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
121121
self.requires("nlohmann_json/3.12.0", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
122-
self.requires("openssl/3.5.4", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
122+
self.requires("openssl/3.6.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
123123
self.requires("rapidjson/cci.20230929", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
124124
self.requires("mqtt_cpp/13.2.2", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
125125
self.requires("bzip2/1.0.8", headers=True, libs=True, transitive_headers=True, transitive_libs=True)

docker/alpine/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# ---------------------------------------------------------------------
3030

3131
# base image - alpine 3.18
32-
FROM alpine:3.19 AS os
32+
FROM alpine:3.22 AS os
3333

3434
# ---------------------------------------------------------------------
3535
# build
@@ -53,6 +53,7 @@ ENV CONAN_PROFILE="$HOME/agent/cppagent/conan/profiles/docker"
5353
RUN apk --update add \
5454
autoconf \
5555
automake \
56+
bash \
5657
cmake \
5758
g++ \
5859
gcompat \

src/mtconnect/agent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ namespace mtconnect {
10191019
stringstream msg;
10201020
msg << "Device " << *device->getUuid() << " already exists. "
10211021
<< " Update not supported yet";
1022-
throw msg;
1022+
throw msg.str();
10231023
}
10241024
else
10251025
{

src/mtconnect/configuration/agent_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ namespace mtconnect::configuration {
941941
loadAdapters(config, options);
942942

943943
m_afterAgentHooks.exec(*this);
944-
944+
945945
#ifdef WITH_PYTHON
946946
configurePython(config, options);
947947
#endif

src/mtconnect/entity/entity.hpp

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -716,73 +716,75 @@ namespace mtconnect {
716716

717717
return changed;
718718
}
719-
719+
720720
/// @brief variant visitor to output Value to stream
721721
struct StreamOutputVisitor
722722
{
723723
/// @brief constructor
724724
/// @param os the output stream
725-
StreamOutputVisitor(std::ostream& os) : m_os(os) {}
726-
727-
void operator()(const std::monostate&) {
728-
m_os << "null";
729-
}
730-
731-
void operator()(const EntityPtr& entity) {
725+
StreamOutputVisitor(std::ostream &os) : m_os(os) {}
726+
727+
void operator()(const std::monostate &) { m_os << "null"; }
728+
729+
void operator()(const EntityPtr &entity)
730+
{
732731
const auto &id = entity->getIdentity();
733732
m_os << "Entity(" << entity->getName() << ":";
734733
StreamOutputVisitor visitor(m_os);
735734
std::visit(visitor, id);
736735
m_os << ")";
737736
}
738-
739-
void operator()(const EntityList& list) {
737+
738+
void operator()(const EntityList &list)
739+
{
740740
m_os << "EntityList[";
741-
for (auto e : list) {
741+
for (auto e : list)
742+
{
742743
StreamOutputVisitor visitor(m_os);
743744
visitor(e);
744745
m_os << " ";
745746
}
746747
m_os << "]";
747748
}
748-
749-
void operator()(const DataSet& dataSet) {
750-
m_os << "DataSet(" << dataSet.size() << " items)";
751-
}
752-
753-
void operator()(const QName& qname) {
754-
m_os << qname.str();
755-
}
756-
757-
void operator()(const Vector& vec) {
749+
750+
void operator()(const DataSet &dataSet) { m_os << "DataSet(" << dataSet.size() << " items)"; }
751+
752+
void operator()(const QName &qname) { m_os << qname.str(); }
753+
754+
void operator()(const Vector &vec)
755+
{
758756
m_os << "Vector[";
759-
for (const auto &v : vec) {
757+
for (const auto &v : vec)
758+
{
760759
m_os << v << " ";
761760
}
762761
m_os << "]";
763762
}
764-
763+
765764
template <typename T>
766-
void operator()(const T& value) {
765+
void operator()(const T &value)
766+
{
767767
m_os << value;
768768
}
769-
770-
std::ostream& m_os;
769+
770+
std::ostream &m_os;
771771
};
772-
772+
773773
/// @brief output operator for Value
774774
/// @param os the output stream
775775
/// @param v the Value to output
776-
inline std::ostream& operator<<(std::ostream& os, const Value &v) {
776+
inline std::ostream &operator<<(std::ostream &os, const Value &v)
777+
{
777778
StreamOutputVisitor visitor(os);
778779
std::visit(visitor, v);
779780
return os;
780781
}
781-
782+
782783
/// @brief output operator for Value
783784
/// @param os the output stream
784785
/// @param v the Value to output
785-
inline std::ostream& operator<<(std::ostream& os, const EntityPtr &v) {
786+
inline std::ostream &operator<<(std::ostream &os, const EntityPtr &v)
787+
{
786788
StreamOutputVisitor visitor(os);
787789
visitor(v);
788790
return os;

src/mtconnect/entity/requirement.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,13 @@ namespace mtconnect {
186186
// If there isa a time portion in the string, parse the time
187187
if (arg.find('T') != string::npos)
188188
{
189-
in >> std::setw(6) >> date::parse("%FT%T", ts);
189+
in >> std::setw(6);
190+
date::from_stream(in, "%FT%T", ts);
190191
}
191192
else
192193
{
193194
// Just parse the date
194-
in >> date::parse("%F", ts);
195+
date::from_stream(in, "%F", ts);
195196
}
196197
}
197198
void operator()(const string &arg, Vector &r)

src/mtconnect/pipeline/response_document.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "mtconnect/entity/xml_parser.hpp"
3030
#include "mtconnect/observation/observation.hpp"
3131
#include "mtconnect/pipeline/timestamp_extractor.hpp"
32+
#include "mtconnect/utilities.hpp"
3233

3334
using namespace std;
3435

@@ -280,20 +281,6 @@ namespace mtconnect::pipeline {
280281
});
281282
}
282283

283-
inline static Timestamp parseTimestamp(const std::string value)
284-
{
285-
Timestamp ts;
286-
istringstream in(value);
287-
in >> std::setw(6) >> date::parse("%FT%T", ts);
288-
if (!in.good())
289-
{
290-
LOG(error) << "Cound not parse XML timestamp: " << value;
291-
ts = std::chrono::system_clock::now();
292-
}
293-
294-
return ts;
295-
}
296-
297284
inline static DataItemPtr findDataItem(const std::string &name, DevicePtr device,
298285
const entity::Properties &properties)
299286
{

0 commit comments

Comments
 (0)