Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

writing to STDOUT in .bashrc causes hc package to fail #2097

Open
pdaoust opened this issue Feb 4, 2020 · 2 comments · May be fixed by #2108
Open

writing to STDOUT in .bashrc causes hc package to fail #2097

pdaoust opened this issue Feb 4, 2020 · 2 comments · May be fixed by #2108
Labels
bug Something isn't working usability Useless Error Message An unhelpful error message was returned

Comments

@pdaoust
Copy link
Collaborator

pdaoust commented Feb 4, 2020

Because hc package spawns a new bash process, it runs .bashrc. If the user has anything that writes to STDOUT in their .bashrc file, that output gets captured by hc package. AFAICT this doesn't matter until it comes time to check for the existence of the build artifact, when the output gets incorporated into the expected artifact's path. (It might cause issues elsewhere too, but I'm not sure.)

Steps to reproduce:

  1. Add the line echo "***hello***" somewhere in your .bashrc
  2. Enter the nix shell: nix-shell https://holochain.love
  3. Generate a stub project:
    hc init stub-project
    cd stub project
    hc generate zomes/stub-zome
  4. Try to build: hc package
  5. Witness error message:
    Error: Couldn't traverse DNA in directory "/home/alice/Holochain/stub-project": artifact path /home/alice/Holochain/stub-project/zomes/stub-zome/code/***hello***
    /home/alice/target/wasm32-unknown-unknown/release/stub-zome.wasm either doesn't point to a file or doesn't exist
    

The developer who reported this argues that it's a common thing to echo stuff in your .bashrc (I'd be inclined to agree). This has a direct impact on any dev who is trying Holochain for the first time; it's a red herring error message.

@harlantwood
Copy link
Contributor

harlantwood commented Feb 5, 2020

Probably we could/should spawn a new bash shell in a way that doesn’t load .bashrc or similar config files…

Maybe this is helpful: https://stackoverflow.com/questions/9357464/how-to-start-a-shell-without-any-user-configuration

@pdaoust
Copy link
Collaborator Author

pdaoust commented Feb 5, 2020

@harlantwood , you are a king among men. Thank you for sleuthing this for us!

@pdaoust pdaoust linked a pull request Feb 12, 2020 that will close this issue
1 task
pdaoust added a commit that referenced this issue Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working usability Useless Error Message An unhelpful error message was returned
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants