Client: go
While https://github.com/apache/thrift/pull/951 fixed the bug with
forward typedef used in container values, it also introduced a bug that
broke forward typedef used in other cases in go code. Limit the fix of
it to only the container key and value types to fix other cases.
Unlike servers in other languages (tested: cpp & python), netstd (Csharp) listens only on IPv4.
This can cause errors and delays on clients if they use "localhost" for hostname.
Previously, the c_glib library tests failed to compile due
to implicit function declarationsn for `sleep()`, `fork()`,
and `alarm()`.
Include `<unistd.h>` to address all of those issues (on
platforms that have `<unistd.h>`).
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The `PlatformSocket.h` defines some macros that reference
symbols in the libc without including the necessary headers.
Moreover, the headers are protected by config macros
(i.e. `#ifdef HAVE_UNISTD_H`). This makes header ordering
rather fragile.
Explicitly include `<thrift/config.h>` and conditionally
include `<unistd.h>` prior to referencing them.
A future improvement to reduce fragility would be to add
includes directly in `PlatformSocket.h`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `<thrift/numeric_cast.h>` header should be part of the
installed thrift artifacts since it is included by other
installed headers.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
A missing slash in the end `</td>` tag of field cell for Delphi and
.NET Standard was generating an additional empty cell, breaking the
table (and generating misleading info).
[skip ci]
This adds an equivalent implementation of `boost::numeric_cast`
written purely in standard c++.
The implementation is relatively trivial and reduces the
dependency on `boost`.
Adapted from
https://stackoverflow.com/a/49658950/5636218
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `<sys/poll.h>` header is not actually where `poll(2)` must be
defined according to the spec. However, it may be the case that
some random UNIX-like OS uses `<sys/poll.h>` instead.
Both use cases can be supported simply by including the proper
header, if it exists.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Several build failures in Travis resulted from an include-order
problem in `TFileTransport.cpp`. It would probably be better to
simply include the right header files in `PlatformSocket.h`
but it's possible that might slow down compilation.
```
error: 'usleep' was not declared in this scope
..
# define THRIFT_SLEEP_USEC usleep
```
Also fixing the same (potential) problem in `TFDTransport.cpp`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Client: go
The go library itself does not have any third-party dependencies. We
have one third party dependency from the test code, which kind of
polluted from top-level go.mod file to the users of thrift go library.
We previous tried to clean that up by creating go.mod file at
lib/go/thrift, which caused issues to the release process and thus
reverted.
Use multi-module to separate tests requiring mock to their own modules
so that we can keep the top-level go.mod file clean.
Also some minor fixes on the github actions go workflow.
In Zephyr, optimize `TOutput::strerror_s` to minimize (stack)
space. The string error table is in ROM in any case, so string
values will not be overwritten (if they happen to be compiled-in).
Signed-off-by: Chris Friedt <cfriedt@fb.com>
Zephyr's byteorder is defined in
`<zephyr/sys/byteorder.h>`. However, the `bswap_xx`
macros are also defined there. They need to be `#undef`d
first when building for big-endian architectures, since
the Thrift byteorder macros are no-ops for little-endian
architectures.
Signed-off-by: Chris Friedt <cfriedt@fb.com>
Manual runs of the autotools docker script were failing due to
`std::functional` not being a member of `std`. Similar error
messages for `std::ceil` and `std::log`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Previously, when doing manual runs inside of the docker container,
the `autotools.sh` script would fail if the `.m2/` directory already
existed. This was a minor annoyance.
Simply pass the `-p` flag to `mkdir`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Client: go
This is only the library part of THRIFT-5650. I still have some open
questions for the compiler part so that will be done later.
While I'm here, also made some changes to go CI process:
* Update ubuntu-bionic to use go 1.18 for travis
* Update ubuntu-jammy to use the latest go 1.19.x for travis
* Run both go 1.18 and 1.19 for github actions
* Also run test/go tests for github actions
Client: Compiler (general)
Patch: Jens Geyer
This also fixes an unhandled "normalize" case with enums in netstd that came up during tests for this ticket.
This closes#2715