Skip to content

Conversation

@dcharkes
Copy link
Collaborator

Closes: #2724

cc @simolus3

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

PR Health

License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

@coveralls
Copy link

coveralls commented Oct 31, 2025

Coverage Status

coverage: 82.383%. remained the same
when pulling 62ff7f8 on doc-code-assets-linking
into 62e7c9b on main.

Copy link
Contributor

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting this 👍

Comment on lines 23 to 29
Create a wrapper library that statically links the conflicting library (e.g.,
SQLite) and re-exposes its symbols with a unique prefix. This avoids name
collisions with the library loaded by the embedder.

If your library allows the end-user to pass a dynamic library with user defines
or use the system library, then the wrapper can be designed to to dynamically
link against that library while still re-exposing the symbols with a prefix.
Copy link
Contributor

@simolus3 simolus3 Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my two cents: This isn't trivial to get right. Because if I do say

int my_package_sqlite3_open_v2(
  const char *filename,
  sqlite3 **ppDb,
  int flags,
  const char *zVfs
) {
  return sqlite3_open_v2(filename, ppDb, flags, zVfs);
}

and use the default options from native_toolchain_c to link that and sqlite3.c into a shared library, my understanding is that sqlite3_open_v2 from the previously loaded library takes precedence over the sqlite3_open_v2 defined in the my wrapper library.

I think if I compile sqlite3.c with -fvisibility=hidden this could work, but then it's essentially the same thing as approach 2 with extra steps.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this only works with the option to use the system library for space savings,
not with a custom library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building hooks that may conflict with embedder library dependencies

5 participants