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