Yeah sorry about the threadjacking lol! I do believe it’s better to get these issues out in the open though, so thanks for understanding!
You might want to do a CTRL-refresh or whatever it takes to clear the cache and see if you’re getting the same problem as I’ve done some changes over the last few days including one where a link was to “beginner” instead of “basic” so that fixed one link, plus I noticed the sample code had #[hdk_extern] in it already but the tutorial was telling you to add it, so I thought the best thing to do was to remove it from the sample code and keep to what the tutorial was saying - perhaps you were caught up in the middle of those changes hence why it’s even more confusing!!
As for the error, I’ll let someone else far more knowledgeable than me respond to that, I haven’t tested mine since a few days ago before I started playing with the tutorial text as I noticed some inconsistencies that I wanted to iron out.
Yeyyyyy this is so awesome Thank you both for the feedback and engaging, my hope has always been that the gym can be co-created at the rate that we all learn about holochain and work together, so seeing this is really great.
So yes, as @stephenpurkiss said you need to CTRL+R to clear the cache and then links should work as intended (I disabled the cache this past week so new versions won’t have that problem).
Yes, #[hdk_extern] should be in the code to expose it to the outer world, I’ll fix that, although the tryorama error seems to be about sth else. Let me take a look.
No, don’t “fix that” lol - I took it out because it was in there and the tutorial teaches you to put it in there but it was already in there. So we DON’T want it in there, unless you want to change the entire tutorial to remove teaching you to put it in there.
Noo, @wwo is talking about the solution branch, which should contain the working solution for the exercise. The tutorial assumes you are working from the master branch, where that is not there.
Mmm that’s actually not the way that the developer exercises are meant to be run. You just need to run nix-shell wherever there is a default.nix file to get a full working environment with holochain and hc installed. This is also necessary to work with multiple holochain versions.
So, no need to clone and install from the core repository, if you follow the instructions in the readme of each gym exercise you should be able to get everything you need.
I am on a Mid-2012 MacBook Pro 15 Retina MacOS Catalina 10.15.7. It’s too old to update to latest MacOS but I see that isn’t working anyway right now lol
./run_tests didn’t work for me, didn’t find hc so I tried @wwo’s link above, which seems to me to reinstall but also looks like it might set up hc. It’s currently horribly breaking and I’ve just seen @guillemcordoba’s reply so maybe he knows why hc is not found… cos I followed the instructions But I guess it could be MacOS specific, I do have an old X200 LibreBoot but it’s a bit loud and old and even slower than this hah.
[nix-shell:~/Holoplay/developer-exercises/basic/0.entries]$ ./run_tests --verbose
./run_tests: line 2: hc: command not found
[nix-shell:~/Holoplay/developer-exercises/basic/0.entries]$ hc
bash: hc: command not found
[nix-shell:~/Holoplay/developer-exercises/basic/0.entries]$ sudo hc
Password:
sudo: hc: command not found
[nix-shell:~/Holoplay/developer-exercises/basic/0.entries]$ holochain --version
holochain 0.0.100
[nix-shell:~/Holoplay/developer-exercises/basic/0.entries]$ holochain dna pack workdir && cd tests/ && npm install && npm test && cd ..
error: Found argument 'dna' which wasn't expected, or isn't valid in this context
USAGE:
holochain [FLAGS] [OPTIONS]
For more information try --help
to compile my code, after running it previously and coming up with lots of errors that it couldn’t find core so then I figured out I’d forgotten to run holonix and that’s when I compiled it and it all went green and I was like “omg this is AMAZING!!!”. Then I tried to run the tests and it said it couldn’t find hc.
No yeah, but actually https://holochain.love is broken. This is why we are moving towards nix files and local setups rather than relying on changing external URLs. holochain.love is still pointing to a time where hc didn’t exist.
Being in a nix shell doesn’t mean having the right holochain dependencies installed. Think about the nix-shell as an environment builder: you can build full-fledged environments with all the dependencies you want there, only with a default.nix file. Depending on which default.nix file you execute, you’ll be in an environment or another.
Ah, OK, so I didn’t know there was a difference between what I was doing typing holonix as it was in the setup guide as a shortcut to getting things up and running.
I set up holonix because in the first paragraph of the setup guide, the highlighted paragraph, it says:
…now I don’t know what you think on this subject but I reckon anyone who is reading the setup guide probably likes tinkering, and probably likes saving time, so perhaps it might be good to change the setup guide for the gym, or the setup guide itself to say “oh by the way, DON’T DO THIS”.
OK I’m just getting loads of errors now after typing nix-shell in the right directory so I’ve probably messed up my setup and will spend some time reinstalling. I’m close to putting Linux back on this mac to make life easier but I’m using it for Zoom and y’know, dual booting etc. I’ll just end up spending lots of time when I guess lots of people will be using macs and so will keep on this for the mo.
In case there’s anything recognisable I’m posting the errors below, I’ll try again after reinstalling.
Compiling const-random-macro v0.1.13
Compiling security-framework v2.1.1
error: linking with `/nix/store/sw7b2gcklaj3iy5ikv7ag163bpry3ivb-clang-wrapper-7.1.0/bin/cc` failed: exit code: 1
|
= note: "
---
= note: ld: library not found for -liconv
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
error: could not compile `const-random-macro`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
builder for '/nix/store/gjds6y8dgzkymh0sh9bd22h04ffc1h7h-holochain.drv' failed with exit code 101
error: build of '/nix/store/gjds6y8dgzkymh0sh9bd22h04ffc1h7h-holochain.drv', '/nix/store/rv1q1h55jpjdacz572pc2bk4yg4g5m69-holochain.drv' failed
I did try this exercise again now, and it is working. ( I am on linux)
These are my steps:
1- I just have installed nix-shell (Nix) 2.3.10
2- I cloned the exercise and then in this folder run nix-shell here:
which is another issue being discussed on this forum, not sure why a link to this forum didn’t turn up but here’s the link, perhaps it’s not just a problem with Big Sur then cos my laptop’s too old for it!