Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BasedOnStyle: Google

ColumnLimit: 100
Standard: c++20

AlignEscapedNewlines: Right
AllowAllArgumentsOnNextLine: false
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
#----- --- -- - - - -
- name: Build and test
env:
CACHE_CONAN_REMOTE: ${{ vars.CACHE_CONAN_REMOTE }}
CACHE_CONAN_LOGIN_USERNAME: ${{ vars.CACHE_CONAN_LOGIN_USERNAME }}
CACHE_CONAN_PASSWORD: ${{ secrets.CACHE_CONAN_PASSWORD }}
CI_JOB_NAME: build_and_test
run: scripts/ci-job-with-docker.sh
#+++++++++++-+-+--+----- --- -- - - - -
Expand All @@ -44,9 +41,6 @@ jobs:
steps:
- name: Release
env:
CACHE_CONAN_REMOTE: ${{ vars.CACHE_CONAN_REMOTE }}
CACHE_CONAN_LOGIN_USERNAME: ${{ vars.CACHE_CONAN_LOGIN_USERNAME }}
CACHE_CONAN_PASSWORD: ${{ secrets.CACHE_CONAN_PASSWORD }}
RELEASE_CONAN_REMOTE: ${{ vars.RELEASE_CONAN_REMOTE }}
RELEASE_CONAN_LOGIN_USERNAME: ${{ vars.RELEASE_CONAN_LOGIN_USERNAME }}
RELEASE_CONAN_PASSWORD: ${{ secrets.RELEASE_CONAN_PASSWORD }}
Expand Down
28 changes: 26 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#+++++++++++-+-+--+----- --- -- - - - -

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration

import platform
import io, os, platform, shlex, subprocess


class LlfsConan(ConanFile):
Expand Down Expand Up @@ -60,6 +61,8 @@ class LlfsConan(ConanFile):
"ninja/[>=1.12.1 <2]",
]

_is_header_only = (platform.system() != "Linux")

#+++++++++++-+-+--+----- --- -- - - - -

def configure(self):
Expand Down Expand Up @@ -96,7 +99,10 @@ def set_version(self):
return self.cor.set_version_from_git_tags(self)

def layout(self):
return self.cor.layout_cmake_unified_src(self)
self.cor.layout_cmake_unified_src(self)
self.cpp.build.libdirs += ['src']
if not self._is_header_only:
self.cpp.build.libs += ['llfs']

def generate(self):
return self.cor.generate_cmake_default(self)
Expand All @@ -113,5 +119,23 @@ def package_info(self):
def package_id(self):
return self.cor.package_id_lib_default(self)

def validate_build(self):
if self.settings.compiler == "gcc":
out_capture = io.StringIO()
cc_name = (
self.buildenv.vars(self).get('CC') or
self.buildenv.vars(self).get('CXX') or
os.getenv('CC') or
os.getenv('CXX') or
'gcc'
)
self.run(shlex.join([cc_name, '-dumpversion']), stdout=out_capture, shell=True)
actual_compiler_version = out_capture.getvalue().strip()
profile_compiler_version = str(self.settings.compiler.version)
if profile_compiler_version != actual_compiler_version:
raise ConanInvalidConfiguration(f"Compiler version mismatch: actual={actual_compiler_version}"
f", expected={profile_compiler_version}")

#+++++++++++-+-+--+----- --- -- - - - -


8 changes: 7 additions & 1 deletion scripts/ci-job-with-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ PROJECT_DIR=$(realpath $(dirname "${SCRIPT_DIR}"))

# Run the ci-job.sh script using docker.
#
ROOT_IMAGE=registry.gitlab.com/batteriescpp/batteries:v0.60.2-devel.linux_gcc11_amd64
ROOT_IMAGE=registry.gitlab.com/batteriesincluded/batt-docker/batteries-debian12-build-tools:0.6.0
USER_IMAGE=$(cor docker user-image ${ROOT_IMAGE} --user-commands-file="${SCRIPT_DIR}/ci-job-setup.dockerfile")

VOLUMES=
if [ -f "${HOME}/conan-local-cache-server-config.sh" ]; then
VOLUMES+="--volume ${HOME}/conan-local-cache-server-config.sh:/conan-local-cache-server-config.sh"
fi

docker run \
--ulimit memlock=-1:-1 \
--cap-add SYS_ADMIN --device /dev/fuse \
Expand All @@ -26,6 +31,7 @@ docker run \
--env CI_JOB_NAME \
--volume "${HOME}/ci_conan_hosts:/etc/hosts:ro" \
--volume "${PROJECT_DIR}:${PROJECT_DIR}" \
${VOLUMES} \
--workdir "${PROJECT_DIR}" \
${USER_IMAGE} \
"${BUILD_COMMAND:-${SCRIPT_DIR}/ci-job.sh}"
5 changes: 5 additions & 0 deletions scripts/ci-job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ cor conan config install --type git https://gitlab.com/batteriesincluded/conan-c

# Enable the local cache server.
#
if [ -f "/conan-local-cache-server-config.sh" ]; then
set +x
source "/conan-local-cache-server-config.sh"
set -x
fi
"${SCRIPT_DIR}/ci-print-diagnostics.sh" "ci-job.sh"
if [ "${CACHE_CONAN_REMOTE:-}" != "" ]; then
cor conan remote enable "${CACHE_CONAN_REMOTE}"
Expand Down
15 changes: 13 additions & 2 deletions src/llfs/storage_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@
#include <llfs/config.hpp>
//

#ifndef LLFS_DISABLE_IO_URING
#include <batteries/shared_ptr.hpp>

#ifdef LLFS_DISABLE_IO_URING

namespace llfs {

class StorageContext : public batt::RefCounted<StorageContext>
{
};

} // namespace llfs

#else // !LLFS_DISABLE_IO_URING

#include <llfs/ioring.hpp>
#include <llfs/log_device_runtime_options.hpp>
Expand All @@ -27,7 +39,6 @@
#include <llfs/storage_object_info.hpp>

#include <batteries/async/task_scheduler.hpp>
#include <batteries/shared_ptr.hpp>

#include <boost/functional/hash.hpp>

Expand Down