-
Notifications
You must be signed in to change notification settings - Fork 240
fixes #1564 usr home #1582
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
fixes #1564 usr home #1582
Conversation
debarshiray
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request, @sumantro93 !
The code is failing to compile with:
# github.com/containers/toolbox/cmd
cmd/utils.go:30:2: user redeclared in this block
cmd/utils.go:28:2: other declaration of user
cmd/utils.go:30:2: "os/user" imported and not used
cmd/create.go:308:2: declared and not used: homeDir
cmd/create.go:309:2: declared and not used: resolvedPath
cmd/create.go:309:45: undefined: HomeDir
cmd/create.go:476:15: undefined: homeDirMountArg
cmd/initContainer.go:270:21: undefined: user
cmd/initContainer.go:580:15: undefined: user
cmd/run.go:445:17: assignment mismatch: 1 variable but user.Current returns 2 values
debarshiray
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some things that I noticed that could help with getting the code to compile:
src/cmd/utils.go
Outdated
| "fmt" | ||
| "io" | ||
| "os" | ||
| "os/user" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet this line is causing:
cmd/utils.go:30:2: user redeclared in this block
cmd/utils.go:28:2: other declaration of userThe code was already importing os/user a few lines below, so no need to import it again. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you removed both imports, and it's causing:
cmd/utils.go:333:38: undefined: user| "fmt" | ||
| "io/ioutil" | ||
| "os" | ||
| "os/user" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet this line is causing:
cmd/initContainer.go:270:21: undefined: user
cmd/initContainer.go:580:15: undefined: userWhy did you remove the import of os/user?
| "errors" | ||
| "fmt" | ||
| "os" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: stray newline.
debarshiray
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, a few things about the Git metadata.
Could you please try to squash the commits into logical units that successfully build and pass the tests, instead of a series of fix-up commits? See the other commits for examples. It's possible that for this pull request there will be only one commit.
Could you please add a link to the GitHub issue at the bottom of the commit message like in the other commits?
Could you please use your full name for the commit? One way to do this is to set the GIT_AUTHOR_NAME and GIT_COMMITTER_NAME environment variables.
debarshiray
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still failing to build:
# github.com/containers/toolbox/cmd
cmd/utils.go:333:38: undefined: user
cmd/create.go:308:2: declared and not used: homeDir
cmd/create.go:309:2: declared and not used: resolvedPath
cmd/create.go:309:45: undefined: HomeDir
cmd/create.go:476:15: undefined: homeDirMountArg
cmd/run.go:445:17: assignment mismatch: 1 variable but user.Current returns 2 values| logrus.Errorf("Failed to get HOME directory: %v", err) | ||
| } | ||
| homeDir := user.HomeDir | ||
| resolvedPath, err := filepath.EvalSymlinks(HomeDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be homeDir, not HomeDir. This is causing:
cmd/create.go:308:2: declared and not used: homeDir
cmd/create.go:309:45: undefined: HomeDir|
Hi @debarshiray, I started using toolbox few days back and ran into the same issue this PR is trying to fix. |
Okay, I'm just reading this comment. I will squash all the changes in my new PR. |
Hey! I apologize that I didn't respond earlier. I started working on a branch to isolate the host's Are you looking for newcomer-friendly issues to work on? If so, please reach out to me via email and I can point you to some. Once again, sorry for the late response; and thanks for stopping by and playing with Toolbx. |
|
Closing in favour of #1667 |
Add fixes for 1564