-
Notifications
You must be signed in to change notification settings - Fork 12
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
pack: added TCM file packaging #1092
base: master
Are you sure you want to change the base?
Conversation
b4b5da6
to
9f99d09
Compare
76aa1a8
to
1ab11af
Compare
cli/cmdcontext/cmdcontext.go
Outdated
@@ -104,6 +110,8 @@ type CliCtx struct { | |||
Verbose bool | |||
// TarantoolCli is current tarantool cli. | |||
TarantoolCli TarantoolCli | |||
// Tcmcli is current tcm cli. | |||
TcmCli |
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.
TcmCli | |
TcmCli TcmCli |
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.
Done
3688b87
to
c0e4502
Compare
c0e4502
to
891c97e
Compare
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.
Thank you for the patch! LGTM.
891c97e
to
da217d8
Compare
cli/configure/configure.go
Outdated
return "", fmt.Errorf(`found Tcm binary '%s' isn't executable: %s`, | ||
localTcm, err) |
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.
May be here need wrapping an error?
return "", fmt.Errorf(`found Tcm binary '%s' isn't executable: %s`, | |
localTcm, err) | |
return "", fmt.Errorf(`found Tcm binary '%s' isn't executable: %w`, | |
localTcm, err) |
cli/configure/configure.go
Outdated
|
||
cmdCtx.Cli.TcmCli.Executable = localTcm | ||
} else if !os.IsNotExist(err) { | ||
return "", fmt.Errorf("failed to get access to Tcm binary file: %s", err) |
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.
Wrapping?
return "", fmt.Errorf("failed to get access to Tcm binary file: %s", err) | |
return "", fmt.Errorf("failed to get access to Tcm binary file: %w", err) |
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 comment.I took an example of the error above in the code
cli/pack/common.go
Outdated
} else { | ||
if err := util.CopyFileDeep(cmdCtx.Cli.TcmCli.Executable, | ||
util.JoinPaths(pkgBin, "tcm")); err != nil { | ||
return fmt.Errorf("failed copying tarantool: %s", err) |
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.
return fmt.Errorf("failed copying tarantool: %s", err) | |
return fmt.Errorf("failed copying tarantool: %w", err) |
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 comment.I took an example of the error above in the code
da217d8
to
7125c3e
Compare
cli/configure/configure.go
Outdated
|
||
if _, err := os.Stat(localTcm); err == nil { | ||
if _, err := exec.LookPath(localTcm); err != nil { | ||
return "", fmt.Errorf(`found Tcm binary '%s' isn't executable: %s`, |
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.
"%q" format do the quoting.
return "", fmt.Errorf(`found Tcm binary '%s' isn't executable: %s`, | |
return "", fmt.Errorf(`found Tcm binary %q isn't executable: %s`, |
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.
Done
cli/configure/configure.go
Outdated
|
||
cmdCtx.Cli.TcmCli.Executable = localTcm | ||
} else if !os.IsNotExist(err) { | ||
return "", fmt.Errorf("failed to get access to Tcm binary file: %s", err) |
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.
return "", fmt.Errorf("failed to get access to Tcm binary file: %s", err) | |
return "", fmt.Errorf("failed to get access to TCM binary file: %s", err) |
return "", fmt.Errorf("failed to get access to Tcm binary file: %s", err) | |
return "", fmt.Errorf("failed to get access to tcm binary file: %s", err) |
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.
Done
cli/configure/configure.go
Outdated
return "", fmt.Errorf("failed to get access to Tcm binary file: %s", err) | ||
} | ||
|
||
log.Debugf("tcm executable found: '%s'", cmdCtx.Cli.TcmCli.Executable) |
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.
log.Debugf("tcm executable found: '%s'", cmdCtx.Cli.TcmCli.Executable) | |
log.Debugf("tcm executable found: %q", cmdCtx.Cli.TcmCli.Executable) |
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.
Done
// Copy tcm. | ||
if packCtx.WithBinaries { |
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.
Please, add test cases into Test_prepareBundle
in the common_test.go
.
test/integration/pack/test_pack.py
Outdated
@@ -787,6 +787,7 @@ def test_pack_tgz_compat_with_binaries(tt_cmd, tmp_path): | |||
|
|||
assert os.path.isfile(os.path.join(app_path, "tt")) | |||
assert os.path.isfile(os.path.join(app_path, "tarantool")) | |||
assert os.path.isfile(os.path.join(app_path, "tcm")) |
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.
To be honest, I don't understand where this file came from? I don't see any "tcm" file is created.
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 cleared it, this line is superfluous here.Verification added on line 1017
CHANGELOG.md
Outdated
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |||
|
|||
### Added | |||
|
|||
- `tt pack `: added TCM file packaging |
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.
- `tt pack `: added TCM file packaging | |
- `tt pack `: added TCM file packaging. |
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.
Done
ac8f675
to
10af852
Compare
Closes #TNTP-1097
10af852
to
8b4e868
Compare
pack: added TCM file packaging
Closes #TNTP-1097