Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ blockfrost-openapi = "0.1.75"
bech32 = "0.9.1"
cardano-serialization-lib = "12.1.1"

[target.'cfg(not(any(target_os = "windows", all(target_os = "linux", target_arch = "aarch64"))))'.dependencies]
[target.'cfg(not(target_os = "windows"))'.dependencies]
pallas-validate = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha3", features = [
"phase2",
] }
Expand Down
36 changes: 14 additions & 22 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mod git_revision {
use std::process::Command;

if env::var(GIT_REVISION).is_ok() {
println!("Environment variable {} is set. Not setting.", GIT_REVISION);
println!("Environment variable {GIT_REVISION} is set. Not setting.");
return;
}

Expand All @@ -58,7 +58,7 @@ mod git_revision {
.to_string()
};

println!("cargo:rustc-env={}={}", GIT_REVISION, revision);
println!("cargo:rustc-env={GIT_REVISION}={revision}");
}
}

Expand All @@ -77,10 +77,7 @@ mod testgen_hs {

pub fn ensure(target_os: &str, arch: &str) {
if env::var(TESTGEN_HS_PATH).is_ok() {
println!(
"Environment variable {} is set. Skipping the download.",
TESTGEN_HS_PATH
);
println!("Environment variable {TESTGEN_HS_PATH} is set. Skipping the download.");
return;
}

Expand All @@ -92,13 +89,12 @@ mod testgen_hs {
".tar.bz2"
};

let file_name = format!("testgen-hs-{}-{}-{}", testgen_lib_version, arch, target_os);
let file_name = format!("testgen-hs-{testgen_lib_version}-{arch}-{target_os}");
let download_url = format!(
"https://github.com/input-output-hk/testgen-hs/releases/download/{}/{}{}",
testgen_lib_version, file_name, suffix
"https://github.com/input-output-hk/testgen-hs/releases/download/{testgen_lib_version}/{file_name}{suffix}"
);

println!("Looking for {}", file_name);
println!("Looking for {file_name}");

// Use the project’s target directory instead of a system cache location.
let cargo_manifest_dir =
Expand All @@ -112,16 +108,16 @@ mod testgen_hs {
create_dir_all(&download_dir).expect("Unable to create testgen directory");

let archive_name = if target_os == "windows" {
format!("{}.zip", file_name)
format!("{file_name}.zip")
} else {
format!("{}.tar.bz2", file_name)
format!("{file_name}.tar.bz2")
};

let archive_path = download_dir.join(&archive_name);

// Download the artifact if not already in the target directory.
if !archive_path.exists() {
println!("Downloading from: {}", download_url);
println!("Downloading from: {download_url}");

let response = reqwest::blocking::get(&download_url)
.expect("Failed to download archive")
Expand Down Expand Up @@ -165,7 +161,7 @@ mod testgen_hs {

// Verify version by running --version.
println!("Verifying testgen-hs version...");
println!("Executing: {:?}", executable);
println!("Executing: {executable:?}");

let output = Command::new(&executable)
.arg("--version")
Expand All @@ -182,7 +178,7 @@ mod testgen_hs {
let version_output = String::from_utf8_lossy(&output.stdout);
println!("testgen-hs version: {}", version_output.trim());

let testgen_lib_version = format!("testgen-hs {}", testgen_lib_version);
let testgen_lib_version = format!("testgen-hs {testgen_lib_version}");

if version_output.trim() != testgen_lib_version {
panic!(
Expand Down Expand Up @@ -239,15 +235,11 @@ mod features {
pub fn evaluate(target_os: &str, target_arch: &str) {
println!("cargo::rustc-check-cfg=cfg(evaluate)");

if (target_os == "linux" && target_arch == "aarch64") || target_os == "windows" {
println!(
"cargo:warning=Skipping 'evaluate' cfg for {}-{}",
target_os, target_arch
);
if target_os == "windows" {
println!("cargo:warning=Skipping 'evaluate' cfg for {target_os}-{target_arch}");
} else {
println!(
"cargo:warning=Going to build with 'evaluate' cfg for {}-{}",
target_os, target_arch
"cargo:warning=Going to build with 'evaluate' cfg for {target_os}-{target_arch}"
);
println!("cargo:rustc-cfg=evaluate");
}
Expand Down
50 changes: 25 additions & 25 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
Expand Down Expand Up @@ -36,7 +36,7 @@

systems = [
"x86_64-linux"
# "aarch64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
Expand All @@ -51,7 +51,6 @@
}
// (lib.optionalAttrs (system == "x86_64-linux") {
blockfrost-platform-x86_64-windows = inputs.self.internal.x86_64-windows.package;
blockfrost-platform-aarch64-linux = inputs.self.internal.aarch64-linux.package;
});

devshells.default = import ./nix/devshells.nix {inherit inputs;};
Expand Down Expand Up @@ -113,9 +112,6 @@
)
// lib.genAttrs ["x86_64-windows"] (
targetSystem: import ./nix/internal/windows.nix {inherit inputs targetSystem;}
)
// lib.genAttrs ["aarch64-linux"] (
targetSystem: import ./nix/internal/linux-cross-arm64.nix {inherit inputs targetSystem;}
);

nixosModule = {
Expand All @@ -128,7 +124,7 @@
};

hydraJobs = let
crossSystems = ["x86_64-windows" "aarch64-linux"];
crossSystems = ["x86_64-windows"];
allJobs = {
blockfrost-platform = lib.genAttrs (config.systems ++ crossSystems) (
targetSystem: inputs.self.internal.${targetSystem}.package
Expand Down
12 changes: 3 additions & 9 deletions nix/devshells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ in {

imports = [
"${inputs.devshell}/extra/language/c.nix"
"${inputs.devshell}/extra/language/rust.nix"
];

commands = [
Expand All @@ -31,10 +30,11 @@ in {
name = "cardano-address";
package = internal.cardano-address;
}
{package = config.language.rust.packageSet.cargo;}
{package = pkgs.cargo-nextest;}
{package = pkgs.cargo-tarpaulin;}
{package = config.language.rust.packageSet.rust-analyzer;}
{package = internal.rustPackages.cargo;}
{package = internal.rustPackages.clippy;}
{package = internal.rustPackages.rust-analyzer;}
{
category = "handy";
package = internal.runNode "preview";
Expand Down Expand Up @@ -66,12 +66,6 @@ in {
includes = internal.commonArgs.buildInputs;
};

language.rust.packageSet =
internal.rustPackages
// {
clippy = internal.rustPackages.clippy-unwrapped;
};

env =
[
{
Expand Down
25 changes: 12 additions & 13 deletions nix/internal/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,18 @@ in
};

# Portable directory that can be run on any modern Darwin:
bundle =
(nix-bundle-exe-lib-subdir "${unix.package}/libexec/${unix.packageName}")
bundle = (nix-bundle-exe-lib-subdir "${unix.package}/libexec/${unix.packageName}")
.overrideAttrs (drv: {
name = unix.packageName;
buildCommand =
drv.buildCommand
+ ''
mkdir -p $out/libexec
mv $out/{${unix.packageName},lib} $out/libexec
mkdir -p $out/bin
( cd $out/bin ; ln -s ../libexec/${unix.packageName} ./ ; )
'';
});
name = unix.packageName;
buildCommand =
drv.buildCommand
+ ''
mkdir -p $out/libexec
mv $out/{${unix.packageName},lib} $out/libexec
mkdir -p $out/bin
( cd $out/bin ; ln -s ../libexec/${unix.packageName} ./ ; )
'';
});

bundle-testgen-hs = nix-bundle-exe-lib-subdir (lib.getExe unix.testgen-hs);

Expand Down Expand Up @@ -427,7 +426,7 @@ in
};
buildInputs = with pkgs; [apple-sdk_11 (darwinMinVersionHook "11.0") darwin.libffi];
hardeningDisable = ["strictoverflow"]; # -fno-strict-overflow is not supported in clang on darwin
NIX_CFLAGS_COMPILE = ["-Wno-error=deprecated-declarations" "-Wno-error=cast-of-sel-type"];
NIX_CFLAGS_COMPILE = ["-Wno-error=deprecated-declarations" "-Wno-error=cast-of-sel-type" "-Wno-error=cast-function-type-mismatch"];
preBuild =
commonPreBuild
+ ''
Expand Down
Loading