Skip to content

Conversation

@tobiasdiez
Copy link
Contributor

Now that we use meson with a full out-of-tree build, we no longer need to gitignore generated files in the src folder. In fact, it's strongly recommended that those older files should be deleted so that they don't get accidentally picked-up by Python at runtime.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Now that we use meson with a full out-of-tree build, we no longer need to gitignore generated files in the src folder. In fact, it's strongly recommended that those older files should be deleted so that they don't get accidentally picked-up by Python at runtime.
@github-actions
Copy link

github-actions bot commented Oct 19, 2025

Documentation preview for this PR (built with commit 38d96eb; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@tobiasdiez tobiasdiez requested a review from dimpase October 19, 2025 03:39
worktree*
**/worktree*

# Meson build directory
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have gitignore files on their own.

@user202729
Copy link
Contributor

Someone still on sage-the-distro may want to sanity check this doesn't ignore "too little" things. Maybe @jhpalmieri @culler ?

Side note, apparently the .gitignore is used by the CI in a nontrivial way (see the force push https://github.com/sagemath/sage/compare/3b4f7ea4a0a8646386940ebe17f521d0d2ad0415..924cd044bbbca5a5cebd934ef32e1e83a4985050 in #41018 ) . We hope this doesn't break the CI (distro) workflow or anything similar.

There's another issue that on my machine (meson on mamba) src/doc/{doctrees,inventory,latex} aren't gitignored, but not very relevant to this issue.

@jhpalmieri
Copy link
Member

If I apply this to a previous Sage build, the git repo has a ton of untracked files. With a fresh build of 10.8.beta7 (without building the documentation), a lot of .txt files in src/doc/en/installation/ are now untracked, as are many .rst files in src/doc/en/reference/spkg/. If I apply this to an older build, many .c and .so files in the Sage library are now untracked.

@jhpalmieri
Copy link
Member

If I take a fresh clone of the git repo and run ./bootstrap, all of those .txt and .rst files get generated, so the git repo is not clean.

@dimpase
Copy link
Member

dimpase commented Oct 20, 2025

Thanks @jhpalmieri

I can confirm that src/doc/en/installation/*.txt and src/doc/en/reference/spkg/*.rst (except src/doc/en/reference/spkg/index.rst must be listed in .gitignore.

Or, perhaps, they should not be even installed there, they should go directly to build/sage-distro/src/doc
(or, in general, into <builddir>/src/doc), and this installation can be carried out later, only when the docs are built, right?

Add patterns to ignore generated documentation files.
Copy link
Member

@dimpase dimpase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's OK now, after testing locally on 2 different machines

@tobiasdiez
Copy link
Contributor Author

@jhpalmieri thanks for testing.

Or, perhaps, they should not be even installed there, they should go directly to build/sage-distro/src/doc
(or, in general, into /src/doc), and this installation can be carried out later, only when the docs are built, right?

This is actually already implemented. The problem is that doc/bootstrap is now run twice for sage-the-distro users: once for actually building the docs (where it generates the files in build/sage-distro) and once during bootstrap where it generates in src/doc. The latter call during bootstrap is removed in #40841.

@jhpalmieri
Copy link
Member

jhpalmieri commented Oct 28, 2025

Because this is likely to result in untracked files in git repos for some people with existing Sage installations (people who have been incorporating changes to Sage via incremental upgrades and builds), I suggest that when this gets merged, it should get merged into an early beta release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants