Skip to content

Latest commit

 

History

History
360 lines (222 loc) · 11.3 KB

CHANGELOG.md

File metadata and controls

360 lines (222 loc) · 11.3 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.2.10 – 2023-08-28

Changed

  • Always use pre-generated LibraryLink bindings. (#57)

    Previously, wolfram-library-link-sys would use bindgen to generate bindings at compile time. Now, the bindings are pre-generated and built-in to wolfram-library-link-sys, without any loss in functionality.

    The build dependency on bindgen has been removed, simplifying the dependency tree and reducing compile times.

    When wolfram-library-link occasionally updates to support a new minimum LibraryLink version, the bindings will need to be regenerated as described in docs/Maintenance.md.

  • Update wstp dependency to v0.2.8, which also replaces build-time use of bindgen with pre-generated bindings. (#59)

  • Developer: Replace custom RunTests.wls script with instructions on how to use the slightly more standardized wolfram-cli paclet test tool. (#58)

Fixed

  • Fixed build failure caused by assumption that c_char is i8 on every platform, which is not true.

0.2.9 – 2023-02-03

Added

  • Add logging support to wolfram-library-link-sys/build.rs. (#54)

    wolfram-app-discovery v0.4.3 added support for logging via the Rust log logging facade library. wolfram-library-link-sys/build.rs uses wolfram-app-discovery to find WolframLibrary.h.

    Logging messages from wolfram-library-link-sys/build.rs can now be enabled by setting the RUST_LOG environment to an appropriate value, as documented in the env_logger crate documentation. This can help debug discovery errors that occur during a build.

Changed

  • Reduce minimal configurable set of dependencies by adding new cargo features. (#53)

    This release adds two new cargo features:

    • panic-failure-backtraces
    • automate-function-loading-boilerplate

    which are enabled by default.

    These features are used to control whether the following (now optional) dependencies are enabled:

    • backtrace
    • inventory
    • process_path

    Making these dependnecies optional reduces the minimal possible set of overall dependencies in projects that use wolfram-library-link.

0.2.8 – 2023-02-01

Changed

  • Update wstp and wolfram-app-discovery dependencies so that wolfram-app-discovery v0.4.1 is being used everywhere, which has improved Linux support, and fixes several bugs. (#51)

0.2.7 – 2022-09-19

Changed

  • Update wolfram-app-discovery dependency from v0.2.1 to v0.3.0, to take advantage of the improved flexibility of the new API functions tailored for use in build scripts. (#49)

0.2.6 – 2022-08-28

Fixed

  • Fixed Failure["RustPanic", ..] messages not being returned from #[export(wstp)] functions when a panic occurs after partial results had begun being written to the WSTP link. (#46)

Changed

  • Clarified documentation problem described in comment on #44, the documentation for exported_library_functions_association() was unclear about when and how to use the library parameter. (#47)

0.2.5 – 2022-06-11

Fixed

0.2.4 – 2022-05-13

Added

0.2.3 – 2022-03-29

Fixed

  • Fixed docs.rs build failure in v0.2.2, caused by a #[doc = include_str!(..)] that fails on case-sensitive targets like the docs.rs Linux build host. (#34)

0.2.2 – 2022-03-28

Added

0.2.1 – 2022-03-09

Added

  • Added exported_library_functions_association(). (#26)

    This function returns an Expr containing an Association of the form <| name_?StringQ -> func_ |>, with an entry for each library function exported using #[export(..)].

    Arguments that are applied to func will be used to call the compiled library function.

  • Added #[export(hidden)] annotation.

    Exported functions with the hidden annotation will not be included in the Association returned by exported_library_functions_association().

exported_library_functions_association() and #[export(hidden)] are alternatives to the generate_loader![] macro. The generate_loader![] macro is convenient, but I think it hides too many details about how it works. It's too much magic.

Together, these two new features can be used by the library author to define a loader function for their own library, which would typically look like:

use wolfram_library_link::{self as wll, export, expr::Expr};

#[export(wstp, hidden)]
fn load_my_lib_funcs(_args: Vec<Expr>) -> Expr {
    return wll::exported_library_functions_association(None);
}

#[export]
fn square(x: i64) -> i64 {
    x * x
}

and which could be used from the Wolfram Language by evaluating:

loadLibraryFunctions = LibraryFunctionLoad[
    "<library path>",
    "load_my_lib_funcs",
    LinkObject,
    LinkObject
];

$functions = loadLibraryFunctions[];

Then, any function exported from the library could be called by accessing the named values in $functions:

(* Call the `square()` function exported by this library. *)
$functions["square"][5]

0.2.0 – 2022-03-07

Added

  • Added new #[export(..)] attribute macro. (#23)

    Export a native function:

    use wolfram_library_link::export;
    
    #[export]
    fn square(x: i64) -> i64 {
        x * x
    }

    Export a WSTP function:

    use wolfram_library_link::{export, wstp::Link};
    
    #[export(wstp)]
    fn total(link: &mut Link) {
        let arg_count = link.test_head("List").unwrap();
    
        let mut total = 0;
    
        for _ in 0..arg_count {
            total += link.get_i64().unwrap();
        }
    
        link.put_i64(total).unwrap();
    }

Changed

  • Changed wolfram-library-link-sys to generate the Rust bindings to WolframLibrary.h at compile time. (#24)

    This ensures that the wolfram-library-link and wolfram-library-link-sys crates can compile against the widest possible range of suppported Wolfram Language versions.

Removed

  • Removed the export![] and export_wstp![] declarative macros. These have been replaced by #[export(..)]. (#23)

0.1.2 – 2022-02-08

Fixed

  • Fix wolfram-library-link-sys/build.rs failure when building in the <docs.rs> build environment, where no Wolfram applications are available to query. (#17)

0.1.1 – 2022-02-08

Fixed

  • Update wstp dependency to fix <docs.rs> build failures caused by earlier versions of wstp-sys. (#16)
  • Fix missing "full" feature needed by the syn dependency of wolfram-library-link-macros. (#16)

0.1.0 – 2022-02-08

Initial release. wolfram-library-link-sys was the only crate published in this release, due to a docs.rs build failure caused by bugs present in early versions of wolfram-app-discovery and wstp-sys.