Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggesting Edit: Hello World Tutorial - failing (no output file specified, not emitting output) #179

Closed
mitra42 opened this issue Jan 14, 2020 · 15 comments

Comments

@mitra42
Copy link

mitra42 commented Jan 14, 2020

Page URL: http://developer.holochain.org/docs/tutorials/coreconcepts/hello_world/

Demo's are still down ... hello_world has a huge discrepancy
It compiles, but reports that its not outputting anything, then complains about hello.wasm being missing. and also about failure to traverse DNA

    Finished release [optimized] target(s) in 16m 13s
> wasm-gc target/wasm32-unknown-unknown/release/hello.wasm
"wasm-gc target/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
> wasm-opt -Oz --vacuum target/wasm32-unknown-unknown/release/hello.wasm
"wasm-opt -Oz --vacuum target/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
(no output file specified, not emitting output)
> wasm2wat target/wasm32-unknown-unknown/release/hello.wasm -o target/wasm32-unknown-unknown/release/hello.wat
"wasm2wat target/wasm32-unknown-unknown/release/hello.wasm -o target/wasm32-unknown-unknown/release/hello.wat"
starting .bashrc
> wat2wasm target/wasm32-unknown-unknown/release/hello.wat -o target/wasm32-unknown-unknown/release/hello.wasm
"wat2wasm target/wasm32-unknown-unknown/release/hello.wat -o target/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
Error: Couldn't traverse DNA in directory "/Users/mitra/holo/core_concepts/cc_tuts": artifact path /Users/mitra/holo/core_concepts/cc_tuts/zomes/hello/code/starting .bashrc
target/wasm32-unknown-unknown/release/hello.wasm either doesn't point to a file or doesn't exist

[nix-shell:~/holo/core_concepts/cc_tuts]$ 
@mitra42
Copy link
Author

mitra42 commented Jan 14, 2020

Neither the code as it comes from the tutorial, nor that in "Check your code" work, same error on both. but for reference here are the differences ...

[nix-shell:~/holo/core_concepts/cc_tuts/test]$ diff -b index_followtutorial.js index_checkyourcode.js
0a1,4
> /// NB: The tryorama config patterns are still not quite stabilized.
> /// See the tryorama README [https://github.com/holochain/tryorama]
> /// for a potentially more accurate example
> 
2d5
< const tape = require('tape');
5d7
<   Config,
7,8c9
<   tapeExecutor,
<   singleConductor,
---
>   Config,
10,11c11,13
<   callSync,
< } = require('@holochain/try-o-rama');
---
>   localOnly,
>   tapeExecutor,
> } = require('@holochain/tryorama');
17a20,21
> const dnaPath = path.join(__dirname, '../dist/cc_tuts.dna.json');
> 
19,20c23,39
<   globalConfig: {
<     logger: false,
---
>   middleware: combine(
>     // use the tape harness to run the tests, injects the tape API into each scenario
>     // as the second argument
>     tapeExecutor(require('tape')),
> 
>     // specify that all "players" in the test are on the local machine, rather than
>     // on remote machines
>     localOnly,
>   ),
> });
> 
> const dna = Config.dna(dnaPath, 'cc_tuts');
> const config = Config.gen(
>   {
>     cc_tuts: dna,
>   },
>   {
23,24c42
<       sim2h_url: 'wss://0.0.0.0:9000',
<     }
---
>       sim2h_url: 'ws://localhost:9000',
26,31d43
<   middleware: combine(singleConductor, tapeExecutor(tape)),
< });
< 
< const config = {
<   instances: {
<     cc_tuts: Config.dna('dist/cc_tuts.dna.json', 'cc_tuts'),
33,40c45,48
< };
< 
< orchestrator.registerScenario("Test hello holo", async (s, t) => {
<   const { alice, bob } = await s.players({alice: config, bob: config}, true)
<   // Make a call to the `hello_holo` Zome function
<   // passing no arguments.
<   const result = await alice.call('cc_tuts', "hello", "hello_holo", {});
<   // Make sure the result is ok.
---
> );
> orchestrator.registerScenario('Test hello holo', async (s, t) => {
>   const {alice, bob} = await s.players({alice: config, bob: config}, true);
>   const result = await alice.call('cc_tuts', 'hello', 'hello_holo', {});
41a50
>   t.deepEqual(result, {Ok: 'Hello Holo'});
43,46c52,54
<   // Check that the result matches what you expected.
<   t.deepEqual(result, { Ok: 'Hello Holo' })
<   await s.consistency()
<   const create_result = await alice.call('cc_tuts', "hello", "create_person", {"person": { "name" : "Alice" }});
---
>   const create_result = await alice.call('cc_tuts', 'hello', 'create_person', {
>     person: {name: 'Alice'},
>   });
49,50c57,65
<   await s.consistency()
<   const retrieve_result = await alice.call('cc_tuts', "hello", "retrieve_person", {"address": alice_person_address });
---
> 
>   await s.consistency();
> 
>   const retrieve_result = await alice.call(
>     'cc_tuts',
>     'hello',
>     'retrieve_person',
>     {address: alice_person_address},
>   );
52c67,68
<   t.deepEqual(retrieve_result, { Ok: {"name": "Alice"} })
---
>   t.deepEqual(retrieve_result, {Ok: {name: 'Alice'}});
> 
54c70,75
<   const bob_retrieve_result = await bob.call('cc_tuts', 'hello', 'retrieve_person', {'address': alice_person_address },);
---
>   const bob_retrieve_result = await bob.call(
>     'cc_tuts',
>     'hello',
>     'retrieve_person',
>     {address: alice_person_address},
>   );
57,59c78,80
<   t.deepEqual(bobs_person, { "name": "Alice"});
< })
< orchestrator.run()
---
>   t.deepEqual(bobs_person, {name: 'Alice'});
> });
> orchestrator.run();

@freesig
Copy link
Contributor

freesig commented Jan 15, 2020

Were you able to update you .hcbuild file? I don't think there is anything wrong with the code in the tutorials. I will get a complete set of files at the end of each tutorial added asap

@mitra42
Copy link
Author

mitra42 commented Jan 15, 2020

I copied the code in #169 and get the same error
except now it has your CARGO_TARGET_DIR fields in it ...

    Finished release [optimized] target(s) in 14m 20s
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-opt -Oz --vacuum $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-opt -Oz --vacuum $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
(no output file specified, not emitting output)
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm2wat $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm2wat $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat"
starting .bashrc
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wat2wasm $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wat2wasm $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
Error: Couldn't traverse DNA in directory "/Users/mitra/holo/core_concepts/cc_tuts": artifact path /Users/mitra/holo/core_concepts/cc_tuts/zomes/hello/code/starting .bashrc
/Users/mitra/holo/core_concepts/cc_tuts/target/wasm32-unknown-unknown/release/hello.wasm either doesn't point to a file or doesn't exist

@mitra42
Copy link
Author

mitra42 commented Jan 15, 2020

Note there is no /tmp/my_first_app directory, but CARGO_TARGET_DIR is specified in env

[nix-shell:~/holo/core_concepts/cc_tuts]$ env | grep CARGO
CARGO_TARGET_DIR=/Users/mitra/holo/core_concepts/cc_tuts/target
CARGO_INCREMENTAL=1
export CARGO_HOME="$NIX_ENV_PREFIX/.cargo"
export CARGO_INSTALL_ROOT="$NIX_ENV_PREFIX/.cargo"
export CARGO_TARGET_DIR="$HC_TARGET_PREFIX/target"
export CARGO_CACHE_RUSTC_INFO=1
export PATH="$CARGO_INSTALL_ROOT/bin:$PATH"
CARGO_HOME=/Users/mitra/holo/core_concepts/cc_tuts/.cargo
CARGO_CACHE_RUSTC_INFO=1
CARGO_INSTALL_ROOT=/Users/mitra/holo/core_concepts/cc_tuts/.cargo

and directory exists ...

[nix-shell:~/holo/core_concepts/cc_tuts]$ ls -al ${CARGO_TARGET_DIR}
total 12
drwxr-xr-x  5 mitra staff  160 Jan 15 16:47 .
drwxr-xr-x 17 mitra staff  544 Jan 15 16:32 ..
-rw-r--r--  1 mitra staff 9210 Jan 15 16:47 .rustc_info.json
drwxr-xr-x  8 mitra staff  256 Jan 15 16:32 release
drwxr-xr-x  3 mitra staff   96 Jan 15 16:32 wasm32-unknown-unknown

@mitra42
Copy link
Author

mitra42 commented Jan 16, 2020

Thanks for posting the files @freesig - I cloned the hello_world branch from the Repo, ran sim2h_server in one terminal (under nix-shell) and ran hc test in the other, also under nix. Same error ...


[nix-shell:~/holo/cc_tuts]$ hc test
starting .bashrc
Packaging files for testing to file: "/Users/mitra/holo/cc_tuts/dist/cc_tuts.dna.json"
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && echo $CARGO_TARGET_DIR 
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && echo $CARGO_TARGET_DIR "
starting .bashrc
/Users/mitra/holo/cc_tuts/target
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && cargo build --release --target=wasm32-unknown-unknown --target-dir=$CARGO_TARGET_DIR
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && cargo build --release --target=wasm32-unknown-unknown --target-dir=$CARGO_TARGET_DIR"
starting .bashrc
    Finished release [optimized] target(s) in 0.79s
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-opt -Oz --vacuum $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-opt -Oz --vacuum $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
(no output file specified, not emitting output)
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm2wat $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm2wat $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat"
starting .bashrc
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wat2wasm $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wat2wasm $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wat -o $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/hello.wasm"
starting .bashrc
Error: Couldn't traverse DNA in directory "/Users/mitra/holo/cc_tuts": artifact path /Users/mitra/holo/cc_tuts/cc_tuts/zomes/hello/code/starting .bashrc
/Users/mitra/holo/cc_tuts/target/wasm32-unknown-unknown/release/hello.wasm either doesn't point to a file or doesn't exist

This is on a Mac, and I think since I'm running from nix-shell https://holochain.love in theory its the same environment as yours exactly ?

@freesig
Copy link
Contributor

freesig commented Jan 16, 2020

This is super odd. Did you reload the nix-shell recently?
I think something that could possibly be happening is the $CARGO_TARGET_DIR is set to the same place as your other version and there's some weird build files left over.
I would try deleting this directory /Users/mitra/holo/cc_tuts/target. Also make sure you exit and re-enter nix-shell https://holochain.love so it's up to date.

@mitra42
Copy link
Author

mitra42 commented Jan 16, 2020

I'm not sure what you mean by "reload". I have done nothing in terms of updating etc, I'm not sure how that works with nix, I'm presuming that the nix-shell itself requires consciously being updated, and then the nix-shell https://holochain.love supposedly brings in the exact same environment for everyone ? I reload in the sense of in a terminal window running that nix-shell https://holochain.love each time I do a test.

In terms of left over files, I renamed my old directory, cloned your repo (fresh directory) and then ran nix-shell in two windows in the cc_tuts directory. Running sim2h_server and hc test in thoe two windows. Its compeletely repeatable, could do screen share some point if you like. I'm on Australian timezone (19 hours ahead of US PT) and am often working in cafe's where bandwidth isn't great so best to schedule.

@mitra42
Copy link
Author

mitra42 commented Jan 21, 2020

I've updated nix - no change ...

29 days now, been stuck at this point in the tutorials since posting first bug at this point in #169 - just a sequence of bugs at the same point - not even able to run your git repo version of the tutorials :-(

@mitra42
Copy link
Author

mitra42 commented Jan 28, 2020

Just checking - should I give up on holo since without "hc" there is really no point ...

@mitra42
Copy link
Author

mitra42 commented Jan 28, 2020

@freesig - as I said elsehwere I'm more than happy to screenshare.

@freesig
Copy link
Contributor

freesig commented Jan 29, 2020

Hi @mitra42 there's been some transitions here and I've been moved into the develop team. I have less time to help with the docs but @pdaoust could help. I'm also on Australian time so if this is not resolved soon let's do a call.

@pdaoust
Copy link
Collaborator

pdaoust commented Jan 29, 2020

Hello @mitra42 ! Yes, I could take a look -- curious about what's going on. I'll be somewhat ignorant if the specific issue is macOS-related, but hopefully I can get some insight and feed it back to core dev.

@mitra42
Copy link
Author

mitra42 commented Jan 29, 2020

Thanks Paul, Matt Schutte mentioned your name on his way out the metaphorical door, but didn't give me contact info. I can do a screen share pretty much anytime you want. Not sure the best way to set that up, but I can be reached at mitra@mitra.biz and can send you other contact options if you ping me there.

@mitra42
Copy link
Author

mitra42 commented Feb 4, 2020

FYI - fixed with 15 mins with @pdaoust - looks like a bug in hc, where it can't handle .bashrc output anything on stdout.

@pdaoust
Copy link
Collaborator

pdaoust commented Feb 4, 2020

Turns out to be an issue with the way hc package spans a new bash process, which as @mitra42 says means that any .bashrc that echoes to STDOUT causes this to fail or at least think it failed. Tracking in holochain/holochain-rust#2097

@pdaoust pdaoust closed this as completed Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants