Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from ElektraInitiative/master
Browse files Browse the repository at this point in the history
Updating fork
  • Loading branch information
alexsaber authored May 22, 2019
2 parents 729a802 + efa5ec4 commit a20274f
Show file tree
Hide file tree
Showing 699 changed files with 33,396 additions and 5,465 deletions.
33 changes: 31 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bsd_task:
- &create_and_chage_to_build_dir mkdir build && cd build
- > # We use `-std=c11`, since the header `math.h` on FreeBSD requires C11 features
cmake
-DBINDINGS=ALL
-DBINDINGS='ALL;-io_glib'
-DCMAKE_SKIP_INSTALL_RPATH=ON
-DCOMMON_FLAGS=-Werror
-DC_STD=-std=c11
Expand Down Expand Up @@ -130,7 +130,7 @@ mac_task:
brew install python@2; brew link --overwrite python@2
brew install python || brew upgrade python
- | # Install Python packages
pip install cmake-format pyyaml
pip install cmake-format[yaml]==0.4.5
- | # Install Ruby
brew install [email protected]
- | # Install Ruby gems
Expand Down Expand Up @@ -184,3 +184,32 @@ mac_task:
printf '. Please add the files shown above to `ElektraUninstall.cmake`.\n'
false
fi
linux_task:
matrix:

- name: 🔗 Check
container:
dockerfile: scripts/docker/cirrus/Dockerfile

script:
- mkdir build && cd build
- >
cmake -GNinja ..
-DBUILD_FULL=OFF
-DBUILD_SHARED=OFF
-DBUILD_STATIC=OFF
-DBUILD_TESTING=OFF
- cd ..
- ninja -C build 2>&1 | grep 'warning: invalid link' > broken_links.txt || true
- scripts/link-checker build/external-links.txt 2>> broken_links.txt > /dev/null

tests_script:
- |
if test -s broken_links.txt; then
printf >&2 'Broken Links:\n'
printf >&2 '—————————————\n'
cat >&2 broken_links.txt
printf >&2 '—————————————\n'
false
fi
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ We recommend that you read:

- [The big picture what Elektra is](/doc/BIGPICTURE.md)
- [The tutorials to get some practice](/doc/tutorials/)
- [The step by step guide of how to contribute](/doc/tutorials/contributing-clion.md)

# Code

Expand Down
10 changes: 8 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Basics

Do not describe the purpose here but:
Check relevant points but **please do not remove entries**.
Do not describe the purpose of this PR in the PR description but:

- [ ] Short descriptions should be in the release notes (added as entry in
`doc/news/_preparation_next_release.md` which contains `_(my name)_`)
Expand All @@ -20,11 +21,16 @@ need to be checked.
- [ ] I ran all tests locally and everything went fine
- [ ] affected documentation is fixed
- [ ] I added code comments, logging, and assertions (see doc/CODING.md)
- [ ] meta data is updated (e.g. README.md of plugins)
- [ ] meta data is updated (e.g. README.md of plugins and doc/METADATA.md)

## Review

Remove the line below and add the "work in progress" label if you do
not want the PR to be reviewed:

@markus2330 please review my pull request

## Merging

Please add the "ready to merge" label when the build server and you say
that everything is ready to be merged.
21 changes: 9 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: cpp
dist: xenial
osx_image: xcode10.1
osx_image: xcode10.2

cache:
directories:
$HOME/.m2
$HOME/.cabal
$HOME/elektra-cabal-sandbox
$HOME/Library/Caches/Homebrew
- $HOME/.m2
- $HOME/.cabal
- $HOME/elektra-cabal-sandbox
- $HOME/Library/Caches/Homebrew

# don't cache our own libraries generated in the build
# so they always get rebuilt properly and to avoid init issues
Expand Down Expand Up @@ -114,11 +114,9 @@ matrix:
-regexstore;\
-rename;\
-required;\
-semlock;\
-shell;\
-simplespeclang;\
-struct;\
-sync;\
-syslog;\
-tcl;\
-template;\
Expand Down Expand Up @@ -186,8 +184,6 @@ matrix:

- os: osx
name: 🍏 GCC
# Translating the `syslog` plugin with GCC on macOS 10.13 does not work, since GCC is unable to compile `sys/syslog.h`.
osx_image: xcode9.2
compiler: gcc
env:
# Unfortunately the tests for the Xerces plugin fail: https://travis-ci.org/ElektraInitiative/libelektra/jobs/483331657#L3740
Expand All @@ -197,11 +193,12 @@ matrix:

- os: osx
name: 🍏 Haskell
osx_image: xcode10.1 # We use macOS 10.13 here, since the Haskell plugin does not seem to compile on macOS 10.14
compiler: clang
env:
- HASKELL=ON
# Use a minimal configuration for the haskell bindings to give it enough time to compile dependencies
- PLUGINS='resolver_fm_hpu_b;dump;dini;list;spec;haskell;typechecker;ini;sync;error;base64;regexdispatcher'
- PLUGINS='resolver_fm_hpu_b;dump;dini;list;spec;haskell;typechecker;ini;sync;error;base64;regexdispatcher;ni;c'
- BINDINGS=haskell
- TOOLS=kdb

Expand Down Expand Up @@ -337,7 +334,7 @@ before_install:
sudo apt-get install libzmq3-dev
sudo apt-get install libxerces-c-dev
sudo apt-get install moreutils # contains `sponge` required by `reformat-cmake`
sudo pip install cmake-format==0.4.5 pyyaml
sudo pip install cmake-format[yaml]==0.4.5
git clone --branch 2.7.1 --depth 1 https://github.com/taocpp/PEGTL.git && sudo cp -R PEGTL/include/tao /usr/local/include
mkdir -p "$HOME/bin" && cd "$HOME/bin" && \
curl -L "https://github.com/mvdan/sh/releases/download/v2.6.3/shfmt_v2.6.3_linux_amd64" -o shfmt && \
Expand Down Expand Up @@ -365,7 +362,7 @@ before_script:
-DBUILD_FULL="${BUILD_FULL:-OFF}"
-DBUILD_SHARED="${BUILD_SHARED:-ON}"
-DENABLE_ASAN="${ENABLE_ASAN:-OFF}"
-DCOMMON_FLAGS="${COMMON_FLAGS:--Werror}"
-DCOMMON_FLAGS="${COMMON_FLAGS--Werror}"
-DENABLE_DEBUG=ON
-DINSTALL_SYSTEM_FILES=OFF
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Travis Build Status](https://travis-ci.org/ElektraInitiative/libelektra.svg?branch=master)](https://travis-ci.org/ElektraInitiative/libelektra)
[![Cirrus Build Status](https://api.cirrus-ci.com/github/ElektraInitiative/libelektra.svg)](https://cirrus-ci.com/github/ElektraInitiative/libelektra)
[![Coverage Status](https://img.shields.io/coveralls/github/ElektraInitiative/libelektra.svg)](https://coveralls.io/github/ElektraInitiative/libelektra)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/ElektraInitiative/libelektra.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ElektraInitiative/libelektra/alerts)

_Elektra serves as a universal and secure framework to access configuration
settings in a global, hierarchical key database._
Expand All @@ -17,10 +18,10 @@ and tools concerning their configuration tasks. Elektra abstracts from
cross-platform-related issues and enables applications to be aware of other
applications' configurations, leveraging easy application integration.

## Often used links
## Often Used Links

- [build server](https://build.libelektra.org/)
- [website](https://www.libelektra.org)
- [Build server](https://build.libelektra.org/)
- [Website](https://www.libelektra.org)
- [API docu](https://doc.libelektra.org/api/latest/html/)

## Overview
Expand Down Expand Up @@ -100,7 +101,7 @@ To get an idea of Elektra, you can take a look at the
In the GitHub repository the full documentation is available, including:

- [tutorials](/doc/tutorials/),
- [faq](/doc/help/elektra-faq.md),
- [FAQ](/doc/help/elektra-faq.md),
- [glossary](/doc/help/elektra-glossary.md), and
- [concepts and man pages](/doc/help/elektra-introduction.md)

Expand All @@ -124,7 +125,7 @@ You can read the documentation for the kdb tool, either
plugins instead.
- Postpone configuration decisions (such as which configuration files to use)
from developers to system administrators and package maintainers to
provide a overall more consistent and user-friendly system.
provide an overall more consistent and user-friendly system.
(Default behavior of applications still is in control of developers,
you can even roll your own plugins to provide exactly the same behavior
as your application has now.)
Expand Down Expand Up @@ -159,19 +160,21 @@ And in terms of quality, we want:
- Elektra (except for some [plugins](src/plugins/)) has no external dependency.
- Elektra is suitable for embedded systems and early boot stage programs.
- Elektra provides many powerful [Bindings](src/bindings) to avoid low-level access code.
- Elektra provides powerful [Code Generation Techniques](src/tools/gen) for high-level configuration access.
- Elektra provides powerful [Code Generation Techniques](src/tools/pythongen) for high-level configuration access.

## News

Go to the [website](https://www.libelektra.org), see [News](doc/news/), and its [RSS feed](https://www.libelektra.org/news/feed.rss).
Go to the [website](https://www.libelektra.org), see the [news](doc/news/), and its [RSS feed](https://www.libelektra.org/news/feed.rss).

## Download

Elektra uses a [git repository at GitHub](https://github.com/ElektraInitiative/libelektra).

You can clone the latest version of Elektra by running:

git clone https://github.com/ElektraInitiative/libelektra.git
```sh
git clone https://github.com/ElektraInitiative/libelektra.git
```

Releases can be downloaded from [here](https://www.libelektra.org/ftp/elektra/releases/).

Expand Down
3 changes: 2 additions & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ do_benchmark (large)
do_benchmark (cmp)
do_benchmark (createkeys)

# exclude storage benchmark from mingw
# exclude storage and KDB benchmark from mingw
if (NOT WIN32)
include_directories ("${CMAKE_SOURCE_DIR}/tests/cframework")
set (ADDITIONAL_SOURCES $<TARGET_OBJECTS:cframework>)
do_benchmark (storage)
do_benchmark (kdb)
endif (NOT WIN32)

# exclude the OPMPHM benchmarks from mingw
Expand Down
30 changes: 22 additions & 8 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ and run the same benchmarks again.

For running benchmarks you can use on Unix:

make benchmark_<filename>_callgrind
```sh
make benchmark_<filename>_callgrind
```

which will run the callgrind tool of Valgrind on it.
which will run the `callgrind` tool of Valgrind on it.

The old STATISTICS file is no longer used and will be
removed with this commit.
Expand All @@ -28,24 +30,36 @@ to generate a file containing the seeds. The number of seeds vary, execute the
`benchmark_opmphm` without parameter to get the number of seeds.
Then execute:

cat <fileWithSeeds> | benchmark_opmphm <benchmark>
```sh
cat <fileWithSeeds> | benchmark_opmphm <benchmark>
```

Example:

To run the OPMPHM build time benchmark you need 2008 seeds.
First generate the seeds:

scripts/generate-seeds 2008 mySeedFile
```sh
scripts/generate-seeds 2008 mySeedFile
```

Then pass it to the benchmark:

cat mySeedFile | benchmark_opmphm opmphmbuildtime
```sh
cat mySeedFile | benchmark_opmphm opmphmbuildtime
```

## plugingetset

The `benchmark_plugingetset` is different than the other benchmarks. It doesn't do any benchmarking by itself.
Instead it simple takes 3 arguments `<path> <parent> <plugin>`. It then looks for the file `test.<plugin>.in` under the path `<path>`
Instead it simple takes 3 or 4 arguments:

```sh
benchmark_plugingetset <path> <parent> <plugin> [get]
```

. It then looks for the file `test.<plugin>.in` under the path `<path>`
and calls the `get` method of plugin `<plugin>` on this file with parent Key `<parent>`. Lastly it calls the `set` method of `<plugin>`
on the file `test.<plugin>.out` with parent Key `<parent>`.
on the file `test.<plugin>.out` with parent Key `<parent>`, if you did not specify `get` as fourth argument.

`benchmark_plugingetset` can used with `time` (or similar programs) compare the speed of two (or more) storage plugins for specific files.
`benchmark_plugingetset` can be used with `time` (or similar programs) to compare the speed of two (or more) storage plugins for specific files. The [benchmarking tutorial](../doc/tutorials/benchmarking.md) provides one example on how to do that.
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extern const char * const alphabetspecial;
* * Create fresh subKeys:
* Set subKeys >= 0 and label = 0, to create a branch you do not want to reuse.
* Set subKeys >= 0 and label > 0, to create a branch you want to link later, using the label number.
* * Use a already existing branch:
* * Use an already existing branch:
* Set subKeys < 0 and label > 0, the subKeys will be taken from the labelled branch.
* Data:
* The shapef function has also a memory, the data pointer points to it.
Expand Down
67 changes: 67 additions & 0 deletions benchmarks/kdb.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* @file
*
* @brief Benchmark for KDB
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/

#include <stdio.h>

#include <benchmarks.h>
#include <kdb.h>

#define NUM_RUNS 7

#define CSV_STR_FMT "%s;%s;%d\n"


static void benchmarkDel (void)
{
ksDel (large);
}

int main (void)
{
benchmarkCreate ();
benchmarkFillup ();

fprintf (stdout, "%s;%s;%s\n", "plugin", "operation", "microseconds");
{
KeySet * returned = ksNew (0, KS_END);
Key * parentKey = keyNew ("user", KEY_END);

timeInit ();
KDB * handle = kdbOpen (parentKey);
fprintf (stdout, CSV_STR_FMT, "core", "kdbOpen", timeGetDiffMicroseconds ());

kdbGet (handle, returned, parentKey);
fprintf (stdout, CSV_STR_FMT, "core", "kdbGet", timeGetDiffMicroseconds ());

// ksAppend (returned, large);
kdbSet (handle, large, parentKey);
fprintf (stdout, CSV_STR_FMT, "core", "kdbSet", timeGetDiffMicroseconds ());
kdbClose (handle, parentKey);
keyDel (parentKey);
ksDel (returned);
}

for (size_t i = 0; i < NUM_RUNS; ++i)
{
timeInit ();
Key * parentKey = keyNew ("user/benchmark", KEY_END);
KDB * handle = kdbOpen (parentKey);
fprintf (stdout, CSV_STR_FMT, "core", "kdbOpen", timeGetDiffMicroseconds ());

KeySet * returned = ksNew (0, KS_END);
timeInit ();
kdbGet (handle, returned, parentKey);
fprintf (stdout, CSV_STR_FMT, "core", "kdbGet", timeGetDiffMicroseconds ());

kdbClose (handle, parentKey);
ksDel (returned);
keyDel (parentKey);
}

benchmarkDel ();
}
Loading

0 comments on commit a20274f

Please sign in to comment.