Zulip Chat Archive

Stream: mathlib4

Topic: Merge conflicts now


Martin Dvořák (Nov 19 2025 at 07:42):

Why do all PRs have merge conflicts now?

Johan Commelin (Nov 19 2025 at 07:50):

Because we just merged the module system change into master

Johan Commelin (Nov 19 2025 at 07:52):

Although it doesn't seem to have affected the #queue that much

Nailin Guan (Nov 19 2025 at 08:45):

How should I shift to the module system? Any written down instructions?

Rémy Degenne (Nov 19 2025 at 08:50):

There will be an announcement about it soon.

Nailin Guan (Nov 19 2025 at 09:07):

Just to confirm, adding module infront of imports then use public import replacing import should work?

Michael Rothgang (Nov 19 2025 at 09:11):

If it compiles, that good enough for now. (In the future, we may decide to switch to more fine-grained imports. That will be a separate policy change and announcement.)

Nailin Guan (Nov 19 2025 at 09:22):

Cache has nothing usable, so I have no idea whether it compile...

Riccardo Brasca (Nov 19 2025 at 09:24):

It will surely take some time to rebuild all the PRs, so just be patient

Kim Morrison (Nov 19 2025 at 10:06):

There's some information and links available at #mathlib4 > Mathlib has moved to the new module system now.

But yes, every file needs to start with module (most of Mathlib now does), and the first step to getting something working is changing every import to public import. After that, if you have a new file, try adding @[expose] public section at the top of the file (like most of Mathlib right now).

Kim Morrison (Nov 19 2025 at 10:06):

There's no need for now to "get the imports right", i.e. to avoid using public where possible, etc. We will have tooling soon that will help with this.

Kenny Lau (Nov 19 2025 at 10:34):

Could I have a short explanation of what all three of those magic formulas mean? (1. module, 2. public import, 3. expose public section)

Michael Rothgang (Nov 19 2025 at 10:40):

The documentation linked in the announcement explains it well. If you don't want to ignore these magic words, the simplest way is to just read that.

Michael Rothgang (Nov 19 2025 at 10:41):

In short: the module keyword says this file uses the module system (now mandatory within mathlib); the others allow mathlib to adapt the module system with minimal changes (and will, perhaps, go away in the long term).

Nailin Guan (Nov 19 2025 at 10:44):

Maybe not an appropriate place, but can we have this kind of big shift in announce priorior to the change itself? Also is it possible to to have auto fix for these kind of updates for PR?


Last updated: Dec 20 2025 at 21:32 UTC