1 | ---
|
2 | default_highlighter: oils-sh
|
3 | ---
|
4 |
|
5 | Portability
|
6 | ===========
|
7 |
|
8 | What does your platform need to run Oils?
|
9 |
|
10 | These are some notes that supplement [INSTALL](INSTALL.html).
|
11 |
|
12 | <div id="toc">
|
13 | </div>
|
14 |
|
15 | ## Issues in the core of Oils
|
16 |
|
17 | ### libc - `FNM_EXTMATCH` is not in POSIX
|
18 |
|
19 | To match extended globs like `@(*.cc|*.h)`, OSH relies on `FNM_EXTMATCH` from
|
20 | GNU libc.
|
21 |
|
22 | This is unlike bash, which has its own extended glob library.
|
23 |
|
24 | TODO: when using other libc, using this syntax should be an error.
|
25 |
|
26 | ### libc - `GLOB_PERIOD` is not in POSIX
|
27 |
|
28 | To implement the bash feature `shopt -s dotglob`, OSH relies on `GLOB_PERIOD`,
|
29 | which some libc's implement.
|
30 |
|
31 | This is unlike bash, which has its own glob library.
|
32 |
|
33 | ### Atomic Assignments
|
34 |
|
35 | The signal handler assumes that int and pointer assignments are atomic. This
|
36 | is a common and widespread assumption.
|
37 |
|
38 | - Related: [Atomic vs. Non-Atomic
|
39 | Operations](https://preshing.com/20130618/atomic-vs-non-atomic-operations/)
|
40 | by Jeff Preshing
|
41 |
|
42 | <!--
|
43 | As of 2024, the GC object layout doesn't depend on endian-ness.
|
44 |
|
45 | Tagged pointers may change this. A value may be either a pointer, which
|
46 | implies its least significant bits are zero, or an immediate value.
|
47 |
|
48 | We will have some #ifdef for it.
|
49 | -->
|
50 |
|
51 | ## Extra Features
|
52 |
|
53 | ### USDT - Userland Statically-Defined Tracing
|
54 |
|
55 | Our C++ code has `DTRACE_PROBE()` macros, which means we can use tools like
|
56 | `bpftrace` on Linux to make low-overhead queries of runtime behavior.
|
57 |
|
58 | The probe names and locations aren't stable across releases.
|
59 |
|
60 | ## "Enums" that are often extended
|
61 |
|
62 | Different Unix implementations often extend:
|
63 |
|
64 | - the list of signals
|
65 | - the list of [ulimit][] resources, which correspond to flags
|
66 |
|
67 | [ulimit]: ref/chap-builtin-cmd.html#ulimit
|
68 |
|
69 | ## Unicode
|
70 |
|
71 | Strings in Oils are byte strings, which are often UTF-8 encoded.
|
72 |
|
73 | We use `libc` functions that may depend on the global locale setting, like
|
74 | `glob()`. We currently assume your libc is configured to use UTF-8.
|
75 |
|
76 | See the [Unicode doc][] for details on Unicode-aware operations.
|
77 |
|
78 | [Unicode doc]: unicode.html
|
79 |
|
80 | <!--
|
81 |
|
82 | TODO: ./configure could detect some of these
|
83 | -->
|