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

fix: ~ in default config dir is not shell expanded #616

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@its-me-yours-truly
Copy link
Contributor

its-me-yours-truly commented Jan 4, 2019

The ~ (tilde) in the default config path is not interpreted correcly. If you take a look at the STRACE you see what is going on -> /home/john/Development/tenx/comit-rs/~/.config/comit_node/default is not a valid path and is not picked up / interpreted correctly, even though the config file is in ~/.config/comit_node as you can see!

This commit fixes that issue.

getcwd("/home/john/Development/tenx/comit-rs", 512) = 37
stat("/home/john/Development/tenx/comit-rs/~/.config/comit_node/default", 0x7ffc172b7220) = -1 ENOENT (No such file or directory)
stat("/home/john/Development/tenx/comit-rs/~/.config/comit_node/default.ini", 0x7ffc172b7220) = -1 ENOENT (No such file or directory)
stat("/home/john/Development/tenx/comit-rs/~/.config/comit_node/default.yaml", 0x7ffc172b7220) = -1 ENOENT (No such file or directory)
stat("/home/john/Development/tenx/comit-rs/~/.config/comit_node/default.yml", 0x7ffc172b7220) = -1 ENOENT (No such file or directory)
stat("/home/john/Development/tenx/comit-rs/~/.config/comit_node/default.json", 0x7ffc172b7220) = -1 ENOENT (No such file or directory)
stat("/home/john/Development/tenx/comit-rs/~/.config/comit_node/default.hjson", 0x7ffc172b7220) = -1 ENOENT (No such file or directory)
stat("/home/john/Development/tenx/comit-rs/~/.config/comit_node/default.toml", 0x7ffc172b7220) = -1 ENOENT (No such file or directory)
write(2, "Error: ", 7Error: )                  = 7
write(2, "configuration file \"~/.config/co"..., 59configuration file "~/.config/comit_node/default" not found) 
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
munmap(0x7f70ee748000, 8192)            = 0
exit_group(1)                           = ?
+++ exited with 1 +++

12:38:50 john@twister comit-rs ±| ✗|→ ls ~/.config/comit_node/
default.toml
12:39:02 john@twister comit-rs ±| ✗|→ 

@its-me-yours-truly
Copy link
Contributor Author

its-me-yours-truly left a comment

Made it work with TravisCI! Hopefully the build checks pass now!

@D4nte D4nte changed the title fix: ~ in default config dir is not unwrapped as bash would do fix: ~ in default config dir is not shell expanded Jan 4, 2019

@D4nte
Copy link
Member

D4nte left a comment

Good catch and thanks for the contribution! Few comments.

Show resolved Hide resolved application/comit_node/src/bin/comit_node.rs Outdated
Show resolved Hide resolved application/comit_node/Cargo.toml Outdated
Show resolved Hide resolved application/comit_node/src/bin/comit_node.rs Outdated
@D4nte

This comment has been minimized.

Copy link
Member

D4nte commented Jan 4, 2019

Hi,

Thank you for your contribution!

I have restarted the build, the failure is because there was an issue downloading one of docker image needed for the build:

docker: Error response from daemon: Get https://registry-1.docker.io/v2/ethereum/solc/manifests/0.4.24: Get https://auth.docker.io/token?scope=repository%3Aethereum%2Fsolc%3Apull&service=registry.docker.io: EOF.

Please note we intend to remove this docker image see #606.

Hopefully should be good now. I have made some comments.

@D4nte D4nte requested a review from comit-network/rust-devs Jan 4, 2019

@D4nte D4nte added the review label Jan 4, 2019

@D4nte

This comment has been minimized.

Copy link
Member

D4nte commented Jan 4, 2019

Hi @cagara, please be sure to run cargo make format or even better cargo make all locally before committing.

@its-me-yours-truly

This comment has been minimized.

Copy link
Contributor Author

its-me-yours-truly commented Jan 4, 2019

Will do @Cargo make format.
The Travis error, however, seems to be related to something else! :)

@D4nte

This comment has been minimized.

Copy link
Member

D4nte commented Jan 4, 2019

We seemed to be extremely unlucky today as at first docker.io was being unreliable. Then on the latest build it seems that bitcoind wasn't happy. Let's see now.

@D4nte
Copy link
Member

D4nte left a comment

Looks good. Please squash/fixup the commits into one or two as many of them are just named "Update comit_node.rs". Rebase interactively is the easiest way to do so.

@its-me-yours-truly its-me-yours-truly force-pushed the its-me-yours-truly:master branch from c38010d to 5ed0cfb Jan 5, 2019

@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Jan 5, 2019

CLA assistant check
All committers have signed the CLA.

@its-me-yours-truly its-me-yours-truly force-pushed the its-me-yours-truly:master branch 2 times, most recently from 9ed8976 to 141c515 Jan 5, 2019

@its-me-yours-truly its-me-yours-truly force-pushed the its-me-yours-truly:master branch 3 times, most recently from d2c1e82 to f7edbb4 Jan 5, 2019

@D4nte D4nte self-assigned this Jan 7, 2019

@D4nte D4nte added this to the Sprint 4 🎄🎅🏿 milestone Jan 7, 2019

@@ -3,6 +3,7 @@

#[macro_use]
extern crate log;
use directories;

This comment has been minimized.

@D4nte

D4nte Jan 7, 2019

Member

remove blank line between the use statements

@D4nte

This comment has been minimized.

Copy link
Member

D4nte commented Jan 9, 2019

@its-me-yours-truly happy to approve and merge once the blank line is removed to keep use statements in one block. Are you able to do it?
Again, thank you for your contribution!

@D4nte D4nte assigned thomaseizinger and unassigned D4nte Jan 15, 2019

@thomaseizinger

This comment has been minimized.

Copy link
Member

thomaseizinger commented Jan 15, 2019

Superseded by #648.

@wafflebot wafflebot bot removed the review label Jan 15, 2019

mergify bot added a commit that referenced this pull request Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment