Clang's ubsan (-fsanitize=undefined) reports:
runtime error: negation of -9223372036854775808 cannot be represented in
type 'Json::Value::LargestInt' (aka 'long'); cast to an unsigned type to
negate this value to itself
Follow its advice and update the code to remove the explicit negation.
Backport upstream curl commit 2c5ec339ea (Curl_follow: accept
non-supported schemes for "fake" redirects, 2018-11-01) to get
a fix to curl issue 3210, a regression in 7.62.0.
0310024563 curl: Update build within CMake to account for 7.61 changes
b9d1107790 curl: Backport to work with CMake 3.1 again
e9e8dcee6b Merge branch 'upstream-curl' into update-curl
18812a9c3d curl 2018-09-04 (432eb5f5)
ded211ae46 curl: Update script to get curl 7.61.1
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2509
When generating `curl_config.h`, add size information for `long long`
and `__int64` types. These are needed as candidates for defining the
`ssize_t` type because on MSVC, `long` is not the same size as `size_t`.
This problem did not affect upstream curl because it computes the
`ssize_t` type in CMake code where all sizes are available. CMake's
port computes it in preprocessor logic because universal binaries on
macOS do not know type sizes until compile time.
Fixes: #18477
The_CURL_STATICLIB option was replaced by BUILD_SHARED_LIBS.
Drop our own CURL_STATICLIB compile definition because it is now
provided by curl's usage requirements.
Curl 7.61.1 requires CMake 3.4 to build from source and also exposes
a dependency on OpenSSL imported targets. Revert that part of the
changes imported from curl upstream.
93f3f65516 Help: Revise docs of modules AddFileDependencies..CheckFunctionExists
fc7ee1ca45 Help: Override pygments CMakeLexer to support <..> and [..]
74b3eacdc7 Help: Use appropriate list types in FindPkgConfig
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2468
* The code snippets in the docs consist of CMake code mixed
with syntax definition punctuation like < > [ ] ... Therefore
a pure CMake lexer is inadequate. Here it is replaced by a
CMake syntax definition parser.
* Fixed syntax definition snippets in FindPkgConfig.cmake to
make best use of syntax highlighting. This source file is the
hardest to support because it contains comparison operators
<= = >=, which need special attention to avoid confusion
with the placeholder indicators <...>.
* Fixed syntax in execute_process.rst (there were unbalanced
brackets).
* Disabled syntax highlighting for long string examples in
cmake-language.7.rst.
* No highlighting of removed syntax in CMP0049
* To inspect the outcome of this patch, see e.g. the pages
* manual/cmake-buildsystem.7.html
* module/ExternalProject.html
* module/FindPkgConfig.html
which are particularly rich in complex code snippets.
CMake 3.12 introduced a `...<max>` syntax in the version given to
`cmake_minimum_required` to automatically set policies to NEW up
to that version. Use it to avoid listing policies explicitly.
The syntax is compatible with older versions of CMake such that they use
the extended version string for the `CMAKE_MINIMUM_REQUIRED_VERSION`
variable (which we don't use) but otherwise ignore it.
Some platforms (e.g. GNU/Hurd) do not define PATH_MAX. Add a few other
variants and a fallback constant. Also use alternatives where possible:
* For readlink(), use lstat() to read the length of the link first.
If it is not a symlink, report EINVAL before trying to allocate.
If the size reports as zero, fall back one of the PATH_MAX variants.
* For realpath(), POSIX 2008 allows us to pass a NULL buffer
to tell it to malloc() internally.
This patch was inspired by downstream patches in Debian packaging
for issues 897061 and 909011.
Issue: #18337
Backport libarchive commit v3.3.3~16^2 (fix build with LibreSSL 2.7,
2018-04-01). LibreSSL 2.7 adds OpenSSL 1.1 API leading to conflicts on
method names.
Fixes: #18404
Also add a binutils-2.31 to CMAKE_PREFIX_PATH in the environment so that
tests that look for them with `find_program` can find a newer version.
This is needed for the build id support in readelf.
This test fails spuriously too often and prevents the nightly binary
from finishing. Simply skip it for the nightly binary to allow it to
complete more regularly.
It is provided by `functional`, not `utility`. Fix the mapping added by
commit 276d3c7afe (IWYU: Add workaround mapping for std::hash,
2018-07-31). Also generalize the workaround from commit v3.12.0-rc1~39^2~1
(IWYU: Define a macro to tell code it is preprocessing for iwyu,
2018-05-25) to allow local builds to configure specific flags. This
is needed because iwyu behaves differently in different environments.
Some `.c` sources add `restrict` to their pointer types to tell
the optimizer that there is no aliasing. These do not appear in
the corresponding `.h` declarations so MSVC warns.
Revert commit v3.1.0-rc1~255^2~5 (liblzma: Port from C99 to C89/90,
2014-07-13). We now compile as C99 or above except on MSVC where
we will use another approach.
Revert commit v3.1.0-rc1~255^2~2 (liblzma: Avoid defining a 'restrict'
macro, 2014-07-24). We will use another approach to deal with the
'restrict' keyword.
Since commit v3.12.0-rc1~325^2 (ccmake: Check for curses more robustly
before enabling, 2018-03-21) we may not enable ccmake by default when
using a non-system curses (e.g. the static curses we build on Linux for
our binaries). Enable the option explicitly for our prebuilt binaries.
The documentation for CPack generators previously lived in their
respective internal CMake modules. This setup was misleading,
because it implied that you should include the modules in your own
code, which is not the case. Moving the documentation into a
separate section does a better job of hiding the internal modules,
which are just an implementation detail. The generator documentation
has also been modified to remove any references to the module name.
The CPackIFW module is a special exception: since it has user-facing
macros, the documentation for these macros has been kept in the module
page, while all other documentation related to the IFW generator has
been moved into the new section.
To make it easier to find the new documentation, the old help pages
for the CPack*.cmake modules have not been deleted, but have been
replaced with a link to their respective help page in the new
documentation section.
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`. Use `clang-format` version 6.0.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Update `.clang-format` with configuration to make the 6.0 format as
close as possible to what 3.8 produced before. Then revise the style:
* Indent preprocessor directives (a feature new since 3.8)
* Add a newline and indentation before inheritance `:` and `,`
Rename the Git attribute identifying the format to include the
clang-format version number: `format.clang-format-6.0`. This will aid
external infrastructure in knowing what version of the tool to run.
Versions of clang-format newer than 3.8 produce different output.
Our source code guide says that version 3.8 exactly must be used.
Update the comment in our `.clang-format` config file accordingly.
Add a check to our formatting script to verify the version.
Also update its tool search to look for the explicitly-named
3.8 variant first.
0d389d175a libuv: Revert local linux/sparc64 fix now that we have upstream fix
42fbb28516 Merge branch 'upstream-libuv' into update-libuv
c8b67ea119 libuv 2018-05-06 (bf605bd7)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2049
Hyperlink text color does not stand out when used inside a literal block
because such blocks typically get syntax highlighting. Update our CSS
style to make the links more distinct.
Suggested-by: Kyle Edwards <kyle.edwards@kitware.com>
Upstream libuv commits:
* node-v0.6.0~28 (linux: use ioctl(FIONBIO) to set O_NONBLOCK, saves a syscall, 2011-10-29)
* v1.11.0~11 (unix: use async-signal safe functions between fork and exec, 2016-12-12)
left an asymmetry in the way O_NONBLOCK is set and cleared. Normally
ioctl/FIONBIO is used for both. However, uv_spawn uses fcntl/O_NONBLOCK
to clear O_NONBLOCK between fork and exec. This fails on Linux/sparc64
where setting via ioctl/FIONBIO actually sets two bits (in O_NDELAY)
that cause clearing via fcntl/O_NONBLOCK to be silently ignored (though
clearing via ioctl/FIONBIO or fcntl/O_NDELAY works).
Since CMake commit v3.11.0-rc1~117^2 (CTest: Re-implement test process
handling using libuv, 2017-12-10), CTest uses libuv. On Linux/sparc64
child processes have been started with non-blocking output pipes. This
can lead to write errors or lost output from children not prepared to
deal with `EAGAIN` on stdout or stderr.
Fix this for now by switching libuv back to fcntl/O_NONBLOCK to set and
clear O_NONBLOCK when compiled on Linux/sparc64.
LibUV-Issue: 1830
Fixes: #17941
This enables cross-reference syntax for CMake environment variables:
:envvar:`SOMEVAR`
and definition of CMake environment variables via a directive:
.. envvar:: SOMEVAR
It also adds environment variables defined by the directive and by
`Help/envvar/SOMEVAR.rst` documents to the index.
This `envvar` role and directive is defined in our `cmake` domain
and overrides the equivalent `envvar` role and directive provided
by Sphinx in its default domain. This is okay because we build
CMake documents in the `cmakd` domain.
This follows up the work from commit v3.10.0-rc1~43^2 (Help: Document
CMake's environment variables, 2017-09-01) that originally added
`envvar` documentation.
Implement it on Linux, FreeBSD, and Windows for now, and fail with
UV_ENOTSUP on other platforms.
Backported from upstream libuv PR 1527, scheduled for inclusion
in libuv 2.0.
Implement it on Linux, FreeBSD, and Windows for now, and return
UV_ENOTSUP on other platforms.
Backported from upstream libuv PR 1527, scheduled for inclusion
in libuv 2.0.
Extend our hack section of mappings to work around IWYU incorrectly
requiring:
* bits/stdint-uintn.h for stdint.h
* bits/stdint-intn.h for stdint.h
* bits/types/mbstate_t.h for wchar.h
b5e21d7d CTest: Re-implement test process handling using libuv
fcebff75 cmProcess: Use explicit enum for process exit exception
3dd2edf4 cmProcess: Use explicit enum for process state
5238e6db cmProcess: Remove unused ReportStatus method
c13b68e6 cmCTestRunTest: Modernize constructor and destructor decls
4d6b0903 cmCTestRunTest: Drop unused members
05da65bc cmCTestMultiProcessHandler: Factor out duplicate test finish logic
dd945345 cmCTestMultiProcessHandler: Add helper to make libuv use SA_RESTART
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1455
BSD `signal(2)` semantics make some system calls (e.g. for `write`)
restartable when interrupted by a signal handler. Use `SA_RESTART` to
enable these semantics everywhere that supports them.
This is required by C++ stream libraries that interpret `EINTR` as any
other error, set `badbit`, and stop writing. I've observed this with
`libstdc++` during a `std::cout.flush()` call interrupted by `SIGCHLD`.
This commit continues the refactoring of CTest to adopt std::chrono.
After the last sets of changes that introduced std::chrono::steady_clock
and std::chrono::system_clock respectively, it makes sense to have all
the timeouts be stored as std::chrono::duration.
No functional change intended.
IWYU incorrectly classifies this internal STL type as not internal, and
suggests including `<type_traits>` for it. Work around the problem by
mapping the offending names to a file that we always include.
See include-what-you-use issue 434.
IWYU incorrectly classifies this internal STL type as not internal, and
suggests including `<type_traits>` for it. Work around the problem by
mapping the offending names to a file that we always include.
See include-what-you-use issue 434.
Update the prebuilt binary build configurations for machines where
we build our own OpenSSL library to use a newer version.
Now that we require pthreads for libuv anyway, we can use OpenSSL 1.1
along with its dependency on pthreads.
Switch to the MSVC static runtime library (and static UCRT).
Link Qt statically, including the Windows platform plugin.
Disable the Qt tests because they are incompatible with a
Qt using a static runtime library.
Some are user facing.
Found using
codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`
whereby the whitelist contained:
ans
dum
helpfull
emmited
emmitted
buil
iff
isnt
nto
ot
pathes
substract
te
todays
upto
whitespaces
- sed on Mac does not support embedded sed statements, hence eliminating
the non-matches via grep
- xargs on Mac does not support -d, but does support -0, hence replacing
The SDK for macOS 10.13 adds `futimens` and `utimensat` so our checks
for these symbols may pass. However, the symbols are not available at
runtime on older macOS versions. Instead on macOS we can check for
availability based on the deployment target version.
Issue: #17101
On UNIX, build only the parts of libuv we need for the filesystem,
process, and poll abstractions using the POSIX poll() backend. This
avoids many platform-specific conditions. On Windows, build all of
libuv; there are no conditional alternatives anyway.
The scanbuild analysis cannot see that decodeUnicodeEscapeSequence
either initializes the `unicode` argument or returns `false` such
that the code following it runs only if `unicode` is initialized.
Add an explicit initialization to pacify it.
Even though we disable warnings when building jsoncpp itself, including
its headers from other CMake sources may still cause warnings.
Additional work will be needed to port CMake to newer jsoncpp interfaces
while still supporting jsoncpp 1.0.0. For now, just suppress the
markup.
note: this depends on
- a suitable flex version in PATH (currently 2.6.4)
- a suitable version of 'sed' in PATH (e.g. GNU sed)
Signed-off-by: Matthias Maennich <matthias@maennich.net>
Since commit v3.8.0-rc2~28^2~2 (Utilities/Sphinx: Port cmake extension
to Sphinx 1.4, 2017-02-09) we use the `sphinx.version_info` tuple.
However, it was added in Sphinx v1.2 so the check breaks compatibility
with older versions. Revise our check to assume Sphinx pre-1.2 if the
version tuple does not exist.
cf0ae55d server: Add support for connections that aren't event based
5ddfb6a4 server: Add connection as part of a request
d4f5d35c server: Refactor to make the event loop owned by server object
5acbf08b Tests: Teach Server test to forward exit code from server process
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !552