Commit 05f4d16
committed
Fix nix build for c2rust.
This commit adds a number of improvements to the nix build for c2rust
the main highlights are:
- A c2rust package is provided, allowing nix users to install and run
c2rust itself, instead of just getting a development environment
from nix.
- Update LLVM / clang to version 18.
- Test cases pass in the c2rust dev environment now.
Some fixes include...
- Removing oxalica and just using fenix. Mixing rust overlays in nix
was causing issues.
- Use the nix tinycbor package to build c2rust. The c2rust cmake files
add an external dependency on tinycbor, which causes sandboxed nix
builds to fail because they cannot fetch the package. This involves
patching the CMakeLists.txt file, and using pkg-config to find the
system tinycbor library. Note: in the dev shell cmake will still
fetch the external tinycbor.
- Use the C2RUST_TINYCBOR_PATH environment variable, if it exists, to
find tinycbor in c2rust-ast-exporter's build.rs
- Use bindgenHook to make sure Rust's bindgen can find header files.
- Update the test_translator.py script to include nix flags in compiler_commands.json
Messing with bindgenHook, disable checks so package builds.1 parent 0a92eda commit 05f4d16
File tree
5 files changed
+203
-140
lines changed- c2rust-ast-exporter
- scripts
5 files changed
+203
-140
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
153 | 161 | | |
| 162 | + | |
| 163 | + | |
154 | 164 | | |
155 | 165 | | |
156 | 166 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | | - | |
| 13 | + | |
16 | 14 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
43 | 65 | | |
44 | | - | |
45 | | - | |
46 | 66 | | |
47 | | - | |
48 | | - | |
49 | 67 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 68 | | |
54 | 69 | | |
55 | 70 | | |
| |||
68 | 83 | | |
69 | 84 | | |
70 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
71 | 103 | | |
72 | | - | |
| 104 | + | |
73 | 105 | | |
74 | | - | |
75 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
76 | 125 | | |
0 commit comments