Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request intends to make ProtoBuf.jl and its CI compatible to 32-bit architectures (x86).
For CI I tried to run ProtoBuf.jl on a 32-bit system and noticed a bug due to the way
LengthDelimitedProtoDecoder
implementsendpos
:Int
is platform-dependent in Julia, and hence this corresponds toInt32
in 32-bit systems.Conversely, IOBuffer (what my test uses) uniformly returns
Int64
for position independently of the platform.This issue also becomes visible when activating the CI of ProtoBuf.jl for x86 although for a different reason (UInt32 not converted into Int32).
I propose to uniformly use
Int64
as an endmarker and to perform explicit conversion (see suggested changes toCodecs.jl
anddecode.jl
.I've also updated the tests in
test_protojl.jl
to make the choice of Integer type explicit (which is lateron checked) and to account for the fewer allocations on x86 systems intest_perf.jl
.With these changes, the CI now runs flawlessly everywhere except for x86 Julia nightly.
Where a Dict seems to be encoded in the opposite order for Julia Nightly on x86 (?).
Note that two tests fail and that expected/observed outputs are swapped between the two tests...
I am open to fixing this remaining bug, but would require your guidance on whether this is an implementation bug or a limitation of the current test?