Compare commits

..

No commits in common. "4ca28575000a6efbdc35a174a9a8079ca61f3070" and "318bdd3d1960c5b8bd898253b2169bc1dfe463fe" have entirely different histories.

7 changed files with 30 additions and 25 deletions

34
Cargo.lock generated
View file

@ -44,9 +44,9 @@ checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.60" version = "1.2.56"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2"
dependencies = [ dependencies = [
"find-msvc-tools", "find-msvc-tools",
"shlex", "shlex",
@ -142,9 +142,9 @@ dependencies = [
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "2.4.1" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]] [[package]]
name = "find-msvc-tools" name = "find-msvc-tools"
@ -223,9 +223,9 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.17.0" version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
[[package]] [[package]]
name = "heck" name = "heck"
@ -241,12 +241,12 @@ checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.14.0" version = "2.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown 0.17.0", "hashbrown 0.16.1",
"serde", "serde",
"serde_core", "serde_core",
] ]
@ -283,9 +283,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.185" version = "0.2.183"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
[[package]] [[package]]
name = "libloading" name = "libloading"
@ -402,9 +402,9 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.33" version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]] [[package]]
name = "prettyplease" name = "prettyplease"
@ -480,9 +480,9 @@ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
[[package]] [[package]]
name = "rustc-hash" name = "rustc-hash"
version = "2.1.2" version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]] [[package]]
name = "rustix" name = "rustix"
@ -520,9 +520,9 @@ checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca"
[[package]] [[package]]
name = "semver" name = "semver"
version = "1.0.28" version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
[[package]] [[package]]
name = "serde" name = "serde"

View file

@ -15,6 +15,7 @@ targets = [ "x86_64-unknown-linux-gnu" ]
[lib] [lib]
path = "src/lib.rs" path = "src/lib.rs"
# crate-type = ["dylib"] # build libnixide_sys.so
# NOTE: `[features]` have a 1-1 correspondence to the # NOTE: `[features]` have a 1-1 correspondence to the
# NOTE: shared libraries produced by the Nix C API. # NOTE: shared libraries produced by the Nix C API.

View file

@ -118,9 +118,6 @@ fn main() {
.map(|lib| lib.link_files) .map(|lib| lib.link_files)
.flatten() .flatten()
.unique() .unique()
.inspect(|path|
println!("cargo::rustc-link-lib={}", path.display())
)
.collect(); .collect();
// build the libnixide-c extension // build the libnixide-c extension

View file

@ -1,8 +1,17 @@
// #include <string>
// #include <nix_api_flake.h>
#include <nix_api_flake_internal.hh> #include <nix_api_flake_internal.hh>
// #include <nix_api_util.h>
#include <nix_api_util_internal.h> #include <nix_api_util_internal.h>
// #include <nix_api_expr_internal.h>
// #include <nix_api_fetchers_internal.hh>
// #include <nix_api_fetchers.h>
#include "nix/flake/flake.hh" #include "nix/flake/flake.hh"
// #include "nixide_api_flake.h"
extern "C" { extern "C" {
nix_err nix_flake_lock_flags_set_recreate_lock_file(nix_c_context * context, nix_flake_lock_flags * flags, bool value) nix_err nix_flake_lock_flags_set_recreate_lock_file(nix_c_context * context, nix_flake_lock_flags * flags, bool value)

View file

@ -9,7 +9,6 @@ extern "C" {
nix_err nix_register_plugin(nix_c_context * context, char * plugin) nix_err nix_register_plugin(nix_c_context * context, char * plugin)
{ {
// DEBUG: TODO
if (context) if (context)
context->last_err_code = NIX_OK; context->last_err_code = NIX_OK;
if (plugin == nullptr) { if (plugin == nullptr) {

View file

@ -307,8 +307,7 @@ fn primop_function_call() {
let result = nix_alloc_value(ctx, state); let result = nix_alloc_value(ctx, state);
assert!(!result.is_null()); assert!(!result.is_null());
let call_err = let call_err = nix_value_call(ctx, state, primop_value, ptr::null_mut(), result);
nix_value_call_multi(ctx, state, primop_value, 0, ptr::null_mut(), result);
if call_err == NixErr::Ok { if call_err == NixErr::Ok {
// Force the result // Force the result
let force_err = nix_value_force(ctx, state, result); let force_err = nix_value_force(ctx, state, result);

View file

@ -45,7 +45,7 @@ impl NixVersion {
/// ///
/// # Examples /// # Examples
/// ///
/// ```rs /// ```
/// use nixide::NixVersion; /// use nixide::NixVersion;
/// ///
/// assert_eq!(NixVersion::parse("2.26"), Ok(NixVersion::new(2, 26, 0, false))); /// assert_eq!(NixVersion::parse("2.26"), Ok(NixVersion::new(2, 26, 0, false)));
@ -72,7 +72,7 @@ impl NixVersion {
s[..offset].parse::<u32>()?, // patch s[..offset].parse::<u32>()?, // patch
length > 3 && s.ends_with("pre"), // is_prerelease length > 3 && s.ends_with("pre"), // is_prerelease
) )
}, }
None => (0, false), None => (0, false),
}; };