Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

wlib.modules.makeWrapper

modules/makeWrapper

This module is made possible by: birdee

An implementation of the makeWrapper interface via type safe module options.

Allows you to choose one of several underlying implementations of the makeWrapper interface.

Imported by wlib.modules.default

Wherever the type includes DAG you can mentally substitute this with attrsOf

Wherever the type includes DAL or DAG list you can mentally substitute this with listOf

However they also take items of the form { data, name ? null, before ? [], after ? [] }

This allows you to specify that values are added to the wrapper before or after another value.

The sorting occurs across ALL the options, thus you can target items in any DAG or DAL within this module from any other DAG or DAL option within this module.

The DAG/DAL entries in this module also accept an extra field, esc-fn ? null

If defined, it will be used instead of the value of options.escapingFunction to escape that value.

It also has a set of submodule options under config.wrapperVariants which allow you to duplicate the effects to other binaries from the package, or add extra ones.

Each one contains an enable option, and a mirror option.

They also contain the same options the top level module does, however if mirror is true, as it is by default, then they will inherit the defaults from the top level as well.

They also have their own package, exePath, and binName options, with sensible defaults.


addFlag

Wrapper for

–add-flag ARG

Prepend the single argument ARG to the invocation of the executable, before any command-line arguments.

This option takes a list. To group them more strongly, option may take a list of lists as well.

Any entry can instead be of type { data, name ? null, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG.

If no name is provided, it cannot be targeted.

Type: list of spec with main field: data of (str|path|drv or list of str|path|drv)

Default:

[ ]

Example:

[
  "-v"
  "-f"
  [
    "--config"
    ./storePath.cfg
  ]
  [
    "-s"
    "idk"
  ]
]

Declared by:

addFlag.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

appendFlag

–append-flag ARG

Append the single argument ARG to the invocation of the executable, after any command-line arguments.

This option takes a list. To group them more strongly, option may take a list of lists as well.

Any entry can instead be of type { data, name ? null, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG.

If no name is provided, it cannot be targeted.

Type: list of spec with main field: data of (str|path|drv or list of str|path|drv)

Default:

[ ]

Example:

[
  "-v"
  "-f"
  [
    "--config"
    ./storePath.cfg
  ]
  [
    "-s"
    "idk"
  ]
]

Declared by:

appendFlag.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

argv0

–argv0 NAME

Set the name of the executed process to NAME. If unset or null, defaults to EXECUTABLE.

overrides the setting from argv0type if set.

Type: null or string

Default:

null

Declared by:

argv0type

argv0 overrides this option if not null or unset

Both shell and the nix implementations ignore this option, as the shell always resolves $0

However, the binary implementation will use this option

Values:

  • "inherit":

The executable inherits argv0 from the wrapper. Use instead of --argv0 '$0'.

  • "resolve":

If argv0 does not include a “/” character, resolve it against PATH.

  • Function form: str -> str

This one works only in the nix implementation. The others will treat it as inherit

Rather than calling exec, you get the command plus all its flags supplied, and you can choose how to run it.

e.g. command_string: "eval \"$(${command_string})\";

It will also be added to the end of the overall DAL, with the name NIX_RUN_MAIN_PACKAGE

Thus, you can make things run after it, but by default it is still last.

Type: one of “resolve”, “inherit” or function that evaluates to a(n) string

Default:

"inherit"

Declared by:

chdir

–chdir DIR

Change working directory before running the executable. Use instead of --run "cd DIR".

Type: list of spec with main field: data of str|path|drv

Default:

[ ]

Declared by:

chdir.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

env

Environment variables to set in the wrapper.

This option takes a set.

Any entry can instead be of type { data, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG, which will cause the resulting wrapper argument to be sorted accordingly

Type: attribute set of spec with main field: data of str|path|drv

Default:

{ }

Example:

{
  XDG_DATA_HOME = "/somewhere/on/your/machine";
}

Declared by:

env.<name>.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

envDefault

Environment variables to set in the wrapper.

Like env, but only adds the variable if not already set in the environment.

This option takes a set.

Any entry can instead be of type { data, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG, which will cause the resulting wrapper argument to be sorted accordingly

Type: attribute set of spec with main field: data of str|path|drv

Default:

{ }

Example:

{
  XDG_DATA_HOME = "/only/if/not/set";
}

Declared by:

envDefault.<name>.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

escapingFunction

The function to use to escape shell values

Caution: When using shell or binary implementations, these will be expanded at BUILD time.

You should probably leave this as is when using either of those implementations.

However, when using the nix implementation, they will expand at runtime! Which means wlib.escapeShellArgWithEnv may prove to be a useful substitute!

Type: function that evaluates to a(n) string

Default:

lib.escapeShellArg

Declared by:

extraPackages

Additional packages to add to the wrapper’s runtime PATH. This is useful if the wrapped program needs additional libraries or tools to function correctly.

Adds all its entries to the DAG under the name NIX_PATH_ADDITIONS

Type: list of package

Default:

[ ]

Declared by:

flagSeparator

Separator between flag names and values when generating args from flags. " " for --flag value or "=" for --flag=value

Type: string

Default:

" "

Declared by:

flags

Flags to pass to the wrapper. The key is the flag name, the value is the flag value. If the value is true, the flag will be passed without a value. If the value is false or null, the flag will not be passed. If the value is a list, the flag will be passed multiple times with each value.

This option takes a set.

Any entry can instead be of type { data, before ? [], after ? [], esc-fn ? null, sep ? null }

The sep field may be used to override the value of config.flagSeparator

This will cause it to be added to the DAG, which will cause the resulting wrapper argument to be sorted accordingly

Type: attribute set of spec with main field: data of (null or boolean or str|path|drv or list of str|path|drv)

Default:

{ }

Example:

{
  "--config" = ./nixPath;
}

Declared by:

flags.<name>.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

flags.<name>.sep

A per-item override of the default separator used for flags and their values

Type: null or string

Default:

null

Declared by:

prefixContent

[
  [ "ENV" "SEP" "FILE" ]
]

Prefix ENV with contents of FILE and SEP at build time.

Also accepts sets like the other options

[
  [ "ENV" "SEP" "FILE" ]
  { data = [ "ENV" "SEP" "FILE" ]; esc-fn = lib.escapeShellArg; /* name, before, after */ }
]

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Declared by:

prefixContent.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

prefixVar

–prefix ENV SEP VAL

Prefix ENV with VAL, separated by SEP.

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Example:

[
  [
    "LD_LIBRARY_PATH"
    ":"
    "${lib.makeLibraryPath (with pkgs; [ ... ])}"
  ]
  [
    "PATH"
    ":"
    "${lib.makeBinPath (with pkgs; [ ... ])}"
  ]
]

Declared by:

prefixVar.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

runShell

–run COMMAND

Run COMMAND before executing the main program.

This option takes a list.

Any entry can instead be of type { data, name ? null, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG.

If no name is provided, it cannot be targeted.

Type: list of spec with main field: data of str|path|drv

Default:

[ ]

Declared by:

runShell.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

runtimeLibraries

Additional libraries to add to the wrapper’s runtime LD_LIBRARY_PATH. This is useful if the wrapped program needs additional libraries or tools to function correctly.

Adds all its entries to the DAG under the name NIX_LIB_ADDITIONS

Type: list of package

Default:

[ ]

Declared by:

suffixContent

[
  [ "ENV" "SEP" "FILE" ]
]

Suffix ENV with SEP and then the contents of FILE at build time.

Also accepts sets like the other options

[
  [ "ENV" "SEP" "FILE" ]
  { data = [ "ENV" "SEP" "FILE" ]; esc-fn = lib.escapeShellArg; /* name, before, after */ }
]

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Declared by:

suffixContent.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

suffixVar

–suffix ENV SEP VAL

Suffix ENV with VAL, separated by SEP.

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Example:

[
  [
    "LD_LIBRARY_PATH"
    ":"
    "${lib.makeLibraryPath (with pkgs; [ ... ])}"
  ]
  [
    "PATH"
    ":"
    "${lib.makeBinPath (with pkgs; [ ... ])}"
  ]
]

Declared by:

suffixVar.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

unsetVar

–unset VAR

Remove VAR from the environment.

Type: list of spec with main field: data of string

Default:

[ ]

Declared by:

unsetVar.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperImplementation

the nix implementation is the default

It makes the escapingFunction most relevant.

This is because the shell and binary implementations use pkgs.makeWrapper or pkgs.makeBinaryWrapper, and arguments to these functions are passed at BUILD time.

So, generally, when not using the nix implementation, you should always prefer to have escapingFunction set to lib.escapeShellArg.

However, if you ARE using the nix implementation, using wlib.escapeShellArgWithEnv will allow you to use $ expansions, which will expand at runtime.

binary implementation is useful for programs which are likely to be used in “shebangs”, as macos will not allow scripts to be used for these.

However, it is more limited. It does not have access to runShell, prefixContent, and suffixContent options.

Chosing binary will thus cause values in those options to be ignored.

Type: one of “nix”, “shell”, “binary”

Default:

"nix"

Declared by:

wrapperVariants

Allows for you to apply the wrapper options to multiple binaries from config.package (or elsewhere)

They are called variants because they are the same options as the top level makeWrapper options, however, their defaults mirror the values of the top level options.

Meaning if you set config.env.MYVAR = "HELLO" at the top level, then the following statement would be true by default:

config.wrapperVariants.foo.env.MYVAR.data == "HELLO"

They achieve this by receiving mainConfig and mainOpts via specialArgs, which contain config and options from the top level.

Type: attribute set of (submodule)

Default:

{ }

Declared by:

wrapperVariants.<name>.addFlag

Wrapper for

–add-flag ARG

Prepend the single argument ARG to the invocation of the executable, before any command-line arguments.

This option takes a list. To group them more strongly, option may take a list of lists as well.

Any entry can instead be of type { data, name ? null, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG.

If no name is provided, it cannot be targeted.

Type: list of spec with main field: data of (str|path|drv or list of str|path|drv)

Default:

[ ]

Example:

[
  "-v"
  "-f"
  [
    "--config"
    ./storePath.cfg
  ]
  [
    "-s"
    "idk"
  ]
]

Declared by:

wrapperVariants.<name>.addFlag.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.appendFlag

–append-flag ARG

Append the single argument ARG to the invocation of the executable, after any command-line arguments.

This option takes a list. To group them more strongly, option may take a list of lists as well.

Any entry can instead be of type { data, name ? null, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG.

If no name is provided, it cannot be targeted.

Type: list of spec with main field: data of (str|path|drv or list of str|path|drv)

Default:

[ ]

Example:

[
  "-v"
  "-f"
  [
    "--config"
    ./storePath.cfg
  ]
  [
    "-s"
    "idk"
  ]
]

Declared by:

wrapperVariants.<name>.appendFlag.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.argv0

–argv0 NAME

Set the name of the executed process to NAME. If unset or null, defaults to EXECUTABLE.

overrides the setting from argv0type if set.

Type: null or string

Default:

null

Declared by:

wrapperVariants.<name>.argv0type

argv0 overrides this option if not null or unset

Both shell and the nix implementations ignore this option, as the shell always resolves $0

However, the binary implementation will use this option

Values:

  • "inherit":

The executable inherits argv0 from the wrapper. Use instead of --argv0 '$0'.

  • "resolve":

If argv0 does not include a “/” character, resolve it against PATH.

  • Function form: str -> str

This one works only in the nix implementation. The others will treat it as inherit

Rather than calling exec, you get the command plus all its flags supplied, and you can choose how to run it.

e.g. command_string: "eval \"$(${command_string})\";

It will also be added to the end of the overall DAL, with the name NIX_RUN_MAIN_PACKAGE

Thus, you can make things run after it, but by default it is still last.

Type: one of “resolve”, “inherit” or function that evaluates to a(n) string

Default:

"inherit"

Declared by:

wrapperVariants.<name>.binName

The name of the file to output to $out/bin/

Type: non-empty line

Default:

"‹name›"

Declared by:

wrapperVariants.<name>.chdir

–chdir DIR

Change working directory before running the executable. Use instead of --run "cd DIR".

Type: list of spec with main field: data of str|path|drv

Default:

[ ]

Declared by:

wrapperVariants.<name>.chdir.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.enable

Enables the wrapping of this variant

Type: boolean

Default:

true

Declared by:

wrapperVariants.<name>.env

Environment variables to set in the wrapper.

This option takes a set.

Any entry can instead be of type { data, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG, which will cause the resulting wrapper argument to be sorted accordingly

Type: attribute set of spec with main field: data of str|path|drv

Default:

{ }

Example:

{
  XDG_DATA_HOME = "/somewhere/on/your/machine";
}

Declared by:

wrapperVariants.<name>.env.<name>.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.envDefault

Environment variables to set in the wrapper.

Like env, but only adds the variable if not already set in the environment.

This option takes a set.

Any entry can instead be of type { data, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG, which will cause the resulting wrapper argument to be sorted accordingly

Type: attribute set of spec with main field: data of str|path|drv

Default:

{ }

Example:

{
  XDG_DATA_HOME = "/only/if/not/set";
}

Declared by:

wrapperVariants.<name>.envDefault.<name>.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.escapingFunction

The function to use to escape shell values

Caution: When using shell or binary implementations, these will be expanded at BUILD time.

You should probably leave this as is when using either of those implementations.

However, when using the nix implementation, they will expand at runtime! Which means wlib.escapeShellArgWithEnv may prove to be a useful substitute!

Type: function that evaluates to a(n) string

Default:

lib.escapeShellArg

Declared by:

wrapperVariants.<name>.exePath

The location within the package of the thing to wrap.

Type: null or non-empty line

Default:

"bin/‹name›"

Declared by:

wrapperVariants.<name>.extraPackages

Additional packages to add to the wrapper’s runtime PATH. This is useful if the wrapped program needs additional libraries or tools to function correctly.

Adds all its entries to the DAG under the name NIX_PATH_ADDITIONS

Type: list of package

Default:

[ ]

Declared by:

wrapperVariants.<name>.flagSeparator

Separator between flag names and values when generating args from flags. " " for --flag value or "=" for --flag=value

Type: string

Default:

" "

Declared by:

wrapperVariants.<name>.flags

Flags to pass to the wrapper. The key is the flag name, the value is the flag value. If the value is true, the flag will be passed without a value. If the value is false or null, the flag will not be passed. If the value is a list, the flag will be passed multiple times with each value.

This option takes a set.

Any entry can instead be of type { data, before ? [], after ? [], esc-fn ? null, sep ? null }

The sep field may be used to override the value of config.flagSeparator

This will cause it to be added to the DAG, which will cause the resulting wrapper argument to be sorted accordingly

Type: attribute set of spec with main field: data of (null or boolean or str|path|drv or list of str|path|drv)

Default:

{ }

Example:

{
  "--config" = ./nixPath;
}

Declared by:

wrapperVariants.<name>.flags.<name>.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.flags.<name>.sep

A per-item override of the default separator used for flags and their values

Type: null or string

Default:

null

Declared by:

wrapperVariants.<name>.mirror

Allows the variant to inherit defaults from the top level

Type: boolean

Default:

true

Declared by:

wrapperVariants.<name>.package

The package to wrap with these options

Type: str|path|drv

Default:

<derivation hello-2.12.2>

Declared by:

wrapperVariants.<name>.prefixContent

[
  [ "ENV" "SEP" "FILE" ]
]

Prefix ENV with contents of FILE and SEP at build time.

Also accepts sets like the other options

[
  [ "ENV" "SEP" "FILE" ]
  { data = [ "ENV" "SEP" "FILE" ]; esc-fn = lib.escapeShellArg; /* name, before, after */ }
]

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Declared by:

wrapperVariants.<name>.prefixContent.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.prefixVar

–prefix ENV SEP VAL

Prefix ENV with VAL, separated by SEP.

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Example:

[
  [
    "LD_LIBRARY_PATH"
    ":"
    "${lib.makeLibraryPath (with pkgs; [ ... ])}"
  ]
  [
    "PATH"
    ":"
    "${lib.makeBinPath (with pkgs; [ ... ])}"
  ]
]

Declared by:

wrapperVariants.<name>.prefixVar.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.runShell

–run COMMAND

Run COMMAND before executing the main program.

This option takes a list.

Any entry can instead be of type { data, name ? null, before ? [], after ? [], esc-fn ? null }

This will cause it to be added to the DAG.

If no name is provided, it cannot be targeted.

Type: list of spec with main field: data of str|path|drv

Default:

[ ]

Declared by:

wrapperVariants.<name>.runShell.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.runtimeLibraries

Additional libraries to add to the wrapper’s runtime LD_LIBRARY_PATH. This is useful if the wrapped program needs additional libraries or tools to function correctly.

Adds all its entries to the DAG under the name NIX_LIB_ADDITIONS

Type: list of package

Default:

[ ]

Declared by:

wrapperVariants.<name>.suffixContent

[
  [ "ENV" "SEP" "FILE" ]
]

Suffix ENV with SEP and then the contents of FILE at build time.

Also accepts sets like the other options

[
  [ "ENV" "SEP" "FILE" ]
  { data = [ "ENV" "SEP" "FILE" ]; esc-fn = lib.escapeShellArg; /* name, before, after */ }
]

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Declared by:

wrapperVariants.<name>.suffixContent.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.suffixVar

–suffix ENV SEP VAL

Suffix ENV with VAL, separated by SEP.

Type: list of spec with main field: data of (List of length 3)

Default:

[ ]

Example:

[
  [
    "LD_LIBRARY_PATH"
    ":"
    "${lib.makeLibraryPath (with pkgs; [ ... ])}"
  ]
  [
    "PATH"
    ":"
    "${lib.makeBinPath (with pkgs; [ ... ])}"
  ]
]

Declared by:

wrapperVariants.<name>.suffixVar.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.unsetVar

–unset VAR

Remove VAR from the environment.

Type: list of spec with main field: data of string

Default:

[ ]

Declared by:

wrapperVariants.<name>.unsetVar.*.esc-fn

A per-item override of the default string escape function

Type: null or (function that evaluates to a(n) string)

Default:

null

Declared by:

wrapperVariants.<name>.wrapperImplementation

the nix implementation is the default

It makes the escapingFunction most relevant.

This is because the shell and binary implementations use pkgs.makeWrapper or pkgs.makeBinaryWrapper, and arguments to these functions are passed at BUILD time.

So, generally, when not using the nix implementation, you should always prefer to have escapingFunction set to lib.escapeShellArg.

However, if you ARE using the nix implementation, using wlib.escapeShellArgWithEnv will allow you to use $ expansions, which will expand at runtime.

binary implementation is useful for programs which are likely to be used in “shebangs”, as macos will not allow scripts to be used for these.

However, it is more limited. It does not have access to runShell, prefixContent, and suffixContent options.

Chosing binary will thus cause values in those options to be ignored.

Type: one of “nix”, “shell”, “binary”

Default:

"nix"

Declared by:


The makeWrapper library:

Should you ever need to redefine config.wrapperFunction, or use these options somewhere else, this module doubles as a library for doing so!

makeWrapper = import wlib.modules.makeWrapper;

If you import it like shown, you gain access to some values.

First, you may modify the module itself.

For this it offers:

exclude_wrapper = true; to stop it from setting config.wrapperFunction

wrapperFunction = ...; to override the default config.wrapperFunction that it sets instead of excluding it.

exclude_meta = true; to stop it from setting any values in config.meta

excluded_options = { ... }; where you may include optionname = true in order to not define that option.

In order to change these values, you change them in the set before importing the module like so:

  imports = [ (import wlib.modules.makeWrapper // { excluded_options.wrapperVariants = true; }) ];

It also offers 4 functions for using those options to generate build instructions for a wrapper

  • wrapAll: generates build instructions for the main target and all variants
  • wrapMain: generates build instructions for the main target
  • wrapVariants: generates build instructions for all variants but not the main target
  • wrapVariant: generates build instructions for a single variant

All 4 of them return a string that can be added to the derivation definition to build the specified wrappers.

The first 3, wrapAll, wrapMain, and wrapVariants, are used like this:

(import wlib.modules.makeWrapper).wrapAll { inherit config wlib; inherit (pkgs) callPackage; # or inherit pkgs; };

The 4th, wrapVariant, has an extra name argument:

(import wlib.modules.makeWrapper).wrapVariant { inherit config wlib; inherit (pkgs) callPackage; # or inherit pkgs; name = "attribute"; };

Where attribute is an attribute of the config.wrapperVariants set

Other than whatever options from the wlib.modules.makeWrapper module are defined in the config variable passed, each one relies on config containing binName, package, and exePath.

If config.exePath is not a string or is an empty string, config.package will be the full path wrapped. Otherwise, it will wrap "${config.package}/${config.binName}.

If config.binName or config.package are not provided it will return an empty string for that target.

In addition, if a variant has enable set to false, it will also not be included in the returned string.