algorand / algorand/go-algorand

make install needs to be simplified.

未关闭
#3,914 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Medium Priority Team Hyper Flow
主要语言
Go
星标
1.4k
派生
537
平均合并
1 天 7 小时
30 天内合并 PR
18

描述

### Subject of the issue

While briefly investigating #3913 it became clear that our scripts are an unstable foundation. This has been brought up before with #2131, but I'd like to make a more concrete suggestion for how to start.

While trying to figure out where build flags come from I went through the exercise of reviewing the call tree and was surprised by what I found:

1. `make install` depends on build, but lets ignore that for a moment.
* `build`: is an alias for `buildsrc`
* `buildsrc` depends on libsodium and some scripts
* finally `go install` is called with some flags which change based on the architecture.
2. `make install` calls `scripts/dev_install.sh`
3. `dev_install.sh` is a 30 line script which simply calls `scripts/local_install.sh`
4. `local_install.sh` is a 70 line script that does little more than call `scripts/build_package.sh`.
* It also inexplicably calls `update.sh` depending on what environment variables are set, which would download external binaries for no reason.
5. `build_package.sh` which calls "scripts/build_prod.sh"
* after calling `build_prod.sh`, it inexplicably copies binaries into `./tmp/dev_pkg`
6. `build_prod.sh` is a 20 line script with literally one line that isn't a comment.
* it calls `make build` which the Makefile has already called.

These sorts of issues cause all downstream items to be complicated including:
* testing
* continuous integration
* docker containers
* releases

# First steps

1. remove `build` and `install` targets.
2. rename `buildsrc` to `install`.

# Acceptance Criteria

Acceptance criteria is in the first steps above (but also search for uses of the targets).

If feeling ambitious, go deeper to simplify the build scripting. Consider build recipe to create build targets up front, as opposed to recalculation in between steps. However, this is just a stepping stone.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。