libloading/
changelog.rs

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