libloading/
changelog.rs

1//! The change log.
2
3/// Release 0.8.9 (2025-09-17)
4///
5/// ## Non-breaking changes
6///
7/// Migrate from windows-targets to windows-link for linking Windows API functions.
8pub mod r0_8_9 {}
9
10/// Release 0.8.8 (2025-05-27)
11///
12/// ## Non-breaking changes
13///
14/// Add `os::window::Library::pin`.
15pub mod r0_8_8 {}
16
17/// Release 0.8.7 (2025-04-26)
18///
19/// ## Non-breaking changes
20///
21/// Add support for the `*-pc-cygwin` target.
22pub mod r0_8_7 {}
23
24/// Release 0.8.4 (2024-06-23)
25///
26/// ## Non-breaking changes
27///
28/// Compilation when targeting Apple's visionos, watchos and tvos targets has been fixed.
29pub mod r0_8_4 {}
30
31/// Release 0.8.3 (2024-03-05)
32///
33/// ## Non-breaking changes
34///
35/// A `dev-dependency` on `windows-sys` that was unconditionally introduced in
36/// [0.8.2](r0_8_2) has been made conditional.
37pub mod r0_8_3 {}
38
39/// Release 0.8.2 (2024-03-01)
40///
41/// ## (Potentially) breaking changes
42///
43/// MSRV has been increased to 1.56.0. Since both rustc versions are ancient, this has been deemed
44/// to not be breaking enough to warrant a semver-breaking release of libloading. If you're stick
45/// with a version of rustc older than 1.56.0, lock `libloading` dependency to `0.8.1`.
46///
47/// ## Non-breaking changes
48///
49/// * The crate switches the dependency on `windows-sys` to a `windows-target` one for Windows
50///   bindings. In order to enable this `libloading` defines any bindings necessary for its operation
51///   internally, just like has been done for `unix` targets. This should result in leaner dependency
52///   trees.
53/// * `os::unix::with_dlerror` has been exposed for the users who need to invoke `dl*` family of
54///   functions manually.
55pub mod r0_8_2 {}
56
57/// Release 0.8.1 (2023-09-30)
58///
59/// ## Non-breaking changes
60///
61/// * Support for GNU Hurd.
62pub mod r0_8_1 {}
63
64/// Release 0.8.0 (2023-04-11)
65///
66/// ## (Potentially) breaking changes
67///
68/// * `winapi` dependency has been replaced with `windows-sys`.
69/// * As a result the MSRV has been increased to 1.48.
70///
71/// ## Non-breaking changes
72///
73/// * Support for the QNX Neutrino target has been added.
74pub mod r0_8_0 {}
75
76/// Release 0.7.4 (2022-11-07)
77///
78/// This release has no functional changes.
79///
80/// `RTLD_LAZY`, `RTLD_GLOBAL` and `RTLD_LOCAL` constants have been implemented for AIX platforms.
81pub mod r0_7_4 {}
82
83/// Release 0.7.3 (2022-01-15)
84///
85/// This release has no functional changes.
86///
87/// In this release the `docsrs` `cfg` has been renamed to `libloading_docs` to better reflect that
88/// this `cfg` is intended to be only used by `libloading` and only specifically for the invocation
89/// of `rustdoc` when documenting `libloading`. Setting this `cfg` in any other situation is
90/// unsupported and will not work.
91pub mod r0_7_3 {}
92
93/// Release 0.7.2 (2021-11-14)
94///
95/// Cargo.toml now specifies the MSRV bounds, which enables tooling to report an early failure when
96/// the version of the toolchain is insufficient. Refer to the [min-rust-version RFC] and its
97/// [tracking issue].
98///
99/// [min-rust-version RFC]: https://rust-lang.github.io/rfcs/2495-min-rust-version.html
100/// [tracking issue]: https://github.com/rust-lang/rust/issues/65262
101///
102/// Additionally, on platforms `libloading` has no support (today: `not(any(unix, windows))`), we
103/// will no longer attempt to implement the cross-platform `Library` and `Symbol` types. This makes
104/// `libloading` compile on targets such as `wasm32-unknown-unknown` and gives ability to the
105/// downstream consumers of this library to decide how they want to handle the absence of the
106/// library loading implementation in their code. One of such approaches could be depending on
107/// `libloading` itself optionally as such:
108///
109/// ```toml
110/// [target.'cfg(any(unix, windows))'.dependencies.libloading]
111/// version = "0.7"
112/// ```
113pub mod r0_7_2 {}
114
115/// Release 0.7.1 (2021-10-09)
116///
117/// Significantly improved the consistency and style of the documentation.
118pub mod r0_7_1 {}
119
120/// Release 0.7.0 (2021-02-06)
121///
122/// ## Breaking changes
123///
124/// ### Loading functions are now `unsafe`
125///
126/// A number of associated methods involved in loading a library were changed to
127/// be `unsafe`. The affected functions are: [`Library::new`], [`os::unix::Library::new`],
128/// [`os::unix::Library::open`], [`os::windows::Library::new`],
129/// [`os::windows::Library::load_with_flags`]. This is the most prominent breaking change in this
130/// release and affects majority of the users of `libloading`.
131///
132/// In order to see why it was necessary, consider the following snippet of C++ code:
133///
134/// ```c++
135/// #include <vector>
136/// #include <iostream>
137///
138/// static std::vector<unsigned int> UNSHUU = { 1, 2, 3 };
139///
140/// int main() {
141///     std::cout << UNSHUU[0] << UNSHUU[1] << UNSHUU[2] << std::endl; // Prints 123
142///     return 0;
143/// }
144/// ```
145///
146/// The `std::vector` type, much like in Rust's `Vec`, stores its contents in a buffer allocated on
147/// the heap. In this example the vector object itself is stored and initialized as a static
148/// variable – a compile time construct. The heap, on the other hand, is a runtime construct. And
149/// yet the code works exactly as you'd expect – the vector contains numbers 1, 2 and 3 stored in
150/// a buffer on heap. So, _what_ makes it work out, exactly?
151///
152/// Various executable and shared library formats define conventions and machinery to execute
153/// arbitrary code when a program or a shared library is loaded. On systems using the PE format
154/// (e.g. Windows) this is available via the optional `DllMain` initializer. Various systems
155/// utilizing the ELF format take a slightly different approach of maintaining an array of function
156/// pointers in the `.init_array` section. A very similar mechanism exists on systems that utilize
157/// the Mach-O format.
158///
159/// For the C++ program above, the object stored in the `UNSHUU` global variable is constructed
160/// by code run as part of such an initializer routine. This initializer is run before the entry
161/// point (the `main` function) is executed, allowing for this magical behaviour to be possible.
162/// Were the C++ code built as a shared library instead, the initialization routines would run as
163/// the resulting shared library is loaded. In case of `libloading` – during the call to
164/// `Library::new` and other methods affected by this change.
165///
166/// These initialization (and very closely related termination) routines can be utilized outside of
167/// C++ too. Anybody can build a shared library in variety of different programming languages and
168/// set up the initializers to execute arbitrary code. Potentially code that does all sorts of
169/// wildly unsound stuff.
170///
171/// The routines are executed by components that are an integral part of the operating system.
172/// Changing or controlling the operation of these components is infeasible. With that in
173/// mind, the initializer and termination routines are something anybody loading a library must
174/// carefully evaluate the libraries loaded for soundness.
175///
176/// In practice, a vast majority of the libraries can be considered a good citizen and their
177/// initialization and termination routines, if they have any at all, can be trusted to be sound.
178///
179/// Also see: [issue #86].
180///
181/// ### Better & more consistent default behaviour on UNIX systems
182///
183/// On UNIX systems the [`Library::new`], [`os::unix::Library::new`] and
184/// [`os::unix::Library::this`] methods have been changed to use
185/// <code>[RTLD_LAZY] | [RTLD_LOCAL]</code> as the default set of loader options (previously:
186/// [`RTLD_NOW`]). This has a couple benefits. Namely:
187///
188/// * Lazy binding is generally quicker to execute when only a subset of symbols from a library are
189///   used and is typically the default when neither `RTLD_LAZY` nor `RTLD_NOW` are specified when
190///   calling the underlying `dlopen` API;
191/// * On most UNIX systems (macOS being a notable exception) `RTLD_LOCAL` is the default when
192///   neither `RTLD_LOCAL` nor [`RTLD_GLOBAL`] are specified. The explicit setting of the
193///   `RTLD_LOCAL` flag makes this behaviour consistent across platforms.
194///
195/// ### Dropped support for Windows XP/Vista
196///
197/// The (broken) support for Windows XP and Windows Vista environments was removed. This was
198/// prompted primarily by a similar policy change in the [Rust
199/// project](https://github.com/rust-lang/compiler-team/issues/378) but also as an acknowledgement
200/// to the fact that `libloading` never worked in these environments anyway.
201///
202/// ### More accurate error variant names
203///
204/// Finally, the `Error::LoadLibraryW` renamed to [`Error::LoadLibraryExW`] to more accurately
205/// represent the underlying API that's failing. No functional changes as part of this rename
206/// intended.
207///
208/// [issue #86]: https://github.com/nagisa/rust_libloading/issues/86
209/// [`Library::new`]: crate::Library::new
210/// [`Error::LoadLibraryExW`]: crate::Error::LoadLibraryExW
211/// [`os::unix::Library::this`]: crate::os::unix::Library::this
212/// [`os::unix::Library::new`]: crate::os::unix::Library::new
213/// [`os::unix::Library::open`]: crate::os::unix::Library::new
214/// [`os::windows::Library::new`]: crate::os::windows::Library::new
215/// [`os::windows::Library::load_with_flags`]: crate::os::windows::Library::load_with_flags
216/// [`RTLD_NOW`]: crate::os::unix::RTLD_NOW
217/// [RTLD_LAZY]: crate::os::unix::RTLD_LAZY
218/// [RTLD_LOCAL]: crate::os::unix::RTLD_LOCAL
219/// [`RTLD_GLOBAL`]: crate::os::unix::RTLD_GLOBAL
220pub mod r0_7_0 {}
221
222/// Release 0.6.7 (2021-01-14)
223///
224/// * Added a [`os::windows::Library::open_already_loaded`] to obtain a handle to a library that
225///   must already be loaded. There is no portable equivalent for all UNIX targets. Users who do
226///   not care about portability across UNIX platforms may use [`os::unix::Library::open`] with
227///   `libc::RTLD_NOLOAD`;
228///
229/// [`os::windows::Library::open_already_loaded`]: crate::os::windows::Library::open_already_loaded
230/// [`os::unix::Library::open`]: crate::os::unix::Library::open
231pub mod r0_6_7 {}
232
233/// Release 0.6.6 (2020-12-03)
234///
235/// * Fix a double-release of resources when [`Library::close`] or [`os::windows::Library::close`]
236///   is used on Windows.
237///
238/// [`Library::close`]: crate::Library::close
239/// [`os::windows::Library::close`]: crate::os::windows::Library::close
240pub mod r0_6_6 {}
241
242/// Release 0.6.5 (2020-10-23)
243///
244/// * Upgrade cfg-if 0.1 to 1.0
245pub mod r0_6_5 {}
246
247/// Release 0.6.4 (2020-10-10)
248///
249/// * Remove use of `build.rs` making it easier to build `libloading` without cargo. It also
250///   almost halves the build time of this crate.
251pub mod r0_6_4 {}
252
253/// Release 0.6.3 (2020-08-22)
254///
255/// * Improve documentation, allowing to view all of the os-specific functionality from
256///   documentation generated for any target;
257/// * Add [`os::windows::Library::this`];
258/// * Added constants to use with OS-specific `Library::open`;
259/// * Add [`library_filename`].
260///
261/// [`os::windows::Library::this`]: crate::os::windows::Library::this
262/// [`library_filename`]: crate::library_filename
263pub mod r0_6_3 {}
264
265/// Release 0.6.2 (2020-05-06)
266///
267/// * Fixed building of this library on Illumos.
268pub mod r0_6_2 {}
269
270/// Release 0.6.1 (2020-04-15)
271///
272/// * Introduced a new method [`os::windows::Library::load_with_flags`];
273/// * Added support for the Illumos triple.
274///
275/// [`os::windows::Library::load_with_flags`]: crate::os::windows::Library::load_with_flags
276pub mod r0_6_1 {}
277
278/// Release 0.6.0 (2020-04-05)
279///
280/// * Introduced a new method [`os::unix::Library::get_singlethreaded`];
281/// * Added (untested) support for building when targeting Redox and Fuchsia;
282/// * The APIs exposed by this library no longer panic and instead return an `Err` when it used
283///   to panic.
284///
285/// ## Breaking changes
286///
287/// * Minimum required (stable) version of Rust to build this library is now 1.40.0;
288/// * This crate now implements a custom [`Error`] type and all APIs now return this type rather
289///   than returning the `std::io::Error`;
290/// * `libloading::Result` has been removed;
291/// * Removed the dependency on the C compiler to build this library on UNIX-like platforms.
292///   `libloading` used to utilize a snippet written in C to work-around the unlikely possibility
293///   of the target having a thread-unsafe implementation of the `dlerror` function. The effect of
294///   the work-around was very opportunistic: it would not work if the function was called by
295///   forgoing `libloading`.
296///
297///   Starting with 0.6.0, [`Library::get`] on platforms where `dlerror` is not MT-safe (such as
298///   FreeBSD, DragonflyBSD or NetBSD) will unconditionally return an error when the underlying
299///   `dlsym` returns a null pointer. For the use-cases where loading null pointers is necessary
300///   consider using [`os::unix::Library::get_singlethreaded`] instead.
301///
302/// [`Library::get`]: crate::Library::get
303/// [`os::unix::Library::get_singlethreaded`]: crate::os::unix::Library::get_singlethreaded
304/// [`Error`]: crate::Error
305pub mod r0_6_0 {}
306
307/// Release 0.5.2 (2019-07-07)
308///
309/// * Added API to convert OS-specific `Library` and `Symbol` conversion to underlying resources.
310pub mod r0_5_2 {}
311
312/// Release 0.5.1 (2019-06-01)
313///
314/// * Build on Haiku targets.
315pub mod r0_5_1 {}
316
317/// Release 0.5.0 (2018-01-11)
318///
319/// * Update to `winapi = ^0.3`;
320///
321/// ## Breaking changes
322///
323/// * libloading now requires a C compiler to build on UNIX;
324///   * This is a temporary measure until the [`linkage`] attribute is stabilised;
325///   * Necessary to resolve [#32].
326///
327/// [`linkage`]: https://github.com/rust-lang/rust/issues/29603
328/// [#32]: https://github.com/nagisa/rust_libloading/issues/32
329pub mod r0_5_0 {}
330
331/// Release 0.4.3 (2017-12-07)
332///
333/// * Bump lazy-static dependency to `^1.0`;
334/// * `cargo test --release` now works when testing libloading.
335pub mod r0_4_3 {}
336
337/// Release 0.4.2 (2017-09-24)
338///
339/// * Improved error and race-condition handling on Windows;
340/// * Improved documentation about thread-safety of Library;
341/// * Added `Symbol::<Option<T>::lift_option() -> Option<Symbol<T>>` convenience method.
342pub mod r0_4_2 {}
343
344/// Release 0.4.1 (2017-08-29)
345///
346/// * Solaris support
347pub mod r0_4_1 {}
348
349/// Release 0.4.0 (2017-05-01)
350///
351/// * Remove build-time dependency on target_build_utils (and by extension serde/phf);
352/// * Require at least version 1.14.0 of rustc to build;
353///   * Actually, it is cargo which has to be more recent here. The one shipped with rustc 1.14.0
354///     is what’s being required from now on.
355pub mod r0_4_0 {}
356
357/// Release 0.3.4 (2017-03-25)
358///
359/// * Remove rogue println!
360pub mod r0_3_4 {}
361
362/// Release 0.3.3 (2017-03-25)
363///
364/// * Panics when `Library::get` is called for incompatibly sized type such as named function
365///   types (which are zero-sized).
366pub mod r0_3_3 {}
367
368/// Release 0.3.2 (2017-02-10)
369///
370/// * Minimum version required is now rustc 1.12.0;
371/// * Updated dependency versions (most notably target_build_utils to 0.3.0)
372pub mod r0_3_2 {}
373
374/// Release 0.3.1 (2016-10-01)
375///
376/// * `Symbol<T>` and `os::*::Symbol<T>` now implement `Send` where `T: Send`;
377/// * `Symbol<T>` and `os::*::Symbol<T>` now implement `Sync` where `T: Sync`;
378/// * `Library` and `os::*::Library` now implement `Sync` (they were `Send` in 0.3.0 already).
379pub mod r0_3_1 {}
380
381/// Release 0.3.0 (2016-07-27)
382///
383/// * Greatly improved documentation, especially around platform-specific behaviours;
384/// * Improved test suite by building our own library to test against;
385/// * All `Library`-ies now implement `Send`.
386/// * Added `impl From<os::platform::Library> for Library` and `impl From<Library> for
387///   os::platform::Library` allowing wrapping and extracting the platform-specific library handle;
388/// * Added methods to wrap (`Symbol::from_raw`) and unwrap (`Symbol::into_raw`) the safe `Symbol`
389///   wrapper into unsafe `os::platform::Symbol`.
390///
391/// The last two additions focus on not restricting potential usecases of this library, allowing
392/// users of the library to circumvent safety checks if need be.
393///
394/// ## Breaking Changes
395///
396/// `Library::new` defaults to `RTLD_NOW` instead of `RTLD_LAZY` on UNIX for more consistent
397/// cross-platform behaviour. If a library loaded with `Library::new` had any linking errors, but
398/// unresolved references weren’t forced to be resolved, the library would’ve “just worked”,
399/// whereas now the call to `Library::new` will return an error signifying presence of such error.
400///
401/// ## os::platform
402/// * Added `os::unix::Library::open` which allows specifying arbitrary flags (e.g. `RTLD_LAZY`);
403/// * Added `os::windows::Library::get_ordinal` which allows finding a function or variable by its
404///   ordinal number;
405pub mod r0_3_0 {}