Commit 7fec3e2f authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch 'marc/251-update-clangformat-in-docker' into 'master'

Resolve "Update ClangFormat in Docker"

Closes #251

See merge request !162
parents 4a737cd3 a6f94b10
Loading
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -10,15 +10,20 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### New

- Additional tests to increase code coverage ([!141](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/141)).
- GKFS_ENABLE_UNUSED_FUNCTIONS added to disable code to increase code coverage.
- Updated Parallax version to new API (parallax option needs kv_format.parallax in the path, and the database in a device with O_DIRECT)
- Support for increasing file size via `truncate()` added ([!159](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/159)
- GKFS_ENABLE_UNUSED_FUNCTIONS added to disable code to increase code
  coverage. ([!141](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/141)).
- Updated Parallax version to new API (parallax option needs kv_format.parallax in the path, and the database in a
  device with O_DIRECT) ([!158](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/158)
- Support for increasing file size via `truncate()`
  added ([!159](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/159)
- Added PowerPC support ([!151](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/151)).

### Changed

- Support parallelism for path resolution tests ([!145](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/145)).
- Support parallelism for path resolution
  tests ([!145](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/145)).
- Support parallelism for symlink tests ([!147](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/147)).
- Updatd Parallax release (PARALLAX-exp)
- Update Parallax release (PARALLAX-exp) ([!158](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/158)

### Removed

@@ -45,6 +50,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
  pthread_create ([!156](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/156)
- Fixed an issue where compilation of syscall_intercept would fail for newer kernels using the `clone3()` system
  call ([!157](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/157)
- Updated code formatter to support the most recent clang-format-15
  version ([!162](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/162)).

## [0.9.1] - 2022-04-29

+4 −4
Original line number Diff line number Diff line
@@ -4,15 +4,15 @@ LABEL Description="Debian-based environment to check the formatting of GekkoFS c

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
		# clang 10 deps for clang-format
		# clang 15 deps for clang-format
		lsb-release \
		wget \
		software-properties-common \
		gnupg2 && \
    # add clang-10 repos
    wget https://apt.llvm.org/llvm.sh -P /tmp && chmod +x /tmp/llvm.sh && /tmp/llvm.sh 11 && \
    # add clang-15 repos
    wget https://apt.llvm.org/llvm.sh -P /tmp && chmod +x /tmp/llvm.sh && /tmp/llvm.sh 15 && \
    # install clang-format
    apt-get update && apt-get install -y --no-install-recommends clang-format-11 && \
    apt-get update && apt-get install -y --no-install-recommends clang-format-15 && \
    # Clean apt cache to reduce image layer size
    rm -rf /var/lib/apt/lists/* && rm /tmp/llvm.sh && \
    # Clean apt caches of packages
+48 −42
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@ MERCURY_GEN_PROC(rpc_stat_out_t,

MERCURY_GEN_PROC(rpc_rm_node_in_t, ((hg_const_string_t) (path)))

MERCURY_GEN_PROC(rpc_rm_metadata_out_t,
MERCURY_GEN_PROC(
        rpc_rm_metadata_out_t,
        ((hg_int32_t) (err))((hg_int64_t) (size))((hg_uint32_t) (mode)))

MERCURY_GEN_PROC(rpc_trunc_in_t,
@@ -60,11 +61,12 @@ MERCURY_GEN_PROC(
        rpc_update_metadentry_in_t,
        ((hg_const_string_t) (path))((uint64_t) (nlink))((hg_uint32_t) (mode))(
                (hg_uint32_t) (uid))((hg_uint32_t) (gid))((hg_int64_t) (size))(
                (hg_int64_t)(blocks))((hg_int64_t)(atime))((hg_int64_t)(mtime))(
                (hg_int64_t)(ctime))((hg_bool_t)(nlink_flag))(
                (hg_bool_t)(mode_flag))((hg_bool_t)(size_flag))(
                (hg_bool_t)(block_flag))((hg_bool_t)(atime_flag))(
                (hg_bool_t)(mtime_flag))((hg_bool_t)(ctime_flag)))
                (hg_int64_t) (blocks))((hg_int64_t) (atime))(
                (hg_int64_t) (mtime))((hg_int64_t) (ctime))(
                (hg_bool_t) (nlink_flag))((hg_bool_t) (mode_flag))(
                (hg_bool_t) (size_flag))((hg_bool_t) (block_flag))(
                (hg_bool_t) (atime_flag))((hg_bool_t) (mtime_flag))(
                (hg_bool_t) (ctime_flag)))

MERCURY_GEN_PROC(rpc_update_metadentry_size_in_t,
                 ((hg_const_string_t) (path))((hg_uint64_t) (size))(
@@ -77,27 +79,29 @@ MERCURY_GEN_PROC(rpc_get_metadentry_size_out_t,
                 ((hg_int32_t) (err))((hg_int64_t) (ret_size)))

#ifdef HAS_SYMLINKS
MERCURY_GEN_PROC(rpc_mk_symlink_in_t,
                 ((hg_const_string_t)(path))((hg_const_string_t)(target_path)))
MERCURY_GEN_PROC(rpc_mk_symlink_in_t, ((hg_const_string_t) (path))((
                                              hg_const_string_t) (target_path)))

#endif

// data
MERCURY_GEN_PROC(
        rpc_read_data_in_t,
        ((hg_const_string_t)(path))((int64_t)(offset))((hg_uint64_t)(host_id))(
                (hg_uint64_t)(host_size))((hg_uint64_t)(chunk_n))(
                (hg_uint64_t)(chunk_start))((hg_uint64_t)(chunk_end))(
                (hg_uint64_t)(total_chunk_size))((hg_bulk_t)(bulk_handle)))
        ((hg_const_string_t) (path))((int64_t) (offset))(
                (hg_uint64_t) (host_id))((hg_uint64_t) (host_size))(
                (hg_uint64_t) (chunk_n))((hg_uint64_t) (chunk_start))(
                (hg_uint64_t) (chunk_end))((hg_uint64_t) (total_chunk_size))(
                (hg_bulk_t) (bulk_handle)))

MERCURY_GEN_PROC(rpc_data_out_t, ((int32_t) (err))((hg_size_t) (io_size)))

MERCURY_GEN_PROC(
        rpc_write_data_in_t,
        ((hg_const_string_t)(path))((int64_t)(offset))((hg_uint64_t)(host_id))(
                (hg_uint64_t)(host_size))((hg_uint64_t)(chunk_n))(
                (hg_uint64_t)(chunk_start))((hg_uint64_t)(chunk_end))(
                (hg_uint64_t)(total_chunk_size))((hg_bulk_t)(bulk_handle)))
        ((hg_const_string_t) (path))((int64_t) (offset))(
                (hg_uint64_t) (host_id))((hg_uint64_t) (host_size))(
                (hg_uint64_t) (chunk_n))((hg_uint64_t) (chunk_start))(
                (hg_uint64_t) (chunk_end))((hg_uint64_t) (total_chunk_size))(
                (hg_bulk_t) (bulk_handle)))

MERCURY_GEN_PROC(rpc_get_dirents_in_t,
                 ((hg_const_string_t) (path))((hg_bulk_t) (bulk_handle)))
@@ -106,7 +110,8 @@ MERCURY_GEN_PROC(rpc_get_dirents_out_t,
                 ((hg_int32_t) (err))((hg_size_t) (dirents_size)))


MERCURY_GEN_PROC(rpc_config_out_t,
MERCURY_GEN_PROC(
        rpc_config_out_t,
        ((hg_const_string_t) (mountdir))((hg_const_string_t) (rootdir))(
                (hg_bool_t) (atime_state))((hg_bool_t) (mtime_state))(
                (hg_bool_t) (ctime_state))((hg_bool_t) (link_cnt_state))(
@@ -116,7 +121,8 @@ MERCURY_GEN_PROC(rpc_config_out_t,

MERCURY_GEN_PROC(rpc_chunk_stat_in_t, ((hg_int32_t) (dummy)))

MERCURY_GEN_PROC(rpc_chunk_stat_out_t,
MERCURY_GEN_PROC(
        rpc_chunk_stat_out_t,
        ((hg_int32_t) (err))((hg_uint64_t) (chunk_size))(
                (hg_uint64_t) (chunk_total))((hg_uint64_t) (chunk_free)))

+13 −4
Original line number Diff line number Diff line
@@ -32,6 +32,13 @@ PROJECT_INCLUDE="$(pwd)/include"
RUN_FORMAT=false
CLANG_FORMAT_BIN=""
VERBOSE=false
# Mac special treatment for readlink. greadlink must be installed...
READLINK_BIN=$(which readlink)
case "$(uname -s)" in
    Linux*)     READLINK_BIN=$(which readlink);;
    Darwin*)    READLINK_BIN=$(which greadlink);;
    *)          READLINK_BIN="readlink"
esac

usage_short() {
    echo "
@@ -68,17 +75,17 @@ while [[ $# -gt 0 ]]; do

    case ${key} in
    -s | --src)
        PROJECT_SRC="$(readlink -mn "${2}")"
        PROJECT_SRC="$($READLINK_BIN -mn "${2}")"
        shift # past argument
        shift # past value
        ;;
    -i | --include)
        PROJECT_INCLUDE="$(readlink -mn "${2}")"
        PROJECT_INCLUDE="$($READLINK_BIN -mn "${2}")"
        shift # past argument
        shift # past value
        ;;
    -c | --clang_format_path)
        CLANG_FORMAT_BIN="$(readlink -mn "${2}")"
        CLANG_FORMAT_BIN="$($READLINK_BIN -mn "${2}")"
        if [[ ! -x $CLANG_FORMAT_BIN ]]; then
            echo "*** ERR: clang-format path $CLANG_FORMAT_BIN is not an executable! Exiting ..."
            exit 1
@@ -110,7 +117,7 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
if [[ -z $CLANG_FORMAT_BIN ]]; then
    CLANG_FORMAT_BIN=$(command -v clang-format)
    if [[ -z $CLANG_FORMAT_BIN ]]; then
        CLANG_FORMAT_BIN=$(command -v clang-format-11)
        CLANG_FORMAT_BIN=$(command -v clang-format-15)
        # if it still doesn't exist exit
        if [[ -z $CLANG_FORMAT_BIN ]]; then
            echo "*** ERR: clang-format not found! Exiting ..."
@@ -118,6 +125,8 @@ if [[ -z $CLANG_FORMAT_BIN ]]; then
        fi
    fi
fi
echo "* Using clang-format binary: $CLANG_FORMAT_BIN"
echo "* Using version: $($CLANG_FORMAT_BIN --version)"

FAIL=false

+2 −1
Original line number Diff line number Diff line
@@ -133,7 +133,8 @@ absolute_to_relative(const string& root_path, const string& absolute_path) {
    auto rel_it_end = absolute_path.cend();

    // relative path start exactly after the root_path prefix
    assert((size_t)(rel_it_begin - absolute_path.cbegin()) == root_path.size());
    assert((size_t) (rel_it_begin - absolute_path.cbegin()) ==
           root_path.size());

    if(rel_it_begin == rel_it_end) {
        // relative path is empty, @absolute_path was equal to @root_path