ignore more files in Git?

Am I doing something wrong?
$ git status --ignored On branch edison-acpi Your branch is up to date with 'gh-andy-shev/edison-acpi'.
Ignored files: (use "git add -f <file>..." to include in what will be committed) tools/binman/__pycache__/ tools/binman/etype/__pycache__/ tools/concurrencytest/__pycache__/ tools/dtoc/__pycache__/ tools/patman/__pycache__/
nothing to commit, working tree clean

On Tue, Nov 30, 2021 at 03:06:23PM +0200, Andy Shevchenko wrote:
Am I doing something wrong?
$ git status --ignored On branch edison-acpi Your branch is up to date with 'gh-andy-shev/edison-acpi'.
Ignored files: (use "git add -f <file>..." to include in what will be committed) tools/binman/__pycache__/ tools/binman/etype/__pycache__/ tools/concurrencytest/__pycache__/ tools/dtoc/__pycache__/ tools/patman/__pycache__/
nothing to commit, working tree clean
I don't know? `git status --ignored` shows ignored files and __pycache__ is in the top-level .gitignore file.

On Tue, Nov 30, 2021 at 3:23 PM Tom Rini trini@konsulko.com wrote:
On Tue, Nov 30, 2021 at 03:06:23PM +0200, Andy Shevchenko wrote:
Am I doing something wrong?
$ git status --ignored On branch edison-acpi Your branch is up to date with 'gh-andy-shev/edison-acpi'.
Ignored files: (use "git add -f <file>..." to include in what will be committed) tools/binman/__pycache__/ tools/binman/etype/__pycache__/ tools/concurrencytest/__pycache__/ tools/dtoc/__pycache__/ tools/patman/__pycache__/
nothing to commit, working tree clean
I don't know? `git status --ignored` shows ignored files and __pycache__ is in the top-level .gitignore file.
These files are products of `make O=...`. There are no issues when I build inside the tree (dunno why). But I definitely won't build in the source tree folder.

On Tue, Nov 30, 2021 at 5:28 PM Andy Shevchenko andy.shevchenko@gmail.com wrote:
On Tue, Nov 30, 2021 at 3:23 PM Tom Rini trini@konsulko.com wrote:
On Tue, Nov 30, 2021 at 03:06:23PM +0200, Andy Shevchenko wrote:
Am I doing something wrong?
$ git status --ignored On branch edison-acpi Your branch is up to date with 'gh-andy-shev/edison-acpi'.
Ignored files: (use "git add -f <file>..." to include in what will be committed) tools/binman/__pycache__/ tools/binman/etype/__pycache__/ tools/concurrencytest/__pycache__/ tools/dtoc/__pycache__/ tools/patman/__pycache__/
nothing to commit, working tree clean
I don't know? `git status --ignored` shows ignored files and __pycache__ is in the top-level .gitignore file.
These files are products of `make O=...`. There are no issues when I build inside the tree (dunno why). But I definitely won't build in the source tree folder.
I realized that I might be unclear about the point. The problem here is that the source tree becomes dirty after clear instruction to get all temporary stuff out of the tree folder.

On Tue, Nov 30, 2021 at 05:39:36PM +0200, Andy Shevchenko wrote:
On Tue, Nov 30, 2021 at 5:28 PM Andy Shevchenko andy.shevchenko@gmail.com wrote:
On Tue, Nov 30, 2021 at 3:23 PM Tom Rini trini@konsulko.com wrote:
On Tue, Nov 30, 2021 at 03:06:23PM +0200, Andy Shevchenko wrote:
Am I doing something wrong?
$ git status --ignored On branch edison-acpi Your branch is up to date with 'gh-andy-shev/edison-acpi'.
Ignored files: (use "git add -f <file>..." to include in what will be committed) tools/binman/__pycache__/ tools/binman/etype/__pycache__/ tools/concurrencytest/__pycache__/ tools/dtoc/__pycache__/ tools/patman/__pycache__/
nothing to commit, working tree clean
I don't know? `git status --ignored` shows ignored files and __pycache__ is in the top-level .gitignore file.
These files are products of `make O=...`. There are no issues when I build inside the tree (dunno why). But I definitely won't build in the source tree folder.
I realized that I might be unclear about the point. The problem here is that the source tree becomes dirty after clear instruction to get all temporary stuff out of the tree folder.
*shakes fist at python* I don't know if that's changeable behavior or not, it would be good to know and document / address if possible. Maybe the kernel folks have had to figure out this problem already?

On 30/11/2021 17.02, Tom Rini wrote:
On Tue, Nov 30, 2021 at 05:39:36PM +0200, Andy Shevchenko wrote:
These files are products of `make O=...`. There are no issues when I build inside the tree (dunno why). But I definitely won't build in the source tree folder.
I realized that I might be unclear about the point. The problem here is that the source tree becomes dirty after clear instruction to get all temporary stuff out of the tree folder.
*shakes fist at python* I don't know if that's changeable behavior or not, it would be good to know and document / address if possible. Maybe the kernel folks have had to figure out this problem already?
We could probably set and export PYTHONDONTWRITEBYTECODE in the main Makefile when doing an out-of-tree build. Or maybe one could play around with setting PYTHONPYCACHEPREFIX based on O=, though that seems to be for 3.8+, so probably not everybody has that. Of course neither of those should be touched by the build system if already set in the incoming environment.
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE
Rasmus

On Tue, Nov 30, 2021 at 09:21:08PM +0100, Rasmus Villemoes wrote:
On 30/11/2021 17.02, Tom Rini wrote:
On Tue, Nov 30, 2021 at 05:39:36PM +0200, Andy Shevchenko wrote:
These files are products of `make O=...`. There are no issues when I build inside the tree (dunno why). But I definitely won't build in the source tree folder.
I realized that I might be unclear about the point. The problem here is that the source tree becomes dirty after clear instruction to get all temporary stuff out of the tree folder.
*shakes fist at python* I don't know if that's changeable behavior or not, it would be good to know and document / address if possible. Maybe the kernel folks have had to figure out this problem already?
We could probably set and export PYTHONDONTWRITEBYTECODE in the main Makefile when doing an out-of-tree build. Or maybe one could play around with setting PYTHONPYCACHEPREFIX based on O=, though that seems to be for 3.8+, so probably not everybody has that. Of course neither of those should be touched by the build system if already set in the incoming environment.
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE
Setting PYTHONPYCACHEPREFIX to objdir might be a good idea.
participants (3)
-
Andy Shevchenko
-
Rasmus Villemoes
-
Tom Rini