-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Update from-source.zh-cn.md
& from-source.en-us.md
- Cross Compile Using Zig
#25194
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
Conversation
Install cc¹ ²Install cc $ gcc
Command 'gcc' not found, but can be installed with:
sudo apt install pentium-builder
sudo apt install gcc
mx@ef:~/3rd-dev/gitea-npm--1.19.3
$ sudo apt install gcc
[sudo] mx 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
建议安装:
gcc-multilib autoconf automake libtool flex bison gdb gcc-doc
下列【新】软件包将被安装:
gcc
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 212 个软件包未被升级。
需要下载 5,192 B 的归档。
解压缩后会消耗 46.1 kB 的额外空间。
获取:1 http://deb.debian.org/debian bullseye/main amd64 gcc amd64 4:10.2.1-1 [5,192 B]
已下载 5,192 B,耗时 6秒 (882 B/s)
正在选中未选择的软件包 gcc。
(正在读取数据库 ... 系统当前共安装有 297827 个文件和目录。)
准备解压 .../gcc_4%3a10.2.1-1_amd64.deb ...
正在解压 gcc (4:10.2.1-1) ...
正在设置 gcc (4:10.2.1-1) ...
正在处理用于 man-db (2.9.4-2) 的触发器 ...
mx@ef:~/3rd-dev/gitea-npm--1.19.3
$
³ mx@ef:~/3rd-dev/gitea-npm--1.19.3
$ which cc
/usr/bin/cc
mx@ef:~/3rd-dev/gitea-npm--1.19.3
$ which gcc
/usr/bin/gcc
mx@ef:~/3rd-dev/gitea-npm--1.19.3
$
|
from-source.zh-cn.md
& from-source.en-us.md
- Cross Compile Using Zig
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.
Some nits including:
- The version like "0.10.1" should be general but not hard-coded.
- The "mingw/make" part could share a general document
- The Linux steps and Windows steps are pretty similar
❓ I don't have time to test it myself, if there is any exception, welcome to fix it
it should be removed
Meanwhile it's not bad to have such "zig cross compile" being document.
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 this PR, it's awesome to complie Gitea with zig. And I have some suggestions about tone.
@@ -1,5 +1,5 @@ | |||
--- | |||
date: "2016-12-01T16:00:00+02:00" | |||
date: "2023-06-11T16:00:00+02:00" |
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 think it's the time of creation, not the time of update.
- Download: https://ziglang.org/download/ | ||
- To install: | ||
```sh | ||
sudo rm -rf /usr/local/zig && tar -C /usr/local -xf zig-linux-x86_64-0.10.1.tar.xz | ||
``` | ||
- Environment variable: `export PATH=$PATH:/usr/local/zig-linux-x86_64-0.10.1/` | ||
- Install cc | ||
``` | ||
sudo apt install gcc | ||
which cc | ||
``` |
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.
Maybe
- Download: https://ziglang.org/download/ | |
- To install: | |
```sh | |
sudo rm -rf /usr/local/zig && tar -C /usr/local -xf zig-linux-x86_64-0.10.1.tar.xz | |
``` | |
- Environment variable: `export PATH=$PATH:/usr/local/zig-linux-x86_64-0.10.1/` | |
- Install cc | |
``` | |
sudo apt install gcc | |
which cc | |
``` | |
Follow [Getting Started of Zig](https://ziglang.org/learn/getting-started/#installing-zig) to install zig. |
is enough?
I don't think it's appropriate to introduce too much about "how to install zig" into Gitea's documentation.
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
TAGS="bindata sqlite sqlite_unlock_notify" \ | ||
make build | ||
``` | ||
❓ I don't have time to test it myself, if there is any exception, welcome to fix it |
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.
TBH, I don't think they are appropriate:
✅Proven success
✅Proven success (Gitea version 1.20.0-rc0,compiled 96.4M, select SQLite3 can be installed normally)
❓ I don't have time to test it myself, if there is any exception, welcome to fix it
It doesn't look like the official documentation for Gitea, it looks like a personal article ”How to compile Gitea with zig“. How about removing them? If someone get a exception, they will submit an issue.
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 love the community, I love you.
To install zig: | ||
- Download: https://ziglang.org/download/ | ||
- Decompress and set environment variables | ||
|
||
|
||
Make `GIT BASH` support make: | ||
- Go to https://sourceforge.net/projects/ezwinports/files/ and download `make-4.4.1-without-guile-w32-bin.zip` | ||
- Decompress the file | ||
- Copy all the extracted files to the git installation directory: . \Program Files\Git\mingw64\, merge the folders, and choose not to replace the files that pop up if they need to be replaced. | ||
- So that you can execute make in the git bash window (the compiler still needs to be installed separately when compiling) | ||
|
||
To make `GIT BASH` support make (second method): | ||
- Download: [https://github.com/niXman/mingw-builds-binaries](https://github.com/niXman/mingw-builds-binaries) | ||
- Copy mingw32-make.exe to `C:\Program Files\Git\mingw64\bin`, renamed make.exe |
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.
Ditto.
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
ps: I would improve the documents for development and building later, so these nits could be fixed later (my comment: #25194 (review)) The real block is that this PR fails the lint 😂 |
Compile & Cross Compile Gitea With CGO Dependencies Using Zig