#3190 closed task (fixed)
[PATCH] Update cppformat
Reported by: | leper | Owned by: | Itms |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 24 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: | phab:D2689 |
Description (last modified by )
Currently we use 0.11 while the latest upstream version is 2.1.1 (naming scheme changed, so just 7 versions outdated).
https://github.com/cppformat/cppformat/releases
Also see #3011 for some changes to the bundled version (that should be reapplied or dropped depending on the change (since some where done upstream in a similar/different way)). The remaining changes should be submitted upstream if applicable.
Attachments (2)
Change History (20)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|---|
Milestone: | Backlog → Alpha 21 |
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Description: | modified (diff) |
---|---|
Keywords: | review added |
Summary: | Update cppformat → [PATCH] Update cppformat |
comment:4 by , 8 years ago
Looks like you forgot to merge your last two patches, don't know if it's intended.
comment:5 by , 8 years ago
I wanted to keep the changes from the upstream version in a separate patch so it's easier to reapply / upstream whatever changes we make (especially for updating it in the future).
comment:6 by , 8 years ago
Keywords: | patch added |
---|
Ah yeah makes sense by the way you forgot the patch keyword =) I added it
comment:7 by , 8 years ago
- I tested your patches with MSVC, and while the build succeeds, it's quite noisy:
5>e:\devel\ps\source\third_party\cppformat\format.h(964): warning C4510: 'fmt::internal::DummyStream' : default constructor could not be generated 5> e:\devel\ps\source\third_party\cppformat\format.h(961) : see declaration of 'fmt::internal::DummyStream' 5>e:\devel\ps\source\third_party\cppformat\format.h(964): warning C4610: struct 'fmt::internal::DummyStream' can never be instantiated - user defined constructor required
Those appear frequently.
- It looks like our posix.h defines a conflicting
isnan
, can you just add an undef before the problematic line? If that works, it's a little cleaner than commenting it out.
- #3753 has a patch on cppformat to fix an MSVC error. The update doesn't solve the problem, but the patch still applies cleanly after yours.
by , 8 years ago
Attachment: | cppformatmod.patch added |
---|
isnan conflict resolved (+- warnings on MSVC), workaround for another warning (d’après historic_bruno)
comment:8 by , 8 years ago
Owner: | set to |
---|
I rebased and completed the patch above, and would like to commit the result. I tested it on Windows, it should be tested on Linux too.
https://github.com/na-Itms/0ad/tree/cppformat
Future work: #4148
comment:9 by , 8 years ago
Keywords: | review removed |
---|
Build fails currently on OSX. I'm taking a look at the issue on my virtual machine.
comment:10 by , 8 years ago
Milestone: | Alpha 21 → Alpha 22 |
---|
comment:11 by , 7 years ago
Milestone: | Alpha 22 → Work In Progress |
---|
Moving to the Work In Progress milestone, since there is a patch asking for feedback, but since it is not strictly bound to a specific release.
comment:13 by , 4 years ago
Description: | modified (diff) |
---|
Without intending to step on any toes: I've got a git branch that builds on top of the changes of phab:D2613 and makes the jump straight to fmt
6.1.2
(which is the latest version at time of writing): https://github.com/s0600204/0ad/tree/fmt
Once D2613 is in, then if so desired I'll create a revision on Phabricator for consideration.
For linux: as fmt
is available from linux distro repos, the build system now attempts to use that by default. This should work with any version of fmt
from 4.0
upwards. However, for systems that don't have a recent enough version (see https://repology.org/project/fmt/versions), the minimum relevant source is bundled and can be compiled by passing --with-bundled-fmt
to update-workspaces.sh
.
For windows/osx: I don't have a system to test on, so some work there would be necessary. However, as said above, the relevant source is bundled, so it just be a case of tying into the respective build systems.
comment:14 by , 4 years ago
Hi s0600204, amazing job! I'll do my best to commit D2613: right now your rebase of it needs a fix, then I'll test manually on whatever slave Jenkins keeps failing on.
comment:16 by , 4 years ago
Patch: | → phab:D2689 |
---|
comment:18 by , 3 years ago
Milestone: | Work In Progress → Alpha 24 |
---|
The attached patches do the following:
cppformat: Update to version 2.1.0 (straight from Github).
cppformatmod: There were some compiler errors related to the isnan function, so I commented it out. This seems to have fixed the errors. It was only a dummy function and shouldn't be used on any sane system anyway.
The patched game compiled flawlessly, passed all tests and "survived" a test game on my system (Linux 4.5.0, GCC 5.3.1). Someone else needs to test this on Windows, OS X, *BSD though.
There are some FMT_THROW calls in there (which I didn't run into) which could be changed to print a warning, similar to patch 0006 from #3011.