Skip to content

Commit

Permalink
Merge branch 'revert-255' into 258-ci-docker-image
Browse files Browse the repository at this point in the history
Test merge to ensure the two branches together are good.
  • Loading branch information
JonathonReinhart committed Aug 6, 2023
2 parents 98e1a45 + d1476ae commit eb62f9e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 45 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
os:
- version: "ubuntu-20.04"
native-python: "3.8"
- version: "ubuntu-22.04"
native-python: "3.10"
python-version:
- "3.7"
- "3.8"
Expand Down
12 changes: 0 additions & 12 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ conf = base_env.Configure(custom_tests=custom_tests)
# Does our default libc have NSS?
conf.env["HAS_NSS"] = conf.CheckNSS()

# Starting in GLIBC 2.34, some NSS modules (files, dns) can be built-in to
# libc.so. Determine which ones are builtin. See #245.
conf.env["NSS_MODS_BUILTIN"] = []
if conf.env["HAS_NSS"]:
maybe_builtin_nss_modules = ["files", "dns"]
for mod in maybe_builtin_nss_modules:
libname = "libnss_" + mod
# It the library doesn't exist, assume it is built-in.
if not conf.BasicCheckLib(libname):
conf.env.Append(NSS_MODS_BUILTIN=libname)
print("Builtin NSS modules:", conf.env["NSS_MODS_BUILTIN"])

base_env = conf.Finish()

################################################################################
Expand Down
17 changes: 6 additions & 11 deletions libnssfix/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ env.NsswitchConfH(
source = nsswitch_conf,
)


# Link against the configured NSS module libraries.
# These aren't needed directly for the library itself, but this ensures
# that they will be available for nss at runtime (via dlopen), and
# allows their paths to be easily discovered via ldd(1).
nss_libs = set(env.GetNsswitchLibs(nsswitch_conf))

# Exclude those already built-in to glibc.
nss_libs -= set(env["NSS_MODS_BUILTIN"])

# Build libnssfix.so
libnssfix = env.SharedLibrary(
target = 'nssfix',
Expand Down Expand Up @@ -60,7 +50,12 @@ libnssfix = env.SharedLibrary(
],
LIBS = [
libc_stub,
] + list(nss_libs),

# These aren't needed directly for the library itself, but this ensures
# that they will be available for nss at runtime (via dlopen), and
# allows their paths to be easily discovered via ldd(1).
env.GetNsswitchLibs(nsswitch_conf),
],
)

Return('libnssfix')
20 changes: 0 additions & 20 deletions site_scons/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,6 @@ def CheckNSS(context):
return ok


def BasicCheckLib(context, libname):
"""Check for a C library.
Similar to built-in CheckLib but works around
https://github.com/SCons/scons/issues/4373.
"""
context.Message("Checking for library %s... " % libname)

oldLIBS = context.AppendLIBS([libname])
ok = context.TryLink(
"int main(void) { return 0; }",
".c"
)
context.SetLIBS(oldLIBS)

context.Result(ok)
return ok


custom_tests = dict(
CheckNSS = CheckNSS,
BasicCheckLib = BasicCheckLib,
)

0 comments on commit eb62f9e

Please sign in to comment.