-
Notifications
You must be signed in to change notification settings - Fork 86
libacl import options to address -fPIC and other similar issue #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,18 +160,20 @@ llvm.toolchain( | |
| use_repo(llvm, "llvm_toolchain") | ||
|
|
||
| deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb") | ||
| archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive") | ||
|
|
||
| deb( | ||
| name = "acl-deb", | ||
| build = "//third_party/acl:acl.BUILD", | ||
| urls = ["https://archive.ubuntu.com/ubuntu/pool/main/a/acl/libacl1-dev_2.3.1-1_amd64.deb"], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| deb( | ||
| name = "acl-deb-aarch64", | ||
| # acl is vendored from upstream source instead of a prebuilt, arch-pinned Ubuntu .deb | ||
| # (see third_party/acl/acl.BUILD and score/os/BUILD's `:acl` target) to avoid the | ||
| # recurring -fPIC/arch breakage tracked by SWP-278650 (eclipse-score/baselibs#172, #496, #78). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid mentioning any internal tickets in code.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was trying it but, it got missed somehow |
||
| archive( | ||
| name = "acl-src", | ||
| build = "//third_party/acl:acl.BUILD", | ||
| urls = ["https://ports.ubuntu.com/ubuntu-ports/pool/main/a/acl/libacl1-dev_2.3.1-1_arm64.deb"], | ||
| integrity = "sha256-5mETFFbScIoBxhSg9ADhHX0b+utvPnS3W7mAty8BYaM=", | ||
| strip_prefix = "acl-2.4.0", | ||
| urls = [ | ||
| "https://download.savannah.nongnu.org/releases/acl/acl-2.4.0.tar.xz", | ||
| "http://download-mirror.savannah.nongnu.org/releases/acl/acl-2.4.0.tar.xz", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,3 +54,16 @@ The license text can be found in licenses/llvm-libcxx.txt. | |
| //===----------------------------------------------------------------------===// | ||
|
|
||
| [1] https://github.com/llvm/llvm-project/tree/main/libcxx | ||
|
|
||
| ## acl | ||
|
|
||
| third_party/acl vendors the plain POSIX ACL portion of libacl's source (excluding | ||
| acl_delete_def_file_at and perm_copy_fd/perm_copy_file) from acl 2.4.0 [2], | ||
| compiled directly as a score_baselibs cc_library instead of installing a prebuilt, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mentioning ubuntu deb packages looks wrong here |
||
| architecture-pinned Ubuntu .deb package (see SWP-278650 and | ||
| https://github.com/eclipse-score/baselibs/issues/172, /issues/496, /issues/78). | ||
|
|
||
| libacl is provided under the GNU Lesser General Public License v2.1 (or later). | ||
| The license text can be found in licenses/acl-lgpl.txt. | ||
|
|
||
| [2] https://download.savannah.nongnu.org/releases/acl/acl-2.4.0.tar.xz | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,57 @@ | |
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") | ||
| load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
|
||
| # Bazel-native equivalent of upstream acl's `./configure --enable-nls`: gates | ||
| # whether include/misc.h's `_()` macro (see @acl-src//:acl) routes through gettext(). | ||
| bool_flag( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this flag needed? Do we really want to give a user a way to control it? |
||
| name = "enable_nls", | ||
| build_setting_default = False, | ||
| ) | ||
|
|
||
| config_setting( | ||
| name = "nls_enabled", | ||
| flag_values = {":enable_nls": "True"}, | ||
| visibility = ["@acl-src//:__pkg__"], | ||
| ) | ||
|
|
||
| # Hand-written stand-in for acl's autoconf-generated include/config.h, consumed by | ||
| # @acl-src (see MODULE.bazel and acl.BUILD) which vendors libacl from source. | ||
| cc_library( | ||
| name = "config_h", | ||
| hdrs = ["config.h"], | ||
| defines = select({ | ||
| ":nls_enabled": ["ENABLE_NLS=1"], | ||
| "//conditions:default": [], | ||
| }), | ||
| includes = ["."], | ||
| visibility = ["@acl-src//:__pkg__"], | ||
| ) | ||
|
|
||
| # Exposed as plain files (rather than only via the cc_library above) so | ||
| # @acl-src//:config_drift_test (see acl.BUILD) can read config.h as test data and | ||
| # run check_config_drift.py without needing a C++ toolchain. | ||
| exports_files( | ||
| [ | ||
| "config.h", | ||
| "check_config_drift.py", | ||
| ], | ||
| visibility = ["@acl-src//:__pkg__"], | ||
| ) | ||
|
|
||
| # Static linking is not exposed to general consumers; score/os:acl is the only | ||
| # target that needs the static compile-time interface, everyone else must use | ||
| # :acl_shared (paired with dynamic_deps) instead. | ||
| alias( | ||
| name = "acl", | ||
| actual = select({ | ||
| "@platforms//cpu:aarch64": "@acl-deb-aarch64//:acl", | ||
| "//conditions:default": "@acl-deb//:acl", | ||
| }), | ||
| actual = "@acl-src//:acl", | ||
| visibility = ["@score_baselibs//score/os:__pkg__"], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two aliases looks wrong. My expectation nobody is linking to the static lib other then for purposes of constructing a shared library. I.e. score/os users should link to the shared lib only |
||
| ) | ||
|
|
||
| alias( | ||
| name = "acl_shared", | ||
| actual = "@acl-src//:acl_shared", | ||
| visibility = ["//:__subpackages__"], | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| # Single source of truth for which acl-2.4.0 files are vendored, shared between | ||
| # acl.BUILD (the `:acl` cc_library) and BUILD's `:config_drift_test` (which checks | ||
| # that config.h still covers every autoconf-style macro these files reference). | ||
|
|
||
| ACL_SRCS = [ | ||
| # POSIX_CFILES (Makemodule.am). | ||
| "libacl/acl_add_perm.c", | ||
| "libacl/acl_calc_mask.c", | ||
| "libacl/acl_clear_perms.c", | ||
| "libacl/acl_copy_entry.c", | ||
| "libacl/acl_copy_ext.c", | ||
| "libacl/acl_copy_int.c", | ||
| "libacl/acl_create_entry.c", | ||
| "libacl/acl_delete_def_file.c", | ||
| "libacl/acl_delete_entry.c", | ||
| "libacl/acl_delete_perm.c", | ||
| "libacl/acl_dup.c", | ||
| "libacl/acl_free.c", | ||
| "libacl/acl_from_text.c", | ||
| "libacl/acl_get_entry.c", | ||
| "libacl/acl_get_fd.c", | ||
| "libacl/acl_get_file.c", | ||
| "libacl/acl_get_file_at.c", | ||
| "libacl/acl_get_perm.c", | ||
| "libacl/acl_get_permset.c", | ||
| "libacl/acl_get_qualifier.c", | ||
| "libacl/acl_get_tag_type.c", | ||
| "libacl/acl_init.c", | ||
| "libacl/acl_set_fd.c", | ||
| "libacl/acl_set_file.c", | ||
| "libacl/acl_set_file_at.c", | ||
| "libacl/acl_set_permset.c", | ||
| "libacl/acl_set_qualifier.c", | ||
| "libacl/acl_set_tag_type.c", | ||
| "libacl/acl_size.c", | ||
| "libacl/acl_to_text.c", | ||
| "libacl/acl_valid.c", | ||
| # LIBACL_CFILES. | ||
| "libacl/acl_check.c", | ||
| "libacl/acl_cmp.c", | ||
| "libacl/acl_entries.c", | ||
| "libacl/acl_equiv_mode.c", | ||
| "libacl/acl_error.c", | ||
| "libacl/acl_extended_fd.c", | ||
| "libacl/acl_extended_file.c", | ||
| "libacl/acl_extended_file_at.c", | ||
| "libacl/acl_extended_file_nofollow.c", | ||
| "libacl/acl_from_mode.c", | ||
| "libacl/acl_to_any_text.c", | ||
| # INTERNAL_CFILES. | ||
| "libacl/__acl_apply_mask_to_mode.c", | ||
| "libacl/__acl_from_xattr.c", | ||
| "libacl/__acl_reorder_obj_p.c", | ||
| "libacl/__acl_to_any_text.c", | ||
| "libacl/__acl_to_xattr.c", | ||
| "libacl/__libobj.c", | ||
| # libmisc compat shims needed by the "_at" files above (this toolchain's glibc | ||
| # doesn't provide getxattrat()/setxattrat(), so config.h leaves HAVE_GETXATTRAT/ | ||
| # HAVE_SETXATTRAT undefined and xattrat_compat.h maps them to these instead). | ||
| # xattrat.c provides the raw syscall-based getxattrat()/setxattrat() that the | ||
| # *_compat.c shims try first, falling back to proc-self-fd-based emulation | ||
| # (via ENOSYS) on kernels that predate the getxattrat/setxattrat syscalls. | ||
| "libmisc/xattrat.c", | ||
| "libmisc/getxattrat_compat.c", | ||
| "libmisc/setxattrat_compat.c", | ||
| "libmisc/proc-self-fd.c", | ||
| # Helpers used by acl_from_text.c/acl_to_any_text.c (quoting/unquoting of | ||
| # non-printable user and group names) and acl_get_qualifier.c (uid/gid lookup). | ||
| "libmisc/quote.c", | ||
| "libmisc/unquote.c", | ||
| "libmisc/uid_gid_lookup.c", | ||
| "libmisc/high_water_alloc.c", | ||
| ] | ||
|
|
||
| ACL_HDRS = [ | ||
| # HFILES (Makemodule.am): private headers shared between the .c files above. | ||
| "libacl/libobj.h", | ||
| "libacl/libacl.h", | ||
| "libacl/byteorder.h", | ||
| "libacl/__acl_from_xattr.h", | ||
| "libacl/__acl_to_xattr.h", | ||
| # Internal (noinst) headers pulled in by the .c files above. | ||
| "include/acl_ea.h", | ||
| "include/misc.h", | ||
| "include/visibility-hidden.h", | ||
| "include/xattrat.h", | ||
| "include/xattrat_compat.h", | ||
| "libmisc/proc-self-fd.h", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should find another way to solve this as acl is non-dev-dependency. @nradakovic, any options here other that creating a yet another transition?