Closed nphias closed 3 months ago
Hi there @nphias, thank you for reporting this issue.
I assumed that the scaffolding tool is bundled with hc and no other installation procedure was needed
The scaffolding tool is indeed bundled with holonix
, and hc
will execute hc-scaffold
when you run hc scaffold
, provided it's installed in the current environment. This should be the case if you are using Nix.
It appears the version of the scaffolding tool you're using (holochain_scaffolding_cli 0.0.4
) is quite outdated. I'm curious to know which version of holonix
you are running on your existing project. Could you please share your nix.flake
file so I can investigate this further?
{
inputs = {
nixpkgs.follows = "holonix/nixpkgs";
versions.url = "github:holochain/holochain/holochain-0.4.0-dev.12?dir=versions/weekly";
holonix.url = "github:holochain/holochain/holochain-0.4.0-dev.12";
holonix.inputs.versions.follows = "versions";
holonix.inputs.holochain.url = "github:holochain/holochain/holochain-0.4.0-dev.12";
};
outputs = inputs@{ holonix, ... }:
holonix.inputs.flake-parts.lib.mkFlake { inherit inputs; } {
# provide a dev shell for all systems that the holonix flake supports
systems = builtins.attrNames holonix.devShells;
perSystem = { config, system, pkgs, ... }:
{
devShells.default = pkgs.mkShell {
inputsFrom = [ holonix.devShells.${system}.holochainBinaries ];
packages = with pkgs; [
# add further packages from nixpkgs
# nodejs
cargo-nextest
];
};
};
};
}
Thanks for sharing. Tried to reproduce this on my end, here are my findings:
0.4
version of scaffolding holochain_scaffolding_cli 0.4000.0-dev.13
when I run hc scaffold --version
. Not sure why you are getting a much older version. Could you try running nix flake update
and re-check?
{
inputs = {
# ...
holonix.inputs.scaffolding.url = "github:holochain/scaffolding/holochain-weekly";
};
# ...
hc-scaffold
. The prompt workflow has changed from what you described above. I think solving the version of scaffolding should be first step in solving this.yes deleted the flake.lock file
added the override you suggested
did nix flake update
same verson output holochain_scaffolding_cli 0.0.4
ill try gc/clean on my nix cache/store.. pretty sure i did that recently :/
I think the issue is that you're only depending on the holochainBinaries
in your flake.nix
. I copied your flake.nix
and ran nix develop
with it and didn't give me the hc-scaffold
binary. I bet your hc-scaffold
binary is a system-wide old installation of the scaffolding tool. What's the output when you run which hc-scaffold
? If that path is outside the /nix/store
, that's the issue.
Good catch @guillemcordoba. It seems the scaffolding version that get's printed out is outside /nix/store
. On uninstalling it and re-running hc scaffold --version
inside the nix shell, I get Failed to run external subcommand: Os { code: 2, kind: NotFound, message: "No such file or directory" }
and hc-scaffold: command not found
.
I guess holochain_scaffolding_cli
is not part of the holochainBinaries?
Exactly. It's part of the holonix devshell which is the default in most projects.
oh crap .. thanks @guillemcordoba @c12i .. i was using a random flake file.. yes it was using an old version in my ~/.cargo/bin folder. my bad closing this
using nix 2.23 holochain / hc 0.4.0-dev12
note: I assumed that scaffolding tool is bundled with
hc
and no other installation procedure was needed runninghc-scaffold --version
andhc scaffold --version
in thenix develop env
i getholochain_scaffolding_cli 0.0.4
I tried running the scaffold tool on an existing project. it created a coordinator zome in my crates directory, updated root cargo.toml and the project dna.yaml but failed to create the integrity zome even though it claimed it had been scaffolded.. and then crashed with no error message It also messed with my root cargo.toml adding a bunch of other dependencies and old versions of the hdi,hdk