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

Update with latest lua-simdjson changes #1

Merged
merged 43 commits into from
Oct 8, 2024

Conversation

tobil4sk
Copy link
Member

@tobil4sk tobil4sk commented Oct 8, 2024

This includes the following:

I've run the haxe test suite on linux with this updated version and everything seems to work well now.

FourierTransformer and others added 30 commits September 11, 2020 16:44
…release

Updated to simdjson version 0.5.0
LUA_LIBDIR is not available on most platforms, so this gives an empty
variable which means -L swallows up the -lpthread flag.
It is required for luajit to build properly on mac
On windows, we need to explicitly link against lua.dll
Since lua was built with VS2022, the luarocks install script uses
`MSVCR80` as the default runtime which causes problems when loading
dlls.
added link to GitHub Actions
* switched to ondemand parser

* removed LIBS_PATH and debug symbols

* a bit smarter about `pushinteger` and `pushnumber` for Lua 5.3+
* [ci] Add mac arm64 tests

* Use provided define for simdjson implementation

* [ci] Avoid running luajit=2.0 on arm64 - Only 2.1+ has arm64 support
The latest version of luarocks has added ucrt support (windows-2022 has ucrt mingw installed). This means we can avoid the MSVCRT="m" hack.
tobil4sk and others added 13 commits August 3, 2024 19:30
This way we can see if a PR will break the tests
)

* [make] Recompile library when source files change

The build has been split up into separate object files, and each object
file is recompiled if the relevant source/header file changes.

Previously, it would never recompile the library, regardless of whether
any files had changed, so running `make clean` was necessary every time.
…rmer#90)

* Add tests for scalar value jsons

* Fix parsing of scalar value documents

With the ondemand parser, the document to value conversion fails with
the error SCALAR_DOCUMENT_AS_VALUE if the document is a single null,
string, bool, or number value.

* Add explicit types in for loop variables

Since we are now using a template type, this is no longer inferable by
an IDE. Adding explicit types also reduces the number of `.value()`
conversions required.
…rierTransformer#92)

* Remove use of document_reference type

It is not suitable for use here since the behaviour deviates from the
regular document type when it comes to trailing content.

* Add tests for scalar value with trailing content

* Move invalid test case to invalid sub folder
* Add test cases for invalid n tokens

Tokens that begin with `n` should not be treated as `null`.

* Reject non-null tokens beginning with n

In 0f609dd, a regression was introduced
where the parser would read any token that started with n as null.

The `.type()` method returns `json_type::null` simply if the token
begins with `n`, and it does not check whether the token is actually
valid.

Adding an `is_null()` call here ensures this and returns an error if the
token starts with `n` but is not `null`. Calling `.value()` on the
returned value will raise it as an exception if `is_null()` returned an
error.

Currently with simdjson 3.10.1, there is a bug where calling `is_null`
on a document object lacks this behaviour, so currently this patch only
fixes the problem for non-scalar documents.

* Comment out broken tests for now
…r#94)

* Enable tests for invalid documents starting with n

* Add test for invalid document with trailing text

Oddly, `null trailing` gives an error, but `nully trailing` does not

* Add workaround for scalar document is_null bug

For now, we can just manually throw the exception until the next
simdjson bugfix release: simdjson/simdjson#2258
Since the on demand parser is now used, we now have to iterate only once
and set the field value and field existance at once.
The test directory has been removed in our fork
hx-lua-simdjson uses nil as null
@Simn
Copy link
Member

Simn commented Oct 8, 2024

Hmm, this is the kind of PR that I'd typically "Rebase and merge", but Github tells me "This branch cannot be rebased due to conflicts" if I try that.

@tobil4sk
Copy link
Member Author

tobil4sk commented Oct 8, 2024

It may be best to merge it with a normal merge, that way github will say that it is in sync with the upstream repo. If it is rebased then github will say it is still behind.

@Simn Simn merged commit 66db439 into HaxeFoundation:master Oct 8, 2024
@tobil4sk tobil4sk deleted the update branch October 8, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants