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

[upstream_utils] Update to json 3.11.2 #5680

Merged
merged 1 commit into from
Oct 15, 2023

Conversation

pjreiniger
Copy link
Contributor

Less intrusive version of #5622 as it contains overloads for the llvm streams.

@pjreiniger
Copy link
Contributor Author

I've got tests incoming, not managed by upstream utils because what I had to do is gross and still requires hand edits if you want them

@calcmogul
Copy link
Member

calcmogul commented Sep 23, 2023

Some tests is better than no tests. I think we had to heavily modify them from upstream because they use Catch2 instead of GoogleTest.

@calcmogul calcmogul changed the title [json] Update to 3.11.2 [upstream_utils] Update to json 3.11.2 Sep 23, 2023
@pjreiniger
Copy link
Contributor Author

The windows debug CI is having trouble building the tests. I don't know if the debug symbols are too big or what. I can probably just add a subset of the test suite for the moment, or if you want to land this shortly I can do the tests in a separate PR. Its nice having the build cache once it gets pushed to main.

@calcmogul
Copy link
Member

calcmogul commented Sep 24, 2023

@PeterJohnson
Copy link
Member

PeterJohnson commented Sep 24, 2023

Unfortunately this causes some real growth in artifact sizes etc, and will almost certainly break the installer size in addition to CI (as Linux is currently at 1.93G and the limit is 2G). I suspect this is due to all the duplicate templated codegen into object and debug info, and increased size in debug info due to the json symbols being significantly larger.

Testing on windows ("was" is latest main, "is" is this PR):
total size on disk after gradlew build (both windows and athena): was 38.3G, is 39.8G (+1.5G)... despite the json tests being removed
some examples:
ntcoreBase win64 static lib: debug was 48M is 79M, release was 19M is 30M
ntcore athena shared lib: release was 1.4M+21M syms, is 1.6M+28M syms, debug has similar deltas
glass.exe debug pdb grew by 5M

growth in all the artifact sizes (compare https://github.com/wpilibsuite/allwpilib/actions/runs/6279775375 with https://github.com/wpilibsuite/allwpilib/actions/runs/6281803893)
athena was 586M is 614M
linux was 1.08G is 1.14G
win64debug was 345M is 364M

@PeterJohnson PeterJohnson added the state: blocked Something is blocking action. label Sep 24, 2023
@pjreiniger
Copy link
Contributor Author

IIRC the biggest headache going from the raw upstream to the detemplatized, split source and header version was the fact that llvm::StringMap was used instead of std::map. I should have a lot of the tooling necessary to do that detemplatization but the way I did it makes the patches sort of gross.

I can take a whirl at getting that going with a straight jump from status quo to 3.11.2, but I might leave the automated process out of the PR, if that is acceptable. Upgrade now, automate later.

@PeterJohnson
Copy link
Member

PeterJohnson commented Sep 24, 2023

I think using std::map is acceptable (really the only downside is it allocates more). I'd be fine with automating later.

@pjreiniger
Copy link
Contributor Author

What is an tolerable increase in size?

I've played around with separating implementation out of the header when possible, detemplatizing classes, etc, and I can get the size down from what the links Peter gave, but it is still bigger non-trivially bigger than the current implementation. I think something to consider when jumping from 3.1.2 to 3.11.2 is that it is ~4.5 years of updates (3/18-8/22), including adding hard to de-patch concepts like the addition sax parsing, plus all of the addition all the new things like new binary formats, structured bindings, more container / string support, etc. The increase in features leads to an increase in compiled size.

I see a beta tag was created. Based on that I can see a full version update dying on the vine like it did last year and I don't want it to completely fall on the floor again. Perhaps we could get 3.1.2 90% upstream util'd (minus the header->cpp changes), or go along that path updating versions until the size gets too big.

@calcmogul
Copy link
Member

calcmogul commented Oct 12, 2023

We have some other changes and additions blocked on artifact size, so we're going to have to solve the artifact size problem properly for 2024 anyway. I wouldn't work too hard to shrink things in the JSON library beyond what you've already done (detemplating is nice for other reasons like having readable symbols in compiler errors). We'll likely host everything on Artifactory to avoid the 2 GB limit.

For the record, I'd also like to see this merged for 2024 rather than languishing for another year.

@PeterJohnson PeterJohnson merged commit 210255b into wpilibsuite:main Oct 15, 2023
22 checks passed
@pjreiniger pjreiniger deleted the update_json_newest branch December 4, 2023 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: blocked Something is blocking action.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants