Skip to content
Snippets Groups Projects
Verified Commit 29c1b077 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'f-grpc-f-acm' into f-acm

parents c51c4535 40d7c9eb
Branches
Tags
2 merge requests!42Release 0.2.0,!40F dot in username
This commit is part of merge request !40. Comments created here will be created in the context of that merge request.
# Summary
Insert a meaningful description for this merge request here. What is the
new/changed behavior? Which bug has been fixed? Are there related Issues?
# Focus
Point the reviewer to the core of the code change. Where should they start
reading? What should they focus on (e.g. security, performance,
maintainability, user-friendliness, compliance with the specs, finding more
corner cases, concrete questions)?
# Test Environment
How to set up a test environment for manual testing?
# Check List for the Author
Please, prepare your MR for a review. Be sure to write a summary and a
focus and create gitlab comments for the reviewer. They should guide the
reviewer through the changes, explain your changes and also point out open
questions. For further good practices have a look at [our review
guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md)
- [ ] All automated tests pass
- [ ] Reference related Issues
- [ ] Up-to-date CHANGELOG.md
- [ ] Annotations in code (Gitlab comments)
- Intent of new code
- Problems with old code
- Why this implementation?
# Check List for the Reviewer
- [ ] I understand the intent of this MR
- [ ] All automated tests pass
- [ ] Up-to-date CHANGELOG.md
- [ ] The test environment setup works and the intended behavior is
reproducible in the test environment
- [ ] In-code documentation and comments are up-to-date.
- [ ] Check: Are there specifications? Are they satisfied?
For further good practices have a look at [our review guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md).
/assign me
/target_branch dev
......@@ -20,10 +20,10 @@
cmake_minimum_required(VERSION 3.13)
set(libcaosdb_VERSION 0.2.0)
set(libcaosdb_VERSION 0.1.3)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_MAJOR 0)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 7)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_PATCH 1)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_PATCH 3)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_PRE_RELEASE "")
project(libcaosdb
......
......@@ -13,20 +13,32 @@ guidelines of the CaosDB Project
## Steps
1. Create a release branch from the dev branch. This prevents further changes
to the code base and a never ending release process. Naming: `release-<VERSION>`
1. Create a release branch from the dev branch. This prevents further changes to
the code base and a never ending release process. Naming:
`release-<VERSION>`. Also create a branch with the same name in cppinttests.
2. Update CHANGELOG.md
3. Check all general prerequisites.
4. Prepare [CMakeLists.txt](./CMakeLists.txt): Check the `MAJOR`, `MINOR`, `PATCH`
version variables.
4. Update version numbers:
1. In [CMakeLists.txt](./CMakeLists.txt): Check the version variables and
make sure that the compatible caosdb-server version is set correctly.
2. In `conanfile.py`: Update the `version` variable.
3. In `caosdb-cppinttest/conanfile.py`: Update the version
5. Merge the release branch into the main branch.
6. Tag the latest commit of the main branch with `v<VERSION>`.
6. Tag the latest commit of the main branch with `v<VERSION>`. Push the tag and the main branch.
7. Delete the release branch.
7. Create release in Gitlab:
1. On [Releases](https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib/-/releases), click "New release"
2. Choose tag, type release title (same as tag), no milestone, possibly short release note, no
manual assets are necessary, possibly link to documentation.
8. TODO...
8. Delete the release branch.
9. Release cppinttests with updated cpplib version
10. Merge `main` back into `dev` and increase patch version by one to begin next
release cycle. Do the same in cppintest.
......@@ -18,9 +18,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
* Calling "GetFileDescriptor().wrapped->path()" after retrieval leads to SegFault.
- #41 Updated Conan version in CI pipeline.
### Security
### Documentation
## [0.1.2] - 2022-05-31
(Florian Spreckelsen)
### Fixed
- #41 Updated Conan version in CI pipeline.
## [0.1.1 - 2022-04-12]
### Security
- Bumped zlib dependency to 1.2.12.
## [0.1.0 - 2021-12-11]
Initial Release.
......
......@@ -84,7 +84,7 @@ if (DOXYGEN_FOUND)
sphinx_out
DEPENDS doc-doxygen
Examples.rst
Install_develop.md
Install_develop.rst
FEATURES.md
CHANGELOG.md
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
......@@ -94,7 +94,7 @@ if (DOXYGEN_FOUND)
# Copying files is necessary: https://stackoverflow.com/a/45808534/232888
file(COPY
Examples.rst
Install_develop.md
Install_develop.rst
DEPENDENCIES.md
CHANGELOG.md
FEATURES.md
......
# How to use and develop libcaosdb
## Dependencies
* See the [dependencies](DEPENDENCIES.md) file.
## Build
### Building with `make` ##
Make sure that the dependencies (see above) are fulfilled. On systems which have `make` installed,
type this in your command line terminal:
```console
make conan
```
### Manual build ##
We use [cmake](https://cmake.org) as build tool, with Conan as package manager.
The compiler must support the C++17 standard.
0. clone/update the subrepo `git submodule update --init proto`
1. `mkdir build && cd build`
2. `conan install .. -s "compiler.libcxx=libstdc++11"`
3. `cmake -B . ..`
4. `cmake --build .`
You may also want to install libcaosdb system-wide to
`CMAKE_INSTALL_PREFIX/lib` by
5. `cmake --install .`
The default install prefix is `~/.local`. It can be set by adding
`-DCMAKE_INSTALL_PREFIX=/path/to/install/prefix` to the first cmake
command (3.).
If you want to build or install libcaosdb without the use of Conan, feel free to rewrite the
CMakeLists.txt as needed. The CaosDB project is open to merge requests which support multiple ways
of installation.
### How to build on MacOS
If you use apple-clang as the compiler: Instead of the above conan command (2.) use
2. `conan install .. -s "compiler.cppstd=17"`
and continue as you would when building on a Linux system. You may
have to add `build/lib/` (or, alternatively after installation,
`CMAKE_INSTALL_PREFIX/lib`) to your `DYLD_LIBRARY_PATH` environmental
variable.
#### Problems and solutions ####
- Make sure that your Conan version supports your XCode version. A typical symptom of version
mismatch is for example conan complaining about incompatible `compiler.version` settings. You may
need to rerun any conan and cmake commands (and delete cache files first) after compiler updates.
### How to build on Windows
We use [Visual Studio 2019](https://visualstudio.microsoft.com/de/vs/features/cplusplus/)
as compiler. We use [cmake](https://cmake.org/download/) as build tool.
0. clone/update the subrepo `git submodule update --init proto`
1. `mkdir build`
2. `cd build`
3. `conan install .. -g visual_studio -s arch=x86_64 -s build_type=Release -s compiler.toolset=v142 -s compiler.version=16 -s compiler.runtime=MD --build=missing --update`
4. `cmake -B . ..`
5. open ` libcaosdb.sln` with Visual Studio, change the buildtype to `Release`
and build the project. (You can open Tools/Command Line/Developer Command
Prompt and execute `msbuild libcaosdb.sln /property:Configuration=Release`)
#### Known problems ####
- Linking dynamic libraries currently fails on Windows. So probably other CaosDB libraries which
make use of libcaosdb also will not build. This is a known bug and we hope to
fix this in the next release. See
[#34](https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib/-/issues/34)
### Troubleshooting
#### `conan install` fails due to missing prebuilts
When `conan install` fails during the installation of the dependencies because
a precompiled package is not available for your specific settings, try adding
the `--build=missing` option: `conan install .. [ other options
] --build=missing`. This should download and compile the sources of the
dependencies.
#### cmake fails when using the debug flag
Depending on the clang version it might be necessary to additionally use the following flag:
`-DCMAKE_CXX_FLAGS="-Wno-unused-parameter"`
#### conan uses outdated cppstd during install
If you experience compiler errors during a `conan install` process due
to, e.g., `std::string_view` being unavailable, try specifying the cpp
standard manually by `conan install .. [other options] -s
"compiler.cppstd=17"`.
## Client Configuration ##
You can use a json file for the configuration of the client. See
`test/test_data/test_caosdb_client.json` for an example. You may use
`caosdb-client-configuration-schema.json` to validate your schema.
Typically, you will need to provide the path to your SSL certificate.
The client will load the configuration file from the first existing
file in the following locations (precedence from highest to lowest):
1. A file specified by the environment variable
`$CAOSDB_CLIENT_CONFIGURATION`.
2. `$PWD/caosdb_client.json`
3. `$PWD/caosdb-client.json`
4. `$PWD/.caosdb_client.json`
5. `$PWD/.caosdb-client.json`
6. `$HOME/caosdb_client.json`
7. `$HOME/caosdb-client.json`
8. `$HOME/.caosdb_client.json`
9. `$HOME/.caosdb-client.json`
## Develop ##
### Unit tests ###
#### Build ####
For the tests there is a slightly different setup required (with option `-D CMAKE_BUILD_TYPE=Debug`)
1. `mkdir build && cd build/`
2. `conan install .. ` (with gcc, append ` -s "compiler.libcxx=libstdc++11"`, with apple-clang,
append ` -s compiler.cppstd=17`)
3. `cmake -B . -D CMAKE_BUILD_TYPE=Debug ..`
* If your clang-format version is too old, formatting, linting etc. can be skipped:
`cmake -B . -D CMAKE_BUILD_TYPE=Debug -D SKIP_LINTING=ON ..`
* Depending on the clang version it might be necessary to also add
`-DCMAKE_CXX_FLAGS="-Wno-unused-parameter"`
5. `cmake --build .`
#### Run ####
In the build directory, run `ctest`
#### Framework ####
We use [GoogleTest](https://google.github.io/googletest/) for unit testing.
#### Test coverage ####
We use [gcov](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html) and
[lcov](https://github.com/linux-test-project/lcov) for generating test coverage
reports.
In the build directory, generate the coverage report by running
`cmake --build . --target unit_test_coverage`.
Note that this special target will run the tests again. Thus it is not
necessary to run `ctest` prior to this target.
The coverage report can be viewed in a browser by opening
`<build_directory>/unit_test_coverage/index.html`.
### Code formatting ###
* install clang-format on your system.
* `clang-format -i --verbose $(find test/ src/ include/ -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.h.in")`
### Naming conventions ###
Please adhere to [Google's C++ naming conventions](https://google.github.io/styleguide/cppguide.html#Naming).
### Documentation ###
To build the documentation, run in the build directory
* `cmake --build . --target doc-doxygen` (generate Doxygen)
* `cmake --build . --target doc-sphinx` (generate Sphinx)
How to use and develop libcaosdb
================================
Dependencies
------------
- See the `dependencies <DEPENDENCIES.md>`__ file.
Build
-----
Building with ``make``
~~~~~~~~~~~~~~~~~~~~~~
Make sure that the dependencies (see above) are fulfilled. On systems
which have ``make`` installed, type this in your command line terminal:
.. code:: console
make conan
Manual build
~~~~~~~~~~~~
We use `cmake <https://cmake.org>`__ as build tool, with Conan as
package manager. The compiler must support the C++17 standard.
1. clone/update the subrepo ``git submodule update --init proto``
2. ``mkdir build && cd build``
3. ``conan install .. -s "compiler.libcxx=libstdc++11"``
4. ``cmake -B . ..``
5. ``cmake --build .``
You may also want to install libcaosdb system-wide to
``CMAKE_INSTALL_PREFIX/lib`` by
1. ``cmake --install .``
The default install prefix is ``~/.local``. It can be set by adding
``-DCMAKE_INSTALL_PREFIX=/path/to/install/prefix`` to the first cmake
command (3.).
.. Note::
The C++ CaosDB library links against other libraries which are installed by Conan. So if you want
to switch to newer versions of those libraries (possible reasons may be security releases or bug
fixes), it is not sufficient to update your system libraries, but you have to update your Conan
content and then rebuild libcaosdb.
If you want to build or install libcaosdb without the use of Conan, feel
free to rewrite the CMakeLists.txt as needed. The CaosDB project is open
to merge requests which support multiple ways of installation.
How to build on MacOS
~~~~~~~~~~~~~~~~~~~~~
If you use apple-clang as the compiler: Instead of the above conan
command (2.) use
1. ``conan install .. -s "compiler.cppstd=17"``
and continue as you would when building on a Linux system. You may have
to add ``build/lib/`` (or, alternatively after installation,
``CMAKE_INSTALL_PREFIX/lib``) to your ``DYLD_LIBRARY_PATH``
environmental variable.
Problems and solutions
^^^^^^^^^^^^^^^^^^^^^^
- Make sure that your Conan version supports your XCode version. A
typical symptom of version mismatch is for example conan complaining
about incompatible ``compiler.version`` settings. You may need to
rerun any conan and cmake commands (and delete cache files first)
after compiler updates.
How to build on Windows
~~~~~~~~~~~~~~~~~~~~~~~
We use `Visual Studio
2019 <https://visualstudio.microsoft.com/de/vs/features/cplusplus/>`__
as compiler. We use `cmake <https://cmake.org/download/>`__ as build
tool.
1. clone/update the subrepo ``git submodule update --init proto``
2. ``mkdir build``
3. ``cd build``
4. ``conan install .. -g visual_studio -s arch=x86_64 -s build_type=Release -s compiler.toolset=v142 -s compiler.version=16 -s compiler.runtime=MD --build=missing --update``
5. ``cmake -B . ..``
6. open ``libcaosdb.sln`` with Visual Studio, change the buildtype to
``Release`` and build the project. (You can open Tools/Command
Line/Developer Command Prompt and execute
``msbuild libcaosdb.sln /property:Configuration=Release``)
Known problems
^^^^^^^^^^^^^^
- Linking dynamic libraries currently fails on Windows. So probably
other CaosDB libraries which make use of libcaosdb also will not
build. This is a known bug and we hope to fix this in the next
release. See
`#34 <https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib/-/issues/34>`__
Troubleshooting
~~~~~~~~~~~~~~~
``conan install`` fails due to missing prebuilts
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When ``conan install`` fails during the installation of the dependencies
because a precompiled package is not available for your specific
settings, try adding the ``--build=missing`` option:
``conan install .. [ other options ] --build=missing``. This should
download and compile the sources of the dependencies.
cmake fails when using the debug flag
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Depending on the clang version it might be necessary to additionally use
the following flag: ``-DCMAKE_CXX_FLAGS="-Wno-unused-parameter"``
conan uses outdated cppstd during install
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you experience compiler errors during a ``conan install`` process due
to, e.g., ``std::string_view`` being unavailable, try specifying the cpp
standard manually by
``conan install .. [other options] -s "compiler.cppstd=17"``.
Client Configuration
--------------------
You can use a json file for the configuration of the client. See
``test/test_data/test_caosdb_client.json`` for an example. You may use
``caosdb-client-configuration-schema.json`` to validate your schema.
Typically, you will need to provide the path to your SSL certificate.
The client will load the configuration file from the first existing file
in the following locations (precedence from highest to lowest):
1. A file specified by the environment variable
``$CAOSDB_CLIENT_CONFIGURATION``.
2. ``$PWD/caosdb_client.json``
3. ``$PWD/caosdb-client.json``
4. ``$PWD/.caosdb_client.json``
5. ``$PWD/.caosdb-client.json``
6. ``$HOME/caosdb_client.json``
7. ``$HOME/caosdb-client.json``
8. ``$HOME/.caosdb_client.json``
9. ``$HOME/.caosdb-client.json``
Develop
-------
Unit tests
~~~~~~~~~~
.. _build-1:
Build
^^^^^
For the tests there is a slightly different setup required (with option
``-D CMAKE_BUILD_TYPE=Debug``)
1. ``mkdir build && cd build/``
2. ``conan install ..`` (with gcc, append
``-s "compiler.libcxx=libstdc++11"``, with apple-clang, append
``-s compiler.cppstd=17``)
3. ``cmake -B . -D CMAKE_BUILD_TYPE=Debug ..``
- If your clang-format version is too old, formatting, linting etc. can
be skipped:
``cmake -B . -D CMAKE_BUILD_TYPE=Debug -D SKIP_LINTING=ON ..``
- Depending on the clang version it may be necessary to also add
``-DCMAKE_CXX_FLAGS="-Wno-unused-parameter"``
4. ``cmake --build .``
Run
^^^
In the build directory, run ``ctest``
Framework
^^^^^^^^^
We use `GoogleTest <https://google.github.io/googletest/>`__ for unit
testing.
Test coverage
^^^^^^^^^^^^^
We use `gcov <https://gcc.gnu.org/onlinedocs/gcc/Gcov.html>`__ and
`lcov <https://github.com/linux-test-project/lcov>`__ for generating
test coverage reports.
In the build directory, generate the coverage report by running
``cmake --build . --target unit_test_coverage``.
Note that this special target will run the tests again. Thus it is not
necessary to run ``ctest`` prior to this target.
The coverage report can be viewed in a browser by opening
``<build_directory>/unit_test_coverage/index.html``.
Code formatting
~~~~~~~~~~~~~~~
- install clang-format on your system.
- ``clang-format -i --verbose $(find test/ src/ include/ -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.h.in")``
Naming conventions
~~~~~~~~~~~~~~~~~~
Please adhere to `Google’s C++ naming
conventions <https://google.github.io/styleguide/cppguide.html#Naming>`__.
Documentation
~~~~~~~~~~~~~
To build the documentation, run in the build directory
- ``cmake --build . --target doc-doxygen`` (generate Doxygen)
- ``cmake --build . --target doc-sphinx`` (generate Sphinx)
......@@ -16,13 +16,13 @@ pytz==2021.1
requests==2.25.1
six==1.16.0
snowballstemmer==2.1.0
Sphinx==4.0.1
sphinx-rtd-theme==0.5.2
Sphinx==4.5.0
sphinx-rtd-theme==1.0.0
sphinx-sitemap==2.2.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
sphinxcontrib-serializinghtml==1.1.5
urllib3==1.26.7
Subproject commit 02e56997f29ee3bfc2c079c9776f66659379c58a
Subproject commit 0b301401cf28d7a3edeb2c55e418f072b83cf5a7
......@@ -4,13 +4,13 @@ certifi==2021.10.8
chardet==4.0.0
charset-normalizer==2.0.7
colorama==0.4.4
conan==1.43.0
conan==1.48.0
deprecation==2.1.0
distro==1.6.0
fasteners==0.16.3
future==0.18.2
idna==3.2
Jinja2==2.11.3
Jinja2==3.1.1
jsonschema==4.1.0
MarkupSafe==2.0.1
node-semver==0.6.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment