Skip to content

Commit 5d656af

Browse files
committed
2024-11: Add monthly report
1 parent a2c8575 commit 5d656af

File tree

1 file changed

+310
-0
lines changed

1 file changed

+310
-0
lines changed
Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
---
2+
layout: post
3+
title: "November 2024 Monthly report"
4+
author: Philip Herron, Pierre-Emmanuel Patry and Arthur Cohen
5+
tags:
6+
- monthly-report
7+
---
8+
9+
## Overview
10+
11+
Thanks again to [Open Source Security, inc](https://opensrcsec.com/) and
12+
[Embecosm](https://www.embecosm.com/) for their ongoing support for this
13+
project.
14+
15+
### Project update
16+
17+
GCC development entered stage 3 this month, meaning that `gccrs` is no
18+
longer allowed to submit patches that affect the entire GCC framewrok
19+
until the project re-enters stage 1, after the release of GCC 15.1. This
20+
is not an issue for us, as we took special care to send the affected
21+
patches upstream back in June of this year, giving them plenty of time
22+
to get reviewed and merged before stage 3. In other GCC news, the
23+
baseline for building the compiler got bumped from GCC 4.8 to GCC 5.4 -
24+
this means that the oldest compiler that we are expected to target is
25+
newer and adds support for C++14. Thanks to [Sam
26+
James](https://github.com/thesamesam) and [Marc
27+
Poulhiès](https://github.com/dkm), we have updated our CI to reflect
28+
this change. Thank you both!
29+
30+
Most of the pull-requests this month were focused on name resolution,
31+
with even more improvements made by [Owen
32+
Avery](https://github.com/powerboat9). Owen has been a contributor to
33+
the project for two years, and has been extremely helpful recently with
34+
our name resolution rewrite (NR2.0), by working on integrating it to all
35+
areas of the compiler. We will thus be welcoming Owen to the core
36+
`gccrs` team of contributors.
37+
38+
An interesting technical change this month concerns the type-checking of
39+
`match` expressions. In one certain case, `match` expressions can
40+
resolve to the `never` type. This is interesting for empty \~enum\~s,
41+
which can be used to represent invalid or impossible states. A well
42+
known type from the standard library is
43+
[Infallible](https://doc.rust-lang.org/std/convert/enum.Infallible.html),
44+
whose definition is as follows:
45+
46+
``` rust
47+
enum Infallible {}
48+
```
49+
50+
Since this `enum` does not contain any variants, matching on it looks a
51+
bit strange:
52+
53+
``` rust
54+
fn handle_infallible(x: Infallible) {
55+
let y = match x {};
56+
}
57+
```
58+
59+
In that case, what should the type of `y` be? Since we cannot extract
60+
any information from `x`, it doesn't really make sense to give `y` a
61+
regular type. Furthermore, since we cannot instantiate a value of type
62+
`Infallible` in the first place, it does not make sense to do
63+
pattern-matching on it to extract information! But by making this
64+
pattern matching resolve to the `never` type, we can implement traits on
65+
`Infallible` in order to use it just like a regular error type - since
66+
`never` can always coerce to any target type, as it cannot exist in the
67+
first place. This makes empty pattern matching required for handling the
68+
`Infallible` type and its trait implementations, which is required for
69+
handling code that can never fail. The documentation of the `enum` gives
70+
an interesting example, in which the `TryFrom<T>` trait can be
71+
implemented for `U` when `U` already implements `From<T>`. Because we
72+
know the conversion can never fail, there is no need to expose a proper
73+
error type, as those errors will never show up.
74+
75+
The fix for this is quite simple - if the `match` we are type-checking
76+
is empty, then we can just resolve its type to `never`. If the match is
77+
not supposed to be empty (for example, if we are matching on an `enum`
78+
with one or more variants), then it's up to the exhaustiveness checker
79+
to report an issue - not the type-checker!
80+
81+
If you are curious, you can see how this special case is handled in
82+
[gccrs](https://github.com/Rust-GCC/gccrs/blob/afbd87358cc8b4627536145510b0c17634005eb6/gcc/rust/typecheck/rust-hir-type-check-expr.cc#L1461-L1468)
83+
and in
84+
[rustc](https://github.com/rust-lang/rust/blob/3d1dba830a564d1118361345d7ada47a05241f45/compiler/rustc_hir_typeck/src/_match.rs#L32-L36).
85+
86+
In other technical news, [Antoni Boucher](https://github.com/antoyo),
87+
lead developer of the `rustc_codegen_gcc` project, contributed code to
88+
`gccrs` this month in order to improve target feature detection for both
89+
of our projects. This code concerns platform-specific information that
90+
the compilers needs to know about in order to produce correct assembly.
91+
By reusing the same code in both projects, we ensure that Rust code
92+
compiled using one of the GCC-based compilers will behave the same way
93+
on the users' machines. This change also makes it easier to adapt our
94+
target configuration values for Rust if the need arises. Thank you
95+
Antoni!
96+
97+
Finally, a blogpost written in collaboration with the Rust project was
98+
also published on the official Rust blog:
99+
<https://blog.rust-lang.org/2024/11/07/gccrs-an-alternative-compiler-for-rust.html>.
100+
This blogpost outlines some of the decisions we've made for `gccrs` to
101+
make sure that the project does not threaten the Rust ecosystem and does
102+
not risk splitting it in two. The main discussion thread about it can be
103+
found [here on
104+
Reddit](https://www.reddit.com/r/rust/comments/1gm51ki/gccrs_an_alternative_compiler_for_rust_rust_blog/),
105+
where it was really well-received.
106+
107+
### Community call
108+
109+
We will have our next monthly community call on the 9th of December at
110+
10am UTC. You can subscribe to our calendar to see when the next one
111+
will be held. The call is open to everyone, even if you would just like
112+
to sit-in and listen. You can also subscribe to our
113+
[mailing-list](https://gcc.gnu.org/mailman/listinfo/gcc-rust) or join
114+
our [Zulip chat](https://gcc-rust.zulipchat.com) to be notified of
115+
upcoming events.
116+
117+
- [Jitsi link](https://meet.jit.si/gccrs-community-call-december)
118+
- Calendar ID:
119+
7060a0923ffebd3cb52b1afef35a28ff7b64f05962c9af84c23b1847f1f5f894@group.calendar.google.com
120+
- [Google calendar
121+
link](https://calendar.google.com/calendar/embed?src=7060a0923ffebd3cb52b1afef35a28ff7b64f05962c9af84c23b1847f1f5f894%40group.calendar.google.com)
122+
- [iCal
123+
link](https://calendar.google.com/calendar/ical/7060a0923ffebd3cb52b1afef35a28ff7b64f05962c9af84c23b1847f1f5f894%40group.calendar.google.com/public/basic.ics)
124+
125+
## Call for contribution
126+
127+
There are no calls for contribution this month, as we do not have a lot
128+
of good first issues available. Still, feel free to take a look at them
129+
[here](https://github.com/Rust-GCC/gccrs/issues?q=is%3Aopen+is%3Aissue+label%3Agood-first-pr)
130+
and get in touch with us for some mentoring or help!
131+
132+
## Completed Activities
133+
134+
- hir: Remove duplicate function in TraitItemFunc
135+
[PR3276](https://github.com/rust-gcc/gccrs/pull/3276)
136+
- Cleanup lang items mappings
137+
[PR3273](https://github.com/rust-gcc/gccrs/pull/3273)
138+
- gccrs: ensure packed and aligned is applied properly
139+
[PR3272](https://github.com/rust-gcc/gccrs/pull/3272)
140+
- gccrs: allow casts from numeric types to floats
141+
[PR3270](https://github.com/rust-gcc/gccrs/pull/3270)
142+
- gccrs: improve handling of Self Type paths
143+
[PR3269](https://github.com/rust-gcc/gccrs/pull/3269)
144+
- ci: bump actions/checkout version and fix gcc 5 testing
145+
[PR3268](https://github.com/rust-gcc/gccrs/pull/3268)
146+
- gccrs: fix crash in hir dump with missing guards
147+
[PR3267](https://github.com/rust-gcc/gccrs/pull/3267)
148+
- Prepend crate name to functions with nr2
149+
[PR3265](https://github.com/rust-gcc/gccrs/pull/3265)
150+
- ci: remove bors mention
151+
[PR3263](https://github.com/rust-gcc/gccrs/pull/3263)
152+
- CI: upgrade GCC baseline from 4.8 -\> 5.4 (5.5)
153+
[PR3262](https://github.com/rust-gcc/gccrs/pull/3262)
154+
- Clean up some system includes
155+
[PR3259](https://github.com/rust-gcc/gccrs/pull/3259)
156+
- Prevent execution of some nr1.0 functions with nr2.0
157+
[PR3257](https://github.com/rust-gcc/gccrs/pull/3257)
158+
- gccrs: empty match expressions should resolve to !
159+
[PR3256](https://github.com/rust-gcc/gccrs/pull/3256)
160+
- Add a new CI step to detect raw issue references in commit messages
161+
[PR3255](https://github.com/rust-gcc/gccrs/pull/3255)
162+
- Handle type path segments during late resolution 2.0
163+
[PR3254](https://github.com/rust-gcc/gccrs/pull/3254)
164+
- Use nr2.0 in typechecker
165+
[PR3253](https://github.com/rust-gcc/gccrs/pull/3253)
166+
- Use nr2.0 in \`PrivacyReporter\`
167+
[PR3252](https://github.com/rust-gcc/gccrs/pull/3252)
168+
- gccrs: Fix bad handling for recursive type query
169+
[PR3250](https://github.com/rust-gcc/gccrs/pull/3250)
170+
- Push ribs by kind rather than by value
171+
[PR3249](https://github.com/rust-gcc/gccrs/pull/3249)
172+
- Improve handling of static items in toplevel 2.0
173+
[PR3248](https://github.com/rust-gcc/gccrs/pull/3248)
174+
- Cleanup clang warnings
175+
[PR3244](https://github.com/rust-gcc/gccrs/pull/3244)
176+
- gccrs: add test case to show issue is fixed
177+
[PR3243](https://github.com/rust-gcc/gccrs/pull/3243)
178+
- Fix bad type checking on fn trait calls
179+
[PR3240](https://github.com/rust-gcc/gccrs/pull/3240)
180+
- Use name resolver 2.0 in \`VisibilityResolver\`
181+
[PR3239](https://github.com/rust-gcc/gccrs/pull/3239)
182+
- Improve handling of implicit \`Self\` parameter in AST
183+
[PR3238](https://github.com/rust-gcc/gccrs/pull/3238)
184+
- gccrs: fix bad type inference on local patterns
185+
[PR3237](https://github.com/rust-gcc/gccrs/pull/3237)
186+
- Improve handling of struct expressions in nr2.0
187+
[PR3225](https://github.com/rust-gcc/gccrs/pull/3225)
188+
- Use name resolver 2.0 for module descendance checks
189+
[PR3224](https://github.com/rust-gcc/gccrs/pull/3224)
190+
- Reorganize the CPU feature detection
191+
[PR3195](https://github.com/rust-gcc/gccrs/pull/3195)
192+
- Add build dependencies for Fedora
193+
[PR3154](https://github.com/rust-gcc/gccrs/pull/3154)
194+
- Reduce the amount of raw pointer the HIR API
195+
[PR2878](https://github.com/rust-gcc/gccrs/pull/2878)
196+
197+
### Contributors this month
198+
199+
- [Antoni Boucher](https://github.com/antoyo) (new contributor!)
200+
- [Sam James](https://github.com/thesamesam) (new contributor!)
201+
- [Jarkko Sakkinen](https://github.com/jarkkojs) (new contributor!)
202+
- [Philip Herron](https://github.com/philberty)
203+
- [Pierre-Emmanuel Patry](https://github.com/P-E-P)
204+
- [Arthur Cohen](https://github.com/CohenArthur)
205+
- [Owen Avery](https://github.com/powerboat9)
206+
- [Marc Poulhiès](https://github.com/dkm)
207+
- [Thomas Schwinge](https://github.com/tschwinge)
208+
209+
### Overall Task Status
210+
211+
| Category | Last Month | This Month | Delta |
212+
|-------------|------------|------------|-------|
213+
| TODO | 327 | 316 | -11 |
214+
| In Progress | 75 | 80 | +5 |
215+
| Completed | 897 | 907 | +10 |
216+
217+
### Test Cases
218+
219+
| TestCases | Last Month | This Month | Delta |
220+
|-----------|------------|------------|-------|
221+
| Passing | 9212 | 9266 | +54 |
222+
| Failed | \- | \- | \- |
223+
| XFAIL | 294 | 264 | -30 |
224+
| XPASS | \- | \- | \- |
225+
226+
### Bugs
227+
228+
| Category | Last Month | This Month | Delta |
229+
|-------------|------------|------------|-------|
230+
| TODO | 119 | 112 | -7 |
231+
| In Progress | 48 | 40 | -8 |
232+
| Completed | 441 | 450 | +9 |
233+
234+
### Milestones Progress
235+
236+
| Milestone | Last Month | This Month | Delta | Start Date | Completion Date | Target | Target GCC |
237+
|----------------------------|------------|------------|-------|---------------|-----------------|---------------|------------|
238+
| Name resolution 2.0 rework | 6% | 20% | +14% | 1st Jun 2024 | \- | 1st Apr 2025 | GCC 15.1 |
239+
| Macro expansion | 29% | 29% | \- | 1st Jun 2024 | \- | 1st Jan 2025 | GCC 15.1 |
240+
| Lang items | 66% | 90% | +24% | 1st Jul 2024 | \- | 21st Nov 2024 | GCC 15.1 |
241+
| Indexing fixes | 0% | 0% | \- | 21st Jul 2024 | \- | 15th Nov 2024 | GCC 15.1 |
242+
| Iterator fixes | 0% | 0% | \- | 21st Jul 2024 | \- | 15th Nov 2024 | GCC 15.1 |
243+
| Auto traits improvements | 0% | 0% | \- | 15th Sep 2024 | \- | 21st Dec 2024 | GCC 15.1 |
244+
| Remaining typecheck issues | 85% | 88% | +3% | 21st Oct 2024 | \- | 1st Mar 2025 | GCC 15.1 |
245+
| cfg-core | 0% | 0% | \- | 1st Dec 2024 | \- | 1st Mar 2025 | GCC 15.1 |
246+
| Codegen fixes | 0% | 0% | \- | 7th Oct 2024 | \- | 1st Mar 2025 | GCC 15.1 |
247+
248+
| Upcoming Milestone | Last Month | This Month | Delta | Start Date | Completion Date | Target | Target GCC |
249+
|--------------------------------------|------------|------------|-------|---------------|-----------------|---------------|------------|
250+
| Question mark operator | 0% | 0% | \- | 15th Dec 2024 | \- | 21st Feb 2025 | GCC 15.1 |
251+
| Specialization | 0% | 0% | \- | 1st Jan 2025 | \- | 1st Mar 2025 | GCC 15.1 |
252+
| Inline assembly | 100% | 100% | \- | 1st Jun 2024 | 26th Aug 2024 | 15th Sep 2024 | GCC 15.1 |
253+
| Borrow checker improvements | 100% | 100% | \- | 1st Jun 2024 | 26th Aug 2024 | 15th Sep 2024 | GCC 15.1 |
254+
| Rustc Testsuite Adaptor | 0% | 0% | \- | 1st Jun 2024 | \- | 15th Sep 2024 | GCC 15.1 |
255+
| black<sub>box</sub> intrinsic | 0% | 0% | \- | 28th Oct 2024 | \- | 28th Jan 2025 | GCC 15.1 |
256+
| Unstable RfL features | 0% | 0% | \- | 7th Jan 2025 | \- | 1st Mar 2025 | GCC 15.1 |
257+
| cfg-rfl | 0% | 0% | \- | 7th Jan 2025 | \- | 15th Feb 2025 | GCC 15.1 |
258+
| alloc parser issues | 100% | 100% | \- | 7th Jan 2025 | 31st Jun 2024 | 28th Jan 2025 | GCC 15.1 |
259+
| let-else | 0% | 0% | \- | 28th Jan 2025 | \- | 28th Feb 2025 | GCC 15.1 |
260+
| Explicit generics with impl Trait | 0% | 0% | \- | 28th Feb 2025 | \- | 28th Mar 2025 | GCC 15.1 |
261+
| Downgrade to Rust 1.49 | 0% | 0% | \- | \- | \- | 1st Apr 2025 | GCC 15.1 |
262+
| offset<sub>of</sub>!() builtin macro | 0% | 0% | \- | 15th Mar 2025 | \- | 15th May 2025 | GCC 15.1 |
263+
| Generic Associated Types | 0% | 0% | \- | 15th Mar 2025 | \- | 15th Jun 2025 | GCC 16.1 |
264+
| RfL const generics | 0% | 0% | \- | 1st May 2025 | \- | 15th Jun 2025 | GCC 16.1 |
265+
| frontend plugin hooks | 0% | 0% | \- | 15th May 2025 | \- | 7th Jul 2025 | GCC 16.1 |
266+
| Handling the testsuite issues | 0% | 0% | \- | 15th Sep 2024 | \- | 15th Sep 2025 | GCC 16.1 |
267+
| std parser issues | 100% | 100% | \- | 7th Jan 2025 | 31st Jun 2024 | 28th Jan 2025 | GCC 16.1 |
268+
| main shim | 0% | 0% | \- | 28th Jul 2025 | \- | 15th Sep 2025 | GCC 16.1 |
269+
270+
| Past Milestone | Last Month | This Month | Delta | Start Date | Completion Date | Target | Target GCC |
271+
|-----------------------------------|------------|------------|-------|---------------|-----------------|---------------|------------|
272+
| Data Structures 1 - Core | 100% | 100% | \- | 30th Nov 2020 | 27th Jan 2021 | 29th Jan 2021 | GCC 14.1 |
273+
| Control Flow 1 - Core | 100% | 100% | \- | 28th Jan 2021 | 10th Feb 2021 | 26th Feb 2021 | GCC 14.1 |
274+
| Data Structures 2 - Generics | 100% | 100% | \- | 11th Feb 2021 | 14th May 2021 | 28th May 2021 | GCC 14.1 |
275+
| Data Structures 3 - Traits | 100% | 100% | \- | 20th May 2021 | 17th Sep 2021 | 27th Aug 2021 | GCC 14.1 |
276+
| Control Flow 2 - Pattern Matching | 100% | 100% | \- | 20th Sep 2021 | 9th Dec 2021 | 29th Nov 2021 | GCC 14.1 |
277+
| Macros and cfg expansion | 100% | 100% | \- | 1st Dec 2021 | 31st Mar 2022 | 28th Mar 2022 | GCC 14.1 |
278+
| Imports and Visibility | 100% | 100% | \- | 29th Mar 2022 | 13th Jul 2022 | 27th May 2022 | GCC 14.1 |
279+
| Const Generics | 100% | 100% | \- | 30th May 2022 | 10th Oct 2022 | 17th Oct 2022 | GCC 14.1 |
280+
| Initial upstream patches | 100% | 100% | \- | 10th Oct 2022 | 13th Nov 2022 | 13th Nov 2022 | GCC 14.1 |
281+
| Upstream initial patchset | 100% | 100% | \- | 13th Nov 2022 | 13th Dec 2022 | 19th Dec 2022 | GCC 14.1 |
282+
| Update GCC's master branch | 100% | 100% | \- | 1st Jan 2023 | 21st Feb 2023 | 3rd Mar 2023 | GCC 14.1 |
283+
| Final set of upstream patches | 100% | 100% | \- | 16th Nov 2022 | 1st May 2023 | 30th Apr 2023 | GCC 14.1 |
284+
| Borrow Checking 1 | 100% | 100% | \- | TBD | 8th Jan 2024 | 15th Aug 2023 | GCC 14.1 |
285+
| Procedural Macros 1 | 100% | 100% | \- | 13th Apr 2023 | 6th Aug 2023 | 6th Aug 2023 | GCC 14.1 |
286+
| GCC 13.2 Release | 100% | 100% | \- | 13th Apr 2023 | 22nd Jul 2023 | 15th Jul 2023 | GCC 14.1 |
287+
| GCC 14 Stage 3 | 100% | 100% | \- | 1st Sep 2023 | 20th Sep 2023 | 1st Nov 2023 | GCC 14.1 |
288+
| GCC 14.1 Release | 100% | 100% | \- | 2nd Jan 2024 | 2nd Jun 2024 | 15th Apr 2024 | GCC 14.1 |
289+
| format<sub>args</sub>!() support | 100% | 100% | \- | 15th Feb 2024 | \- | 1st Apr 2024 | GCC 14.1 |
290+
| GCC 14.2 | 100% | 100% | \- | 7th Jun 2024 | 15th Jun 2024 | 15th Jun 2024 | GCC 14.2 |
291+
| GCC 15.1 | 100% | 100% | \- | 21st Jun 2024 | 31st Jun 2024 | 1st Jul 2024 | GCC 15.1 |
292+
| Unhandled attributes | 100% | 100% | \- | 1st Jul 2024 | 15th Aug 2024 | 15th Aug 2024 | GCC 15.1 |
293+
| Deref and DerefMut improvements | 100% | 100% | \- | 28th Sep 2024 | 25th Oct 2024 | 28th Dec 2024 | GCC 15.1 |
294+
295+
## Planned Activities
296+
297+
- Finish usage of lang items for codegen
298+
- Finish for-loops code expansion
299+
- Improve our process for updating our github repository with upstream
300+
GCC
301+
302+
### Risks
303+
304+
There have been no changes to the Risk table this month
305+
306+
| Risk | Impact (1-3) | Likelihood (0-10) | Risk (I \* L) | Mitigation |
307+
|----------------------------------------|--------------|-------------------|---------------|-----------------------------------------------------------------|
308+
| Missing features for GCC 15.1 deadline | 2 | 1 | 2 | Start working on required features as early as July (6mo ahead) |
309+
310+
## Detailed changelog

0 commit comments

Comments
 (0)