Skip to content

Commit a94bee7

Browse files
committed
fix: linux install guide & add brew amd64 support
1 parent 551e739 commit a94bee7

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.github/workflows/brew_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz
5252
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz
5353
# Optional - booleans.
54-
# target_darwin_amd64: true
54+
target_darwin_amd64: true
5555
target_darwin_arm64: true
5656
# target_linux_amd64: true
5757
# target_linux_arm64: false

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
arch: darwin-arm64
2020
artifacts: "plc"
2121
RUSTFLAGS: ""
22+
- os: "macOS-latest"
23+
dir: osx64
24+
arch: darwin-amd64
25+
artifacts: "plc"
26+
RUSTFLAGS: ""
2227
- os: "ubuntu-latest"
2328
dir: linux64
2429
debdir: pivot-lang_0.1.0-1_amd64
@@ -161,6 +166,7 @@ jobs:
161166
version: 0.1.${{ github.run_number }} # refs/tags/v*.*.*
162167
arch: 'amd64'
163168
desc: 'pivot-lang compiler'
169+
depends: build-essential, git, libunwind-dev, libxml2
164170
- name: move deb
165171
if: ${{ matrix.config.os == 'ubuntu-latest' }}
166172
run: |

book/src/tutorial/installation.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
Pivot Lang存在两种不同的编译方案:
66
- 静态编译:编译器会将源码编译成一个可执行文件,能给在操作系统上原生运行
7-
- jit编译:编译器会将源码编译成一个字节码文件,然后在运行时使用编译器指令进行解释执行
7+
- ~~jit编译:编译器会将源码编译成一个字节码文件,然后在运行时使用编译器指令进行解释执行~~
8+
9+
```admonish warning
10+
目前jit模式暂时不可用,因为它与我们新的immix gc不兼容,详细情况请看[这里](../references/stackmap.md)
11+
```
812

913
目前这两种方案使用的编译器是同一个可执行文件(plc),然而他们在依赖和功能上存在一些差别,
1014
下方是一个简单的对比图:
@@ -20,6 +24,7 @@ Pivot Lang存在两种不同的编译方案:
2024
| 依赖预编译的pivot lang系统库 |||
2125
| 运行时优化 |||
2226
| 支持debug |||
27+
| stackmap支持 |||
2328

2429
可以看出,just in time模式的编译器依赖比静态编译少很多,因此如果你不需要debug功能,建议使用jit模式。如果你想要体验完整功能,建议使用静态编译。
2530

@@ -28,28 +33,33 @@ Pivot Lang存在两种不同的编译方案:
2833
TODO
2934

3035
## Linux
31-
目前我们对Ubuntu 20.04 LTS 和 Ubuntu 22.04 LTS提供了apt包。
36+
目前我们对架构为amd64的Ubuntu 20.04 LTS 和 Ubuntu 22.04 LTS提供了apt包。
3237
首先你需要添加我们的apt源的gpg key:
3338
```bash
34-
wget -O - https://apt.lang.pivotstudio.cn/public.key | sudo apt-key add -
39+
apt update
40+
apt install wget gnupg
41+
wget -O - https://apt.lang.pivotstudio.cn/public.key | apt-key add -
3542
```
3643
然后添加我们的apt源:
3744
```bash
38-
sudo add-apt-repository "deb [arch=amd64] https://apt.lang.pivotstudio.cn/repo focal main"
39-
sudo add-apt-repository "deb [arch=amd64] https://apt.lang.pivotstudio.cn/repo jammy main"
45+
echo "deb [arch=amd64] https://apt.lang.pivotstudio.cn/repo focal main
46+
# deb-src [arch=amd64] https://apt.lang.pivotstudio.cn/repo focal main
47+
deb [arch=amd64] https://apt.lang.pivotstudio.cn/repo jammy main
48+
# deb-src [arch=amd64] https://apt.lang.pivotstudio.cn/repo jammy main">/etc/apt/sources.list.d/pl.list
49+
apt update
4050
```
4151
最后安装pivot lang编译器:
4252
```bash
43-
sudo apt install pivot-lang
53+
apt install pivot-lang
4454
```
4555
你可以运行`plc`来检查是否安装成功。
4656

47-
请重启当前bash或者运行`source ~/.bashrc`来使环境变量生效。如果想安装`AOT`功能,请手动下载clang-14,下载方式见[此处](https://apt.llvm.org/)
48-
57+
安装完成后请按照提示设置环境变量
4958

5059

5160
## MacOS
52-
目前最新版MacOS(非英特尔芯片)上的编译器可以使用`homebrew`进行安装。
61+
62+
MacOS可以使用`homebrew`进行安装。
5363

5464
首先你需要添加我们的homebrew tap:
5565
```bash

0 commit comments

Comments
 (0)