libloading/
changelog.rs

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