[BREAKING] HTTP.jl 2.0: Overhaul internals by switching to use aws-crt libraries
This isn't quite ready to merge yet, but starting the PR to get CI running and document what there is left to do:
[ ] Incorporate @IanButterworth's recent precompile work [ ] Update documentation: manual and all inline docs; also write up a 1.X -> 2.0 migration guide [ ] Update upstream AWS CRT libraries and fix anything required in our wrappers
Made some progress here, but blocked on 2 issues I need to dig into:
- There's an occasional segfault from an unhandled C callback BoundsError; it's when we try to write to the temporary Base.BufferStream and it seems like the code should correctly resize the underlying IOBuffer of the BufferStream, but it doesn't for some reason and then we get a BoundsError; I'm actively investigating this now to try to find out if it's an actual bug in Base.BufferStream/IOBuffer, or how we're using BufferStream (pretty vanilla, but maybe?)
- There's an sporadic test failure where providing an IOBuffer as a response body seems to sometimes duplicate part of the body writing. Possibly related to the first issue.
Ok, turns out the segfault is due to Base.BufferStream readavailable not being threadsafe, there's a PR to fix here: https://github.com/JuliaLang/julia/pull/57211. I'll add a compat shim here until that's fully fixed/released. I can confirm that the same root cause was causing both issues mentioned above.