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