Skip to content
Closed
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
10 changes: 10 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Release Notes

## apm_release_v1.0

- **Branched from tag:** `v0.2.7`
- **Source tag commit:** `cab36dd7de92c282f67e78e88032e08585803528`
- **Marker commit:** `5ec3af12a830d611b25b9720e13f68253d4c7478`
- **Created on:** 2026-07-13

This branch was created directly from the `v0.2.7` tag to track the `apm_release_v1.0` release line. The marker commit above is an empty commit at the branch root recording this origin; use `git log <marker-commit>` or `git describe --tags <marker-commit>^` to trace it back to the source tag.
1 change: 1 addition & 0 deletions score/memory/shared/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ cc_library(
"@boost.interprocess",
],
"@platforms//os:qnx": [],
"//conditions:default": [],
}),
)

Expand Down
4 changes: 2 additions & 2 deletions score/memory/shared/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "score/memory/shared/polymorphic_offset_ptr_allocator.h"

#if defined(__linux__)
#if defined(__linux__) && !defined(__ANDROID__)
#include <boost/container/scoped_allocator.hpp>
#include <boost/interprocess/containers/map.hpp>
#endif // __linux__
Expand All @@ -36,7 +36,7 @@ namespace score::memory::shared
// file. This keeps both implementations close (i.e. within the same functions) which makes the code easier to read and
// maintain. It also prevents compiler errors in linux code when compiling for QNX and vice versa.
// coverity[autosar_cpp14_a16_0_1_violation]
#if defined(__linux__)
#if defined(__linux__) && !defined(__ANDROID__)
template <typename K, typename V, typename Comp = std::less<K>>
using Map =
boost::interprocess::map<K,
Expand Down
25 changes: 16 additions & 9 deletions score/os/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ cc_library(
deps = [
":errno",
":object_seam",
] + select(
{
"@platforms//os:linux": [
"//third_party/acl",
],
] + select({
"@platforms//os:android": ["//third_party/acl"],
"@platforms//os:linux": ["//third_party/acl"],
"//conditions:default": [],
},
),
}),
)

cc_library(
Expand Down Expand Up @@ -641,7 +638,12 @@ cc_library(
":rt",
":static_destruction_guard",
"@score_baselibs//score/bitmanipulation:bitmask_operators",
],
] + select({
# Android bionic does not provide shm_open/shm_unlink.
# Use our file-based implementation backed by /dev/shm (tmpfs).
"@platforms//os:android": ["//third_party/shm_android"],
"//conditions:default": [],
}),
)

cc_library(
Expand Down Expand Up @@ -711,7 +713,12 @@ cc_library(
"pthread.h",
],
features = COMPILER_WARNING_FEATURES,
linkopts = ["-lpthread"],
# On Android bionic, pthread is part of libc � no separate libpthread.so.
# On Linux (glibc), -lpthread is needed.
linkopts = select({
"@platforms//os:android": [],
"//conditions:default": ["-lpthread"],
}),
target_compatible_with = select({
"@platforms//os:qnx": ["@platforms//:incompatible"],
"//conditions:default": [],
Expand Down
23 changes: 21 additions & 2 deletions third_party/acl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,31 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@bazel_skylib//lib:selects.bzl", "selects")

cc_library(
name = "libacl",
linkopts = [
"-lacl",
],
target_compatible_with = ["@platforms//os:linux", "@platforms//cpu:aarch64"],
visibility = ["//visibility:public"],
)

selects.config_setting_group(
name = "linux_aarch64",
match_all = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
)

alias(
name = "acl",
actual = select({
"@platforms//cpu:aarch64": "@acl-deb-aarch64//:acl",
"@platforms//os:android": "//third_party/acl/android:acl_android",
":linux_aarch64": ":libacl",
"//conditions:default": "@acl-deb//:acl",
}),
visibility = ["//:__subpackages__"],
visibility = ["//visibility:public"],
)
26 changes: 26 additions & 0 deletions third_party/acl/android/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Android no-op ACL stub library.
# Provides sys/acl.h + acl/libacl.h headers and a C stub implementation
# so that score/os/acl_impl.cpp compiles and links on Android without
# modification. All functions are no-ops — Android tmpfs has no xattr support.

cc_library(
name = "acl_android",
srcs = ["src/acl_stub.c"],
hdrs = [
"include/sys/acl.h",
"include/acl/libacl.h",
],
includes = ["include"],
target_compatible_with = [
"@platforms//os:android",
"@platforms//cpu:aarch64",
],
visibility = ["//visibility:public"],
)

# Keep acl_headers as an alias for backwards compatibility
alias(
name = "acl_headers",
actual = ":acl_android",
visibility = ["//visibility:public"],
)
33 changes: 33 additions & 0 deletions third_party/acl/android/include/acl/libacl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* SPDX-License-Identifier: LGPL-2.1+
* Android implementation of libacl extensions (acl/libacl.h)
*/
#ifndef _ACL_LIBACL_H
#define _ACL_LIBACL_H

#include <sys/acl.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Check if a specific permission is set in a permission set.
* Returns 1 if the permission is set, 0 if not, -1 on error. */
int acl_get_perm(acl_permset_t permset, acl_perm_t perm);

/* Check if a file has an extended ACL (beyond the minimal mode bits).
* Returns 1 if extended ACL exists, 0 if not, -1 on error. */
int acl_extended_fd(int fd);
int acl_extended_file(const char *path_p);
int acl_extended_file_nofollow(const char *path_p);

/* Convert mode bits to a minimal ACL */
acl_t acl_from_mode(mode_t mode);

/* Convert ACL to equivalent mode bits */
int acl_equiv_mode(acl_t acl, mode_t *mode_p);

#ifdef __cplusplus
}
#endif

#endif /* _ACL_LIBACL_H */
113 changes: 113 additions & 0 deletions third_party/acl/android/include/sys/acl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/* SPDX-License-Identifier: LGPL-2.1+
* Android implementation of POSIX ACL (sys/acl.h)
* Uses kernel xattr syscalls (getxattr/setxattr) which are available
* on Android bionic. The kernel supports POSIX ACL via the
* "system.posix_acl_access" and "system.posix_acl_default" xattrs.
*/
#ifndef _SYS_ACL_H
#define _SYS_ACL_H

#include <sys/types.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/* -----------------------------------------------------------------------
* Opaque ACL types (POSIX.1e draft 17)
* ----------------------------------------------------------------------- */
typedef struct __acl_t_struct *acl_t;
typedef struct __acl_entry_t_struct *acl_entry_t;
typedef struct __acl_permset_t_struct *acl_permset_t;
typedef uint32_t acl_perm_t;
typedef int acl_type_t;
typedef int acl_tag_t;

/* -----------------------------------------------------------------------
* ACL entry iteration constants
* ----------------------------------------------------------------------- */
#define ACL_FIRST_ENTRY 0
#define ACL_NEXT_ENTRY 1

/* -----------------------------------------------------------------------
* ACL tag types
* ----------------------------------------------------------------------- */
#define ACL_UNDEFINED_TAG (0x00)
#define ACL_USER_OBJ (0x01)
#define ACL_USER (0x02)
#define ACL_GROUP_OBJ (0x04)
#define ACL_GROUP (0x08)
#define ACL_MASK (0x10)
#define ACL_OTHER (0x20)

/* -----------------------------------------------------------------------
* ACL permission bits
* ----------------------------------------------------------------------- */
#define ACL_READ (0x04)
#define ACL_WRITE (0x02)
#define ACL_EXECUTE (0x01)

/* -----------------------------------------------------------------------
* ACL types (access vs default)
* ----------------------------------------------------------------------- */
#define ACL_TYPE_ACCESS (0x8000)
#define ACL_TYPE_DEFAULT (0x4000)

/* -----------------------------------------------------------------------
* POSIX ACL API
* ----------------------------------------------------------------------- */

/* Allocation / deallocation */
acl_t acl_init(int count);
acl_t acl_dup(acl_t acl);
int acl_free(void *obj_p);
acl_t acl_from_mode(mode_t mode);

/* Get / set ACL from file descriptor or path */
acl_t acl_get_fd(int fd);
acl_t acl_get_file(const char *path_p, acl_type_t type);
int acl_set_fd(int fd, acl_t acl);
int acl_set_file(const char *path_p, acl_type_t type, acl_t acl);

/* Entry manipulation */
int acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p);
int acl_delete_entry(acl_t acl, acl_entry_t entry);
int acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p);
int acl_copy_entry(acl_entry_t dest, acl_entry_t src);

/* Tag type */
int acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p);
int acl_set_tag_type(acl_entry_t entry_d, acl_tag_t tag_type);

/* Qualifier (uid/gid) */
void *acl_get_qualifier(acl_entry_t entry_d);
int acl_set_qualifier(acl_entry_t entry_d, const void *tag_qualifier_p);

/* Permission set */
int acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p);
int acl_set_permset(acl_entry_t entry_d, acl_permset_t permset);
int acl_clear_perms(acl_permset_t permset);
int acl_add_perm(acl_permset_t permset, acl_perm_t perm);
int acl_delete_perm(acl_permset_t permset, acl_perm_t perm);

/* Validation and mask */
int acl_calc_mask(acl_t *acl_p);
int acl_valid(acl_t acl);

/* Text conversion */
acl_t acl_from_text(const char *buf_p);
char *acl_to_text(acl_t acl, ssize_t *len_p);

/* Size */
ssize_t acl_size(acl_t acl);

/* Copy to/from external representation */
acl_t acl_copy_int(const void *buf_p);
ssize_t acl_copy_ext(void *buf_p, acl_t acl, ssize_t size);

#ifdef __cplusplus
}
#endif

#endif /* _SYS_ACL_H */
Loading