Skip to content

Commit 7d9ef6e

Browse files
authored
Fix wasm artifacts (#1499)
* put back emscripten 3.1.19 * add create-tolk-release.yml * filter out master branch only
1 parent e7e57f8 commit 7d9ef6e

6 files changed

+927
-2
lines changed

.github/workflows/build-ton-wasm-emscripten.yml

+19
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ jobs:
2525
chmod +x fift-func-wasm-build-ubuntu.sh
2626
./fift-func-wasm-build-ubuntu.sh -a
2727
28+
- name: Prepare test
29+
run: |
30+
cp assembly/wasm/*.fc .
31+
git clone https://github.com/ton-community/func-js.git
32+
cd func-js
33+
npm install
34+
npm run build
35+
npm link
36+
37+
- name: Test TON WASM artifacts
38+
run: |
39+
base64 -w 0 artifacts/funcfiftlib.wasm > artifacts/funcfiftlib.wasm.js
40+
printf "module.exports = { FuncFiftLibWasm: '" | cat - artifacts/funcfiftlib.wasm.js > temp.txt && mv temp.txt artifacts/funcfiftlib.wasm.js
41+
echo "'}" >> artifacts/funcfiftlib.wasm.js
42+
cp artifacts/funcfiftlib.wasm.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.wasm.js
43+
cp artifacts/funcfiftlib.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.js
44+
npx func-js stdlib.fc intrinsics.fc --fift ./output.f
45+
46+
2847
- name: Upload artifacts
2948
uses: actions/upload-artifact@master
3049
with:

.github/workflows/create-release.yml

+11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
workflow: build-ton-linux-arm64-appimage.yml
1818
path: artifacts
1919
workflow_conclusion: success
20+
branch: master
2021
skip_unpack: true
2122

2223
- name: Download and unzip Linux arm64 artifacts
@@ -25,6 +26,7 @@ jobs:
2526
workflow: build-ton-linux-arm64-appimage.yml
2627
path: artifacts
2728
workflow_conclusion: success
29+
branch: master
2830
skip_unpack: false
2931

3032
- name: Download Linux x86-64 artifacts
@@ -33,6 +35,7 @@ jobs:
3335
workflow: build-ton-linux-x86-64-appimage.yml
3436
path: artifacts
3537
workflow_conclusion: success
38+
branch: master
3639
skip_unpack: true
3740

3841
- name: Download and unzip Linux x86-64 artifacts
@@ -41,6 +44,7 @@ jobs:
4144
workflow: build-ton-linux-x86-64-appimage.yml
4245
path: artifacts
4346
workflow_conclusion: success
47+
branch: master
4448
skip_unpack: false
4549

4650
- name: Download Mac x86-64 artifacts
@@ -49,6 +53,7 @@ jobs:
4953
workflow: build-ton-macos-13-x86-64-portable.yml
5054
path: artifacts
5155
workflow_conclusion: success
56+
branch: master
5257
skip_unpack: true
5358

5459
- name: Download Mac arm64 artifacts
@@ -57,6 +62,7 @@ jobs:
5762
workflow: build-ton-macos-14-arm64-portable.yml
5863
path: artifacts
5964
workflow_conclusion: success
65+
branch: master
6066
skip_unpack: true
6167

6268
- name: Download and unzip Mac x86-64 artifacts
@@ -73,6 +79,7 @@ jobs:
7379
workflow: build-ton-macos-14-arm64-portable.yml
7480
path: artifacts
7581
workflow_conclusion: success
82+
branch: master
7683
skip_unpack: false
7784

7885
- name: Download Windows artifacts
@@ -81,6 +88,7 @@ jobs:
8188
workflow: ton-x86-64-windows.yml
8289
path: artifacts
8390
workflow_conclusion: success
91+
branch: master
8492
skip_unpack: true
8593

8694
- name: Download and unzip Windows artifacts
@@ -89,6 +97,7 @@ jobs:
8997
workflow: ton-x86-64-windows.yml
9098
path: artifacts
9199
workflow_conclusion: success
100+
branch: master
92101
skip_unpack: false
93102

94103
- name: Download WASM artifacts
@@ -97,6 +106,7 @@ jobs:
97106
workflow: build-ton-wasm-emscripten.yml
98107
path: artifacts
99108
workflow_conclusion: success
109+
branch: master
100110
skip_unpack: true
101111

102112
- name: Download Android Tonlib artifacts
@@ -105,6 +115,7 @@ jobs:
105115
workflow: build-ton-linux-android-tonlib.yml
106116
path: artifacts
107117
workflow_conclusion: success
118+
branch: master
108119
skip_unpack: true
109120

110121
- name: Show all artifacts
+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: Create tolk release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'tolk release and tag name'
8+
required: true
9+
10+
permissions: write-all
11+
12+
jobs:
13+
create-release:
14+
runs-on: ubuntu-22.04
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Download and unzip Linux arm64 artifacts
20+
uses: dawidd6/action-download-artifact@v6
21+
with:
22+
workflow: build-ton-linux-arm64-appimage.yml
23+
path: artifacts
24+
workflow_conclusion: success
25+
branch: master
26+
skip_unpack: false
27+
28+
- name: Download and unzip Linux x86-64 artifacts
29+
uses: dawidd6/action-download-artifact@v6
30+
with:
31+
workflow: build-ton-linux-x86-64-appimage.yml
32+
path: artifacts
33+
workflow_conclusion: success
34+
branch: master
35+
skip_unpack: false
36+
37+
- name: Download and unzip Mac x86-64 artifacts
38+
uses: dawidd6/action-download-artifact@v6
39+
with:
40+
workflow: build-ton-macos-13-x86-64-portable.yml
41+
path: artifacts
42+
workflow_conclusion: success
43+
branch: master
44+
skip_unpack: false
45+
46+
- name: Download and unzip arm64 artifacts
47+
uses: dawidd6/action-download-artifact@v6
48+
with:
49+
workflow: build-ton-macos-14-arm64-portable.yml
50+
path: artifacts
51+
workflow_conclusion: success
52+
branch: master
53+
skip_unpack: false
54+
55+
- name: Download and unzip Windows artifacts
56+
uses: dawidd6/action-download-artifact@v6
57+
with:
58+
workflow: ton-x86-64-windows.yml
59+
path: artifacts
60+
workflow_conclusion: success
61+
branch: master
62+
skip_unpack: false
63+
64+
- name: Download WASM artifacts
65+
uses: dawidd6/action-download-artifact@v6
66+
with:
67+
workflow: build-ton-wasm-emscripten.yml
68+
path: artifacts
69+
workflow_conclusion: success
70+
branch: master
71+
skip_unpack: true
72+
73+
- name: Show all artifacts
74+
run: |
75+
tree artifacts
76+
77+
78+
# create release
79+
- name: Get registration token
80+
id: getRegToken
81+
run: |
82+
curl -X POST -H \"Accept: application/vnd.github+json\" -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/ton-blockchain/ton/actions/runners/registration-token
83+
84+
- name: Create release
85+
id: create_release
86+
uses: actions/create-release@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
with:
90+
tag_name: ${{ inputs.tag }}
91+
release_name: ${{ inputs.tag }}
92+
draft: false
93+
prerelease: false
94+
95+
# upload
96+
97+
# win
98+
99+
- name: Upload Windows 2019 single artifact - tolk
100+
uses: svenstaro/upload-release-action@v2
101+
with:
102+
repo_token: ${{ secrets.GITHUB_TOKEN }}
103+
file: artifacts/ton-x86-64-windows/tolk.exe
104+
asset_name: tolk.exe
105+
tag: ${{ inputs.tag }}
106+
107+
# mac x86-64
108+
109+
- name: Upload Mac x86-64 single artifact - tolk
110+
uses: svenstaro/upload-release-action@v2
111+
with:
112+
repo_token: ${{ secrets.GITHUB_TOKEN }}
113+
file: artifacts/ton-x86_64-macos/tolk
114+
asset_name: tolk-mac-x86-64
115+
tag: ${{ inputs.tag }}
116+
117+
# mac arm64
118+
119+
- name: Upload Mac arm64 single artifact - tolk
120+
uses: svenstaro/upload-release-action@v2
121+
with:
122+
repo_token: ${{ secrets.GITHUB_TOKEN }}
123+
file: artifacts/ton-arm64-macos/tolk
124+
asset_name: tolk-mac-arm64
125+
tag: ${{ inputs.tag }}
126+
127+
# linux x86-64
128+
129+
- name: Upload Linux x86-64 single artifact - tolk
130+
uses: svenstaro/upload-release-action@v2
131+
with:
132+
repo_token: ${{ secrets.GITHUB_TOKEN }}
133+
file: artifacts/ton-x86_64-linux/tolk
134+
asset_name: tolk-linux-x86_64
135+
tag: ${{ inputs.tag }}
136+
137+
# linux arm64
138+
139+
- name: Upload Linux arm64 single artifact - tolk
140+
uses: svenstaro/upload-release-action@v2
141+
with:
142+
repo_token: ${{ secrets.GITHUB_TOKEN }}
143+
file: artifacts/ton-arm64-linux/tolk
144+
asset_name: tolk-linux-arm64
145+
tag: ${{ inputs.tag }}
146+
147+
- name: Upload WASM artifacts
148+
uses: svenstaro/upload-release-action@v2
149+
with:
150+
repo_token: ${{ secrets.GITHUB_TOKEN }}
151+
file: artifacts/ton-wasm.zip
152+
asset_name: ton-wasm.zip
153+
tag: ${{ inputs.tag }}

assembly/wasm/fift-func-wasm-build-ubuntu.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ echo
7171
fi
7272

7373
cd emsdk
74-
./emsdk install 3.1.40
75-
./emsdk activate 3.1.40
74+
./emsdk install 3.1.19
75+
./emsdk activate 3.1.19
7676
EMSDK_DIR=`pwd`
7777

7878
. $EMSDK_DIR/emsdk_env.sh

assembly/wasm/intrinsics.fc

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#pragma allow-post-modification;
2+
#pragma compute-asm-ltr;
3+
4+
(slice, slice) __tact_load_address(slice cs) inline {
5+
slice raw = cs~load_msg_addr();
6+
return (cs, raw);
7+
}
8+
9+
slice __gen_slice1 () asm """
10+
B{b5ee9c72410101010005000006abcdefe1e98884} B>boc <s PUSHSLICE
11+
""";
12+
13+
slice __gen_slice_slice_eb58904b617945cdf4f33042169c462cd36cf1772a2229f06171fd899e920b7f() asm """
14+
B{b5ee9c724101010100030000011025086565} B>boc <s PUSHSLICE
15+
""";
16+
17+
slice __gen_slice3 () asm """
18+
B{b5ee9c724101010100030000017888c37a8e} B>boc <s PUSHSLICE
19+
""";
20+
21+
slice __gen_slice_slice_6694a4a61b0dc7c7d5f63bbd394449f6921de7b2ad9cb() asm """
22+
B{b5ee9c724101010100820000ffabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdab} B>boc <s PUSHSLICE
23+
""";
24+
25+
slice __gen_slice_slice_80b26bab85f37e2bde3795993cdf7402cd42e68eff6187e8388083ce6cfe7c92() asm """
26+
B{b5ee9c724101010100030000018a0adc2f9c} B>boc <s PUSHSLICE
27+
""";
28+
29+
30+
(slice,((slice, cell, int, int, slice, slice, int, int, int, int, slice, slice, slice, slice, slice, slice, slice, slice, slice, slice, slice))) IntrinsicsTester_load(slice sc_0) inline {
31+
var v'c = sc_0~__tact_load_address();
32+
var v'd = sc_0~load_ref();
33+
var v'e = sc_0~load_int(257);
34+
var v'f = sc_0~load_int(257);
35+
slice sc_1 = sc_0~load_ref().begin_parse();
36+
var v'g = sc_1~load_ref().begin_parse();
37+
var v'h = sc_1~load_ref().begin_parse();
38+
var v'i = sc_1~load_int(257);
39+
var v'j = sc_1~load_int(257);
40+
var v'k = sc_1~load_int(257);
41+
slice sc_2 = sc_1~load_ref().begin_parse();
42+
var v'l = sc_2~load_int(257);
43+
var v'm = sc_2~load_ref().begin_parse();
44+
var v'n = sc_2~load_ref().begin_parse();
45+
var v'o = sc_2~load_ref().begin_parse();
46+
slice sc_3 = sc_2~load_ref().begin_parse();
47+
var v'p = sc_3~load_ref().begin_parse();
48+
var v'q = sc_3~load_ref().begin_parse();
49+
var v'r = sc_3~load_ref().begin_parse();
50+
slice sc_4 = sc_3~load_ref().begin_parse();
51+
var v's = sc_4~load_ref().begin_parse();
52+
var v't = sc_4~load_ref().begin_parse();
53+
var v'u = sc_4~load_ref().begin_parse();
54+
slice sc_5 = sc_4~load_ref().begin_parse();
55+
var v'w = sc_5~load_ref().begin_parse();
56+
var v'v = sc_5~load_ref().begin_parse();
57+
return (sc_0, (v'c, v'd, v'e, v'f, v'g, v'h, v'i, v'j, v'k, v'l, v'm, v'n, v'o, v'p, v'q, v'r, v's, v't, v'u, v'w, v'v));
58+
}
59+
60+
() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure { }
61+

0 commit comments

Comments
 (0)