##// END OF EJS Templates
hgcli: add stub PyOxidizer project...
Gregory Szorc -
r45128:af739894 default
parent child Browse files
Show More
@@ -0,0 +1,13 b''
1 # By default Rust will not export dynamic symbols from built executables.
2 # Python symbols need to be exported from executables in order for that
3 # executable to load Python extension modules, which are shared libraries.
4 # Otherwise, the extension module / shared library is unable to resolve
5 # Python symbols. This file contains target-specific configuration
6 # overrides to export dynamic symbols from executables.
7 #
8 # Ideally we would achieve this functionality via the build.rs build
9 # script. But custom compiler flags via build scripts apparently only
10 # support limited options.
11
12 [target.x86_64-unknown-linux-gnu]
13 rustflags = ["-C", "link-args=-Wl,-export-dynamic"]
@@ -0,0 +1,359 b''
1 # This file is automatically @generated by Cargo.
2 # It is not intended for manual editing.
3 [[package]]
4 name = "aho-corasick"
5 version = "0.7.10"
6 source = "registry+https://github.com/rust-lang/crates.io-index"
7 dependencies = [
8 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
9 ]
10
11 [[package]]
12 name = "anyhow"
13 version = "1.0.28"
14 source = "registry+https://github.com/rust-lang/crates.io-index"
15
16 [[package]]
17 name = "autocfg"
18 version = "1.0.0"
19 source = "registry+https://github.com/rust-lang/crates.io-index"
20
21 [[package]]
22 name = "byteorder"
23 version = "1.3.4"
24 source = "registry+https://github.com/rust-lang/crates.io-index"
25
26 [[package]]
27 name = "cc"
28 version = "1.0.50"
29 source = "registry+https://github.com/rust-lang/crates.io-index"
30
31 [[package]]
32 name = "cfg-if"
33 version = "0.1.10"
34 source = "registry+https://github.com/rust-lang/crates.io-index"
35
36 [[package]]
37 name = "cpython"
38 version = "0.4.1"
39 source = "git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f#387e87d9deb6b678508888239f9f87dc36973d3f"
40 dependencies = [
41 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
42 "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
43 "paste 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
44 "python3-sys 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)",
45 ]
46
47 [[package]]
48 name = "fs_extra"
49 version = "1.1.0"
50 source = "registry+https://github.com/rust-lang/crates.io-index"
51
52 [[package]]
53 name = "getrandom"
54 version = "0.1.14"
55 source = "registry+https://github.com/rust-lang/crates.io-index"
56 dependencies = [
57 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
58 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
59 "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)",
60 ]
61
62 [[package]]
63 name = "hgcli"
64 version = "0.1.0"
65 dependencies = [
66 "jemallocator-global 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
67 "pyembed 0.7.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)",
68 ]
69
70 [[package]]
71 name = "jemalloc-sys"
72 version = "0.3.2"
73 source = "registry+https://github.com/rust-lang/crates.io-index"
74 dependencies = [
75 "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
76 "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
77 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
78 ]
79
80 [[package]]
81 name = "jemallocator"
82 version = "0.3.2"
83 source = "registry+https://github.com/rust-lang/crates.io-index"
84 dependencies = [
85 "jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
86 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
87 ]
88
89 [[package]]
90 name = "jemallocator-global"
91 version = "0.3.2"
92 source = "registry+https://github.com/rust-lang/crates.io-index"
93 dependencies = [
94 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
95 "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
96 ]
97
98 [[package]]
99 name = "lazy_static"
100 version = "1.4.0"
101 source = "registry+https://github.com/rust-lang/crates.io-index"
102
103 [[package]]
104 name = "libc"
105 version = "0.2.68"
106 source = "registry+https://github.com/rust-lang/crates.io-index"
107
108 [[package]]
109 name = "memchr"
110 version = "2.3.3"
111 source = "registry+https://github.com/rust-lang/crates.io-index"
112
113 [[package]]
114 name = "memory-module-sys"
115 version = "0.3.0"
116 source = "registry+https://github.com/rust-lang/crates.io-index"
117 dependencies = [
118 "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
119 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
120 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
121 ]
122
123 [[package]]
124 name = "num-traits"
125 version = "0.2.11"
126 source = "registry+https://github.com/rust-lang/crates.io-index"
127 dependencies = [
128 "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
129 ]
130
131 [[package]]
132 name = "paste"
133 version = "0.1.9"
134 source = "registry+https://github.com/rust-lang/crates.io-index"
135 dependencies = [
136 "paste-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
137 "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
138 ]
139
140 [[package]]
141 name = "paste-impl"
142 version = "0.1.9"
143 source = "registry+https://github.com/rust-lang/crates.io-index"
144 dependencies = [
145 "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
146 "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
147 "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
148 "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
149 ]
150
151 [[package]]
152 name = "ppv-lite86"
153 version = "0.2.6"
154 source = "registry+https://github.com/rust-lang/crates.io-index"
155
156 [[package]]
157 name = "proc-macro-hack"
158 version = "0.5.15"
159 source = "registry+https://github.com/rust-lang/crates.io-index"
160
161 [[package]]
162 name = "proc-macro2"
163 version = "1.0.10"
164 source = "registry+https://github.com/rust-lang/crates.io-index"
165 dependencies = [
166 "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
167 ]
168
169 [[package]]
170 name = "pyembed"
171 version = "0.7.0-pre"
172 source = "git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d#c772a1379c3026314eda1c8ea244b86c0658951d"
173 dependencies = [
174 "cpython 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)",
175 "jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
176 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
177 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
178 "memory-module-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
179 "python-packed-resources 0.1.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)",
180 "python3-sys 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)",
181 "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
182 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
183 ]
184
185 [[package]]
186 name = "python-packed-resources"
187 version = "0.1.0-pre"
188 source = "git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d#c772a1379c3026314eda1c8ea244b86c0658951d"
189 dependencies = [
190 "anyhow 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)",
191 "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
192 ]
193
194 [[package]]
195 name = "python3-sys"
196 version = "0.4.1"
197 source = "git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f#387e87d9deb6b678508888239f9f87dc36973d3f"
198 dependencies = [
199 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
200 "regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
201 ]
202
203 [[package]]
204 name = "quote"
205 version = "1.0.3"
206 source = "registry+https://github.com/rust-lang/crates.io-index"
207 dependencies = [
208 "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
209 ]
210
211 [[package]]
212 name = "rand"
213 version = "0.7.3"
214 source = "registry+https://github.com/rust-lang/crates.io-index"
215 dependencies = [
216 "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
217 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
218 "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
219 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
220 "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
221 ]
222
223 [[package]]
224 name = "rand_chacha"
225 version = "0.2.2"
226 source = "registry+https://github.com/rust-lang/crates.io-index"
227 dependencies = [
228 "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
229 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
230 ]
231
232 [[package]]
233 name = "rand_core"
234 version = "0.5.1"
235 source = "registry+https://github.com/rust-lang/crates.io-index"
236 dependencies = [
237 "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
238 ]
239
240 [[package]]
241 name = "rand_hc"
242 version = "0.2.0"
243 source = "registry+https://github.com/rust-lang/crates.io-index"
244 dependencies = [
245 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
246 ]
247
248 [[package]]
249 name = "regex"
250 version = "1.3.6"
251 source = "registry+https://github.com/rust-lang/crates.io-index"
252 dependencies = [
253 "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
254 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
255 "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)",
256 "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
257 ]
258
259 [[package]]
260 name = "regex-syntax"
261 version = "0.6.17"
262 source = "registry+https://github.com/rust-lang/crates.io-index"
263
264 [[package]]
265 name = "syn"
266 version = "1.0.17"
267 source = "registry+https://github.com/rust-lang/crates.io-index"
268 dependencies = [
269 "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
270 "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
271 "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
272 ]
273
274 [[package]]
275 name = "thread_local"
276 version = "1.0.1"
277 source = "registry+https://github.com/rust-lang/crates.io-index"
278 dependencies = [
279 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
280 ]
281
282 [[package]]
283 name = "unicode-xid"
284 version = "0.2.0"
285 source = "registry+https://github.com/rust-lang/crates.io-index"
286
287 [[package]]
288 name = "uuid"
289 version = "0.8.1"
290 source = "registry+https://github.com/rust-lang/crates.io-index"
291 dependencies = [
292 "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
293 ]
294
295 [[package]]
296 name = "wasi"
297 version = "0.9.0+wasi-snapshot-preview1"
298 source = "registry+https://github.com/rust-lang/crates.io-index"
299
300 [[package]]
301 name = "winapi"
302 version = "0.3.8"
303 source = "registry+https://github.com/rust-lang/crates.io-index"
304 dependencies = [
305 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
306 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
307 ]
308
309 [[package]]
310 name = "winapi-i686-pc-windows-gnu"
311 version = "0.4.0"
312 source = "registry+https://github.com/rust-lang/crates.io-index"
313
314 [[package]]
315 name = "winapi-x86_64-pc-windows-gnu"
316 version = "0.4.0"
317 source = "registry+https://github.com/rust-lang/crates.io-index"
318
319 [metadata]
320 "checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"
321 "checksum anyhow 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "d9a60d744a80c30fcb657dfe2c1b22bcb3e814c1a1e3674f32bf5820b570fbff"
322 "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
323 "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
324 "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
325 "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
326 "checksum cpython 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)" = "<none>"
327 "checksum fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674"
328 "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
329 "checksum jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
330 "checksum jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
331 "checksum jemallocator-global 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "991b61de8365c8b5707cf6cabbff98cfd6eaca9b851948b883efea408c7f581e"
332 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
333 "checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"
334 "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
335 "checksum memory-module-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbdce2925c681860b08875119254fb5543dbf6337c56ff93afebeed9c686da3"
336 "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
337 "checksum paste 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "092d791bf7847f70bbd49085489fba25fc2c193571752bff9e36e74e72403932"
338 "checksum paste-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "406c23fb4c45cc6f68a9bbabb8ec7bd6f8cfcbd17e9e8f72c2460282f8325729"
339 "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b"
340 "checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63"
341 "checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3"
342 "checksum pyembed 0.7.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)" = "<none>"
343 "checksum python-packed-resources 0.1.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)" = "<none>"
344 "checksum python3-sys 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)" = "<none>"
345 "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
346 "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
347 "checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
348 "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
349 "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
350 "checksum regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7f6946991529684867e47d86474e3a6d0c0ab9b82d5821e314b1ede31fa3a4b3"
351 "checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae"
352 "checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03"
353 "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
354 "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
355 "checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11"
356 "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
357 "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
358 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
359 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
@@ -0,0 +1,20 b''
1 [package]
2 name = "hgcli"
3 version = "0.1.0"
4 build = "build.rs"
5 authors = ["Gregory Szorc <gregory.szorc@gmail.com>"]
6 edition = "2018"
7
8 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
10 [dependencies]
11 jemallocator-global = { version = "0.3", optional = true }
12 pyembed = { git = "https://github.com/indygreg/PyOxidizer.git", rev = "c772a1379c3026314eda1c8ea244b86c0658951d", default-features=false }
13
14 [features]
15 default = ["build-mode-pyoxidizer-exe"]
16 jemalloc = ["jemallocator-global", "pyembed/jemalloc"]
17 build-mode-pyoxidizer-exe = ["pyembed/build-mode-pyoxidizer-exe"]
18 build-mode-prebuilt-artifacts = ["pyembed/build-mode-prebuilt-artifacts"]
19 cpython-link-unresolved-static = ["pyembed/cpython-link-unresolved-static"]
20 cpython-link-default = ["pyembed/cpython-link-default"]
@@ -0,0 +1,16 b''
1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5 /*! Build script to integrate PyOxidizer. */
6
7 fn main() {
8 if let Ok(config_rs) = std::env::var("DEP_PYTHONXY_DEFAULT_PYTHON_CONFIG_RS") {
9 println!(
10 "cargo:rustc-env=PYOXIDIZER_DEFAULT_PYTHON_CONFIG_RS={}",
11 config_rs
12 );
13 } else {
14 panic!("unable to find build artifacts generated by pyembed crate");
15 }
16 }
@@ -0,0 +1,153 b''
1 # This file defines how PyOxidizer application building and packaging is
2 # performed. See the pyoxidizer crate's documentation for extensive
3 # documentation on this file format.
4
5 # Obtain the default PythonDistribution for our build target. We link
6 # this distribution into our produced executable and extract the Python
7 # standard library from it.
8 def make_dist():
9 return default_python_distribution()
10
11 # Configuration files consist of functions which define build "targets."
12 # This function creates a Python executable and installs it in a destination
13 # directory.
14 def make_exe(dist):
15 # This variable defines the configuration of the
16 # embedded Python interpreter.
17 python_config = PythonInterpreterConfig(
18 # bytes_warning=0,
19 # dont_write_bytecode=True,
20 # ignore_environment=True,
21 # inspect=False,
22 # interactive=False,
23 # isolated=False,
24 # legacy_windows_fs_encoding=False,
25 # legacy_windows_stdio=False,
26 # no_site=True,
27 # no_user_site_directory=True,
28 # optimize_level=0,
29 # parser_debug=False,
30 # stdio_encoding=None,
31 # unbuffered_stdio=False,
32 # filesystem_importer=False,
33 # sys_frozen=False,
34 # sys_meipass=False,
35 # sys_paths=None,
36 # raw_allocator=None,
37 # terminfo_resolution="dynamic",
38 # terminfo_dirs=None,
39 # use_hash_seed=False,
40 # verbose=0,
41 # write_modules_directory_env=None,
42 # run_eval=None,
43 # run_module=None,
44 # run_noop=False,
45 # run_repl=True,
46 )
47
48 # The run_eval, run_module, run_noop, and run_repl arguments are mutually
49 # exclusive controls over what the interpreter should do once it initializes.
50 #
51 # run_eval -- Run the specified string value via `eval()`.
52 # run_module -- Import the specified module as __main__ and run it.
53 # run_noop -- Do nothing.
54 # run_repl -- Start a Python REPL.
55 #
56 # These arguments can be ignored if you are providing your own Rust code for
57 # starting the interpreter, as Rust code has full control over interpreter
58 # behavior.
59
60 # Produce a PythonExecutable from a Python distribution, embedded
61 # resources, and other options. The returned object represents the
62 # standalone executable that will be built.
63 exe = dist.to_python_executable(
64 name = "hgcli",
65 config = python_config,
66 # Embed all extension modules, making this a fully-featured Python.
67 extension_module_filter = "all",
68
69 # Only package the minimal set of extension modules needed to initialize
70 # a Python interpreter. Many common packages in Python's standard
71 # library won't work with this setting.
72 #extension_module_filter='minimal',
73
74 # Only package extension modules that don't require linking against
75 # non-Python libraries. e.g. will exclude support for OpenSSL, SQLite3,
76 # other features that require external libraries.
77 #extension_module_filter='no-libraries',
78
79 # Only package extension modules that don't link against GPL licensed
80 # libraries.
81 #extension_module_filter='no-gpl',
82
83 # Include Python module sources. This isn't strictly required and it does
84 # make binary sizes larger. But having the sources can be useful for
85 # activities such as debugging.
86 include_sources = True,
87
88 # Whether to include non-module resource data/files.
89 include_resources = False,
90
91 # Do not include functionality for testing Python itself.
92 include_test = False,
93 )
94
95 # Invoke `pip install` with our Python distribution to install a single package.
96 # `pip_install()` returns objects representing installed files.
97 # `add_in_memory_python_resources()` adds these objects to the binary,
98 # marking them for in-memory loading.
99 #exe.add_in_memory_python_resources(dist.pip_install(["appdirs"]))
100
101 # Invoke `pip install` using a requirements file and add the collected resources
102 # to our binary.
103 #exe.add_in_memory_python_resources(dist.pip_install(["-r", "requirements.txt"]))
104
105 # Read Python files from a local directory and add them to our embedded
106 # context, taking just the resources belonging to the `foo` and `bar`
107 # Python packages.
108 #exe.add_in_memory_python_resources(dist.read_package_root(
109 # path="/src/mypackage",
110 # packages=["foo", "bar"],
111 #))
112
113 # Discover Python files from a virtualenv and add them to our embedded
114 # context.
115 #exe.add_in_memory_python_resources(dist.read_virtualenv(path="/path/to/venv"))
116
117 # Filter all resources collected so far through a filter of names
118 # in a file.
119 #exe.filter_from_files(files=["/path/to/filter-file"]))
120
121 # Return our `PythonExecutable` instance so it can be built and
122 # referenced by other consumers of this target.
123 return exe
124
125 def make_embedded_resources(exe):
126 return exe.to_embedded_resources()
127
128 def make_install(exe):
129 # Create an object that represents our installed application file layout.
130 files = FileManifest()
131
132 # Add the generated executable to our install layout in the root directory.
133 files.add_python_resource(".", exe)
134
135 return files
136
137 # Tell PyOxidizer about the build targets defined above.
138 register_target("dist", make_dist)
139 register_target("exe", make_exe, depends = ["dist"], default = True)
140 register_target("resources", make_embedded_resources, depends = ["exe"], default_build_script = True)
141 register_target("install", make_install, depends = ["exe"])
142
143 # Resolve whatever targets the invoker of this configuration file is requesting
144 # be resolved.
145 resolve_targets()
146
147 # END OF COMMON USER-ADJUSTED SETTINGS.
148 #
149 # Everything below this is typically managed by PyOxidizer and doesn't need
150 # to be updated by people.
151
152 PYOXIDIZER_VERSION = "0.7.0-pre"
153 PYOXIDIZER_COMMIT = "c772a1379c3026314eda1c8ea244b86c0658951d"
@@ -0,0 +1,38 b''
1 use pyembed::MainPythonInterpreter;
2
3 // Include an auto-generated file containing the default
4 // `pyembed::PythonConfig` derived by the PyOxidizer configuration file.
5 //
6 // If you do not want to use PyOxidizer to generate this file, simply
7 // remove this line and instantiate your own instance of
8 // `pyembed::PythonConfig`.
9 include!(env!("PYOXIDIZER_DEFAULT_PYTHON_CONFIG_RS"));
10
11 fn main() {
12 // The following code is in a block so the MainPythonInterpreter is destroyed in an
13 // orderly manner, before process exit.
14 let code = {
15 // Load the default Python configuration as derived by the PyOxidizer config
16 // file used at build time.
17 let config = default_python_config();
18
19 // Construct a new Python interpreter using that config, handling any errors
20 // from construction.
21 match MainPythonInterpreter::new(config) {
22 Ok(mut interp) => {
23 // And run it using the default run configuration as specified by the
24 // configuration. If an uncaught Python exception is raised, handle it.
25 // This includes the special SystemExit, which is a request to terminate the
26 // process.
27 interp.run_as_main()
28 }
29 Err(msg) => {
30 eprintln!("{}", msg);
31 1
32 }
33 }
34 };
35
36 // And exit the process according to code execution results.
37 std::process::exit(code);
38 }
@@ -1,3 +1,3 b''
1 [workspace]
1 [workspace]
2 members = ["hg-core", "hg-cpython"]
2 members = ["hg-core", "hg-cpython"]
3 exclude = ["chg"]
3 exclude = ["chg", "hgcli"]
General Comments 0
You need to be logged in to leave comments. Login now