Skip to content

feat(extension): support LOAD by filesystem path for out-of-tree builds #746

Description

@liulx20

Summary

Allow LOAD to accept an absolute or relative path to a .neug_extension binary, in addition to the current name-based lookup under $NEUG_EXTENSION_HOME_PYENV/extension/<name>/.

This unblocks the common out-of-tree workflow:

  1. NeuG as a git submodule (or sibling) to compile the extension via NEUG_EXTENSION_CONFIGS / neug_extension_load (see feat: support out-of-tree extensions via NEUG_EXTENSION_CONFIGS #745)
  2. Runtime uses pip install neug (or another NeuG build)
  3. Load the locally built artifact from Python without copying it into site-packages

Motivation

Today load_extension always treats the argument as an extension name and resolves:

$NEUG_EXTENSION_HOME_PYENV/extension/<name>/lib<name>.neug_extension

import neug also overwrites NEUG_EXTENSION_HOME_PYENV to the wheel/site-packages tree. So a separately built out-of-tree artifact is not found unless the user:

  • copies/symlinks into the pip extension directory, or
  • overrides NEUG_EXTENSION_HOME_PYENV after import to point at the extension build root

Both work, but are awkward for local development. Path-based LOAD is the natural fix.

Proposed usage

LOAD '/abs/path/to/build/release/extension/wiggle/libwiggle.neug_extension';
LOAD 'build/release/extension/wiggle/libwiggle.neug_extension';

Name-based LOAD wiggle stays unchanged for installed / CI-packaged extensions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions