Closed cgahr closed 6 months ago
Sorry I'm just seeing this! I don't develop on nix - but I'm guessing something with the flake.nix
file isn't including the libs directory
You probably missed my last edit :) I could reproduce this issue on a non nixos too!
You're right - I did miss the edit! Can you try this:
git clone https://github.com/mattwparas/steel.git &&
cd steel &&
mkdir -p .steel/cogs && mkdir -p .steel/native && # Creates this directory too
export STEEL_HOME="$(pwd)/.steel" &&
cargo build &&
cargo install --path crates/cargo-steel-lib &&
pushd cogs &&
cargo run -- install.scm &&
popd &&
cargo test --all
I had thought that I would create that additional directory automatically; but it seems like I don't!
This seems to give me the same error as before:
Package is not currently installed.
=> Installing: '#hash((package-name . slack/websocket) (dependencies . ('#hash((#:path . "../libs/steel-websockets") (#:name . steel-websockets)) '#hash((#:name . steel-webrequests) (#:path . "../libs/steel-webrequests")))) (version . "0.1.0") (path . "/home/cgahr/coding/steel/tmp/steel/cogs/slack"))
=> Copied package over to: /home/cgahr/coding/steel/tmp/steel/.steel/cogs/slack/websocket
=> Installing: '#hash((dependencies . ()) (version . "0.1.0") (dylibs . ('#hash((#:name . "steel-websockets") (#:workspace-root . "../..") (#:subdir . "libs/steel-websockets")))) (path . "../libs/steel-websockets") (package-name . steel-websockets))
=> Copied package over to: /home/cgahr/coding/steel/tmp/steel/.steel/cogs/steel-websockets
Attempting to install: '#hash((#:name . "steel-websockets") (#:workspace-root . "../..") (#:subdir . "libs/steel-websockets"))
Running dylib build in: ../libs/steel-websockets/../../libs/steel-websockets
error[E03]: TypeMismatch
┌─ install.scm:11:1
│
11 │
│ Struct getter expected Ok, found Gc(UserDefinedStruct { fields: [Error: Io: No such file or directory (os error 2)], type_descriptor: StructTypeDescriptor(1) }), (Err Error: Io: No such file or directory (os error 2))
Okay so I'm realizing there might be more that needs to be done. In order to install dylibs we'll need the dylib installer which is installed separately as a cargo extension (eventually it doesn't need to be) - that is located under crates/cargo-steel-lib
. Can you first try to install that with cargo install --path crates/cargo-steel-lib
and then run the installer?
Apologies that this is all undocumented; this one slipped past me I think. There could be other things that I'm missing as well but that would be the first step to try debugging this
Don't worry, as much is expected! So far, I enjoy steel very much. Looking forward to build helix plugins with it!
I'll keep you posted.
EDIT: I got is working! I think the issue stems from ~/.cargo/bin
not being in my path. Hence, installing cargo-steel-lib
went fine but it couldn't be found afterward. So in the end, this problem only exists for nix and on systems where ~/.cargo/bin
is not on the path.
If it is okay for you, I'll create a PR updating flake.nix
so that everything just works and close this issue then.
That sounds great! Thank you for investigating, I really appreciate it.
In the future I will most likely remove the need for cargo-steel-lib
at all in the installation process and expose all of that behavior in steel itself to make things simpler, one less thing to need installed
Okay so I'm realizing there might be more that needs to be done. In order to install dylibs we'll need the dylib installer which is installed separately as a cargo extension (eventually it doesn't need to be) - that is located under
crates/cargo-steel-lib
. Can you first try to install that withcargo install --path crates/cargo-steel-lib
and then run the installer?Apologies that this is all undocumented; this one slipped past me I think. There could be other things that I'm missing as well but that would be the first step to try debugging this
Thanks, had similar problem, but not using nix, just plain ubuntu, this fixed it.
currently
nix build
andnix shell
does not work.Running either command errors with
This is easily fixable by updating
flake.lock
(i.e. callingnix flake update
).After updating,
nix build
andnix shell
now fails with aSteelErr
with messagefull output
PS: the
popd
in line 41 inflake.nix
seems to throw an error too, see the last line of the logEDIT: I investigated this further. This is not a
nix flake
error! Instead this seems to originate from runningcargo run -- install.scm
fromcontributing.scm
too! To me it looks likesteel-websockets
orsteel-regex
fails to install (depending on which machine I use)