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