Skip to content

Package plugin releases as flat shared libraries - #12

Merged
michalkomorsdn merged 7 commits into
mainfrom
cursor/package-shared-libs-only-4bf9
Oct 7, 2026
Merged

michalkomorsdn merged 7 commits into
mainfrom
cursor/package-shared-libs-only-4bf9

Conversation

@michalkomorsdn

@michalkomorsdn michalkomorsdn commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Release archives stay flat shared libraries, installed by graftcode_install_plugin (RUNTIME_DEPENDENCY_SET). There is no Python packager.

Third-party libraries are linked into the plugin wherever that is safe:

  • Windows. cmake/StaticPluginRuntime.cmake sets the MSVC CRT to /MT (Debug /MTd) before project(), so FetchContent dependencies use the same runtime. It also selects the static vcpkg triplet (x64-windows-static, arm64-windows-static, or x86-windows-static) unless one is already set. curl, OpenSSL, the AWS SDK, and Azure AMQP are then static /MT libraries. ucrtbase.dll and Win32 system libraries stay on the host. Users do not need the VC++ Redistributable.
  • Linux and macOS. vcpkg triplets for Pub/Sub, SQS, and Service Bus are already static, so curl, OpenSSL, the AWS SDK, and Azure AMQP are inside the plugin. RabbitMQ links static AMQP-CPP (header-only JSON, TCP/OpenSSL module off). glibc, libstdc++, libc++, and libSystem stay on the host.
  • Kafka. librdkafka is static, with its bundled LZ4 and Snappy. zlib v1.3.1 and zstd v1.5.6 are FetchContent static libraries built with position-independent code. OpenSSL is static: PIC libssl.a / libcrypto.a on Linux and macOS, and the vcpkg static triplet on Windows. librdkafka's libcurl OIDC helper is off.

Shared library that remains, and why:

  • Linux libsasl2.so.2 loads Cyrus SASL mechanism modules at runtime. A static libsasl2.a would still need those modules from the host. On the Ubuntu 22.04 release runners that library did not import libcrypto, so it is not in those archives. If the build machine's libsasl2 does import libcrypto.so.3, the package step copies that file too. The plugin's own TLS uses static OpenSSL.

macOS Kafka packaging is fixed. An install() override had split install(CODE) on semicolons and wrote a cmake_install.cmake that did not parse. librdkafka's install(EXPORT) is removed in the fetched sources instead.

The root README and each plugin Readme describe that packaging for client distros. The root README includes a gateway --config example for every plugin, taken from the plugin Readmes and samples. The Pub/Sub client GraftConfig JSON is inlined from samples/pubsub/graftConfig.pubsub.example.json.

Shared Plugin Release for 795ae84 is green (30 build jobs). Each archive contains:

Plugin Linux x64 / arm64 macOS arm64 (macos-14) / x64 (macos-26-intel) Windows x64 / arm64
rabbitmq libRabbitmqPlugin.so libRabbitmqPlugin.dylib RabbitmqPlugin.dll
kafka libKafkaPlugin.so, libsasl2.so.2, libsasl2.so.2.0.25 libKafkaPlugin.dylib KafkaPlugin.dll
pubsub libPubSubPlugin.so libPubSubPlugin.dylib PubSubPlugin.dll
sqs libSqsPlugin.so libSqsPlugin.dylib SqsPlugin.dll
servicebus libServiceBusPlugin.so libServiceBusPlugin.dylib ServiceBusPlugin.dll

What to copy

The plugin library. On Linux Kafka, also copy libsasl2.so.2 and libsasl2.so.2.0.25 from the same archive. No VC++ Redistributable on Windows.

Open in Web Open in Cursor 

cursoragent and others added 7 commits October 7, 2026 06:26
The release tar step was publishing the whole CMake target directory, so Windows artifacts included project files, object files, and import libraries. Stage only runtime shared libraries, and add a vcpkg DLL only when a staged binary imports it.

Co-authored-by: Michał Komor <michalkomorsdn@users.noreply.github.com>
Stage each plugin with install(RUNTIME_DEPENDENCY_SET) and tar the
plugin-runtime component so the archive is a flat set of shared
libraries without CMake or import-library files.

Co-authored-by: Michał Komor <michalkomorsdn@users.noreply.github.com>
Search OpenSSL and vcpkg for shared libraries the plugin imports, and stop
dropping Homebrew and /usr copies of those libraries. Keep the C/C++ runtime
on the host, and point bundled ELF and Mach-O dependencies at the flat directory.

Co-authored-by: Michał Komor <michalkomorsdn@users.noreply.github.com>
Set /MT before project() so FetchContent dependencies use the same CRT, and
select the Windows static vcpkg triplet so curl, the AWS SDK, Azure AMQP,
and Kafka's OpenSSL match it. Unix Kafka links PIC OpenSSL statically and
keeps zlib, zstd, and Cyrus SASL shared.

Co-authored-by: Michał Komor <michalkomorsdn@users.noreply.github.com>
Distro libz.a and libzstd.a are not position-independent, so Linux packages were shipping those shared libraries. FetchContent now builds both into the plugin. libsasl2, and the libcrypto it imports, stay shared because Cyrus SASL loads mechanism modules at runtime.

Co-authored-by: Michał Komor <michalkomorsdn@users.noreply.github.com>
The install() override split bracket arguments on semicolons, so the generated cmake_install.cmake no longer parsed. librdkafka's export is removed in the fetched sources instead.

Co-authored-by: Michał Komor <michalkomorsdn@users.noreply.github.com>
Client READMEs now state that each archive is the plugin library, with /MT on Windows and static third-party libraries elsewhere. Linux Kafka still ships libsasl2. Each plugin's gateway JSON is in the root README, and the Pub/Sub client config is inlined from the sample.

Co-authored-by: Michał Komor <michalkomorsdn@users.noreply.github.com>
@michalkomorsdn
michalkomorsdn merged commit 25968ec into main Oct 7, 2026
30 checks passed
@michalkomorsdn
michalkomorsdn deleted the cursor/package-shared-libs-only-4bf9 branch October 7, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants