Skip to content

[bug] Hard coded environment variables #430

@AntoinePrv

Description

@AntoinePrv

Looking at a kernel.json from a Conda-forge install, I see the following.

"env": {
    "PATH":"/Users/runner/miniforge3/conda-bld/bld/rattler-build_xeus-cpp_1760716326/build_env/bin:/Users/antoine/workspace/github.com/apache/arrow/.pixi/envs/jupyter/bin:/Users/runner/miniforge3/bin:/Users/runner/miniforge3/condabin:/usr/local/lib/ruby/gems/3.3.0/bin:/usr/local/opt/ruby@3.3/bin::/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools",
    "LD_LIBRARY_PATH":""
}

The first is an artifact of the build system, which is useless for the user, and the second is just empty.
When using the kernel, I see the same value and my own values of PATH and LD_LIBRARY_PATH are ignored.
A direct impact of this is that dynamic libraries must be linked with an absolute path, which is not very portable.

In fact this is working as designed given the placeholder:

"LD_LIBRARY_PATH":"@XEUS_CPP_LD_LIBRARY_PATH@"

And the default values.

set(XEUS_CPP_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}")

Personally I don't see the point of setting these values from what is available at build time. I would simply remove it and let the runtime values apply by default. If the feature is still needed (maybe for conda), I think it should default in CMake to ${LD_LIBRARY_PATH} (instead of $Env), so that it is resolved at runtime and set to ${PREFIX}/lib:\${LD_LIBRARY_PATH}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions