Questions about packaging package-v0.0.9-linux-amd64.tar.gz

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: package-v0.0.9-linux-amd64.tar.gz 打包疑问

| username: 边城元元

[TiDB Usage Environment] Testing/
[TiDB Version] 8.1.0

[Encountered Problem: Problem Phenomenon and Impact]

Today, I encountered an issue with building the tiup package.

  1. The makefile does not include a build for this package.
  2. The pack compiled from GitHub - pingcap/tiup: A component manager for TiDB release-1.15.1’s server/package/package.go differs significantly in file size from the pack in the tidb-community-toolkit-v8.1.0-linux-amd64 package’s package-v0.0.9-linux-amd64.tar.gz.
| username: Kongdom | Original post link

The official deployment package file is .gz, it should be compressed, right?

| username: 边城元元 | Original post link

The official package-v0.0.9-linux-amd64.tar.gz, after extraction, is:
pack 11,150KB 2020/4/18 13:23

The one I packaged:
tiup-pack 5,116KB

Both are binary files. The official build time is 2020/4/18 13:23 and it is much larger than my tiup-pack.

| username: zhaokede | Original post link

The compression rates are different, right?

| username: Kongdom | Original post link

:thinking: Could it be due to different packaging methods? I haven’t built TiDB, but when I build other projects, the results my colleagues and I get often have different sizes.

| username: 边城元元 | Original post link

It should be the packaging method or the source version of the package that is inconsistent. The build time of the official pack file is 2020/4/18. Now I want to understand how this was packaged.

Attached is a comparison chart:

| username: Billmay表妹 | Original post link

The official instructor’s introduction: The current version of the tiup software package no longer requires the use of the package command to package it. Any method that creates a tar.gz file will work, so it will no longer be updated.

| username: 友利奈绪 | Original post link

Because it’s no longer needed, so it’s not being updated, right?

| username: 边城元元 | Original post link

Thanks, billmay.
After verification, the following two commands are equivalent and can both install custom components.
Method 1: tiup package hi --name=hi --entry=hi --release=v0.1

Method 2: tar -C bin -czf package/hi-0.1-linux-amd64.tar.gz hi

In the future, you can directly use tar to package it.

| username: 鱼跃龙门 | Original post link

There is no need for the package command anymore, just a tar.gz file will suffice.