227 Commits

Author SHA1 Message Date
Campbell Barton
6c640d627d GNUMakefile: include additional CMakeLists files in spelling check 2025-09-06 09:28:24 +10:00
luz paz
d18e0cb573 Cleanup: correct typos in GNUmakefile & CMakeLists.txt
Ref !145814
2025-09-06 08:51:25 +10:00
Campbell Barton
8ede46ae1e Makefile: support passing in arguments to check_spelling.py
Handy to support different checks.
2025-06-19 00:10:19 +00:00
Hans Goudey
91803e130f Cleanup: Grammar: Fix uses of "for e.g."
e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.

Pull Request: https://projects.blender.org/blender/blender/pulls/139596
2025-05-29 21:21:18 +02:00
Campbell Barton
0265b13399 Tools: add a utility to validate array sizes
The script check_source/static_check_size_comments.py run directly
or called via the convenience target "make check_size_comments".

Add a utility module: `line_number_utils` which implements
a version of `re.finditer` that includes line numbers & ranges.
2025-05-23 14:04:26 +10:00
Brecht Van Lommel
7614bf9602 Docs: Fix outdated description of update in make help 2025-05-22 17:02:49 +02:00
Sebastian Parborg
6d442ca4f1 Build: Make Linux Lib building reproducible
There are two parts for this PR. One is to change some of our build pipeline to make certain libs reproducible. For this part I want to clarify two things:

1. Why change python to use `--disable-optimizations`?
This is because `--enable-optimizations` turns on PGO (Profile Guided Optimization). PGO is sadly not deterministic and will create different binaries on every recompile. So to create reproducible build this needs to be turned off. This also seems to only have been turned on for Linux specifically(?) on our side. So on Windows and Mac our python build already doesn't have PGO.

2. Why split out cython and zstandard from site-packages?
Sadly pip does not seem to respect `SOURCE_DATE_EPOCH`. It also creates temporary folders with random hashes in them that is then recorded into the Cython libraries (I'll touch on this again later). I've looked at the discussions about this upstream and sadly the pip maintainers do not really want people to use pip as a reproducible build system pipeline and instead directs users to other solutions if they want reproducible builds.

The other part is about setting up our pipeline to not introduce any random hashes or build timestamps into our libraries. Here I do two things:

1. We need to set the `SOURCE_DATE_EPOCH` environmental variable to a specific date that will not change.
This is needed as the compile time date is recorded in certain libraries and files. (So hard coding it with this env var will make the end result reproducible)

2. We need to strip the created static and shared libraries. This is because the static libraries are not created in a deterministic way. For shared libraries some of our libraries includes debug symbols which contains paths to temporary files with random hashes. To solve this without stripping in post, we would need to either patch the linker on Rocky8 or patch a lot of our libraries. I think it is better to just do this as a post build step. (This seems to be what most linux distributions do as well).

With all this, we can make our Linux library builds is almost 100% reproducible. (At least on my machine where I tested)
By almost, I mean that there is sadly a catch in that certain libraries like Cython saves the source code path in their libraries for error messages. However now the builds are reproducible if the folder path is the same.
IE if the libraries are always built in `/home/builder/build_linux/deps_x64`, then they should now be reproducible.

Pull Request: https://projects.blender.org/blender/blender/pulls/134221
2025-05-09 15:25:16 +02:00
наб
4710639619 Fix: GNUmakefile error erroring without the error message on Win32
Ref !136839
2025-04-04 21:02:47 +11:00
Campbell Barton
357e7e1ab2 PyDoc: support disabling online access when building the API docs 2025-04-04 10:14:21 +11:00
Sebastian Parborg
0a9dc14c2e Merge branch 'blender-v4.4-release' 2025-03-04 13:56:10 +01:00
Sebastian Parborg
277add8fc9 Add ability to create a test data archive with make_source_archive
This makes it so that we ship the test data for every major release
in its own separate archive. (In case someone wants to easily run the
tests for a specific older release without using git)

Pull Request: https://projects.blender.org/blender/blender/pulls/135293
2025-03-04 13:55:23 +01:00
Campbell Barton
ad4eb66fdf Tools: add OUTPUT_DIR option to the "check_cppcheck" target
- Add optional `--build-dir` & `--output-dir` arguments to
  "static_check_cppcheck.py".
- Support using `project_source_info.py` without the CWD having
  to be the build-directory.
- Make the script executable.
2025-02-11 13:07:36 +11:00
Campbell Barton
53c61f6aa5 Makefile: include doc & build_files in spell checking 2025-02-02 13:58:21 +11:00
Campbell Barton
cb83a41dc4 Cleanup: spelling in comments
Also include "release/" in the `check_spelling_py` target.
2025-01-31 15:07:11 +11:00
Campbell Barton
030f367c33 Tools: remove project_netbeans
Remove the script that converted an eclipse project to netbeans,
it seems unlikely this was widely used since it wrote to an old/outdated
project file format.

Since this was written, most IDE's (including NetBeans) have improved
their CMake support.
2025-01-02 16:01:17 +11:00
Bastien Montagne
e83d87f588 Move several py scripts from build_files to tools.
Preliminary step towards adding 'system python' validation for some
build-essential py scripts (!130746).

Pull Request: https://projects.blender.org/blender/blender/pulls/132025
2024-12-17 19:02:45 +01:00
Dalai Felinto
0a4dbc57b8 make license: command to update the license file
This generates a `license.md` file with all the relevant information about
the different libraries and their respecive licenses.

This should replace: THIRD-PARTY-LICENSES.txt

Important files:
* `make_license.py` (main script called by `make license`.
* `licenses.json` (file to add the definition of new licenses).
* `licenses/*/*.txt` (individual license files.

The `license.md` groups the libraries per license, list their
corresponding copyright information and include the complete license.

Code includes contributions from:
* Campbell Barton (multi-line parser for versions.cmake).
* Thomas Dinges (Windows support for `make license`).

Part of: !129018
2024-10-18 17:09:43 +02:00
Brecht Van Lommel
b74dfa8cfc Build: Changes for make deps to work on Linux arm64 again
This is not an officially supported platform, but it was working before
so might as well keep it up to date.

* Tweak logic for various BLENDER_PLATFORM_ARM checks
* Use linux_arm64 name for folders, matching Windows and macOS
* CUDA is enabled, SYCL and HIP are not
* Tested to work on Rocky Linux 8
2024-09-24 15:54:47 +02:00
Campbell Barton
0d88125da5 Tools: support check_spelling for CMake files 2024-09-20 13:14:56 +10:00
Campbell Barton
a8fae77f10 Cleanup: remove unused icon utilities and make convenience target
Remove utilities to assist in creation of the now removed `*.dat` icons.

Pull Request: https://projects.blender.org/blender/blender/pulls/123837
2024-06-27 18:28:32 +02:00
Brecht Van Lommel
1dfa553822 Build: Use a different folder per architecture for "make deps"
To avoid accidentally trying to build different archs in the same
folder.
2024-06-19 19:02:39 +02:00
Brecht Van Lommel
44309ac7e1 Build: Change make deps HARVEST_TARGET to new Git LFS location 2024-06-18 18:20:54 +02:00
Campbell Barton
f6605523e8 cppheck: improvements to checking script
Various changes that simplify running cppcheck, comparing results
from the previous execution.

- Create a summary of the log that groups errors by type,
  useful since some kinds of warnings tend to lead to errors in the
  code more than others.
- Keep a copy of the previous runs logs - useful for comparisons.
- Log the output in the order of the files selected to check.
- Fix non thread-safe output sometimes mixing warnings from different
  processes.
2024-04-14 20:44:03 +10:00
Brecht Van Lommel
624e0b1519 Merge branch 'blender-v4.1-release' into main 2024-02-22 15:12:40 +01:00
Brecht Van Lommel
eadfda30e6 Fix: make format and make deps not using new lib directory 2024-02-22 15:11:44 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Campbell Barton
2119d271e0 Cleanup: remove "-noaudio" argument in background mode
This is no longer needed as background mode implies -noaudio.
2024-02-14 00:13:38 +11:00
Campbell Barton
170b69cc5f Makefile: update code-layout checking target
Rename check_wiki_file_structure to check_docs_file_structure and
call updated script.
2024-02-03 13:13:56 +11:00
Brecht Van Lommel
7c9c916b02 Build: improve make icons detection of Inkscape and Blender on macOS
Respect INKSCAPE_BIN and BLENDER_BIN environment variables if set,
make expected Inkscape path show when missing, simplify code.
2024-01-24 18:55:54 +01:00
Brecht Van Lommel
461a598ed5 Build: don't write __pycache__ files into lib folder for make commands
These scripts are not performance critical, and the cache files could
potentially interfere with library updates in the future.
2024-01-23 20:29:07 +01:00
Thomas Dinges
64fc6d7890 Docs: Replace most wiki links with links to new developer docs
Exceptions:
* Links to personal wiki pages
* Pages that are not in the new developer docs yet (like Human Interface Guidelines)
* tools\check_wiki\check_wiki_file_structure.py needs a refactor
2024-01-18 16:49:38 +01:00
Brecht Van Lommel
0e68898a37 Fix: broken make update on new macOS build
Properly check for the existence of the Python binary in precompiled libs.
2024-01-16 14:19:37 +01:00
Brecht Van Lommel
679721ed64 Fix: make update fails in some cases after recent changes
After defaulting to the Python binary from the precompiled libraries,
what could happen was that an older Python lib folder stuck around because
of pycache files, but there was no actual working Python binary for that
version.

Check for the existence of the binary instead of the lib files to solve it.
Also allow Python 3.10 binary for make update.
2024-01-12 16:13:15 +01:00
Brecht Van Lommel
6c6251e61c Fix: make format wrong results on Linux with system Python 3.12
There is currently a bug with autopep8 and Python 3.12, resulting in
the contents of f-strings getting modified when they shouldn't.

As a workaround, "make format" now uses the Python binary bundled with
the precompiled libraries on Linux by default. This matches existing
behavior on macOS and Windows.

Pull Request: https://projects.blender.org/blender/blender/pulls/116993
2024-01-11 14:27:03 +01:00
Campbell Barton
5afd33d129 PyAPI: drop support for Python 3.10
All platforms have been updated to support 3.11
so supporting 3.10 is no longer needed.
2024-01-09 22:23:41 +11:00
Brecht Van Lommel
cc38b7a50d Build: auto detect Python version available in libs for make format
Instead of hardcoding one specific version, makes updating libs a bit
easier.
2024-01-02 13:55:50 +01:00
Campbell Barton
cd0967d3e1 Fix autopep8 reference for "make format" on Linux 2023-12-24 17:47:06 +11:00
Campbell Barton
994a93bd22 Fix "make doc_man" not working, after recent changes
Since [0] man page generation calls PYTHON directly.

[0]: 5486c70aae
2023-11-29 16:02:33 +11:00
Brecht Van Lommel
cf1b3eee99 Fix "make doc_man" not working, after changes in 61d99d45
Ref #115127
2023-11-22 20:01:41 +01:00
Campbell Barton
16e75a93f7 Makefile: remove redundant directory changing
This printing an error if the build directory didn't exist,
remove as it's not needed.
2023-09-29 16:44:31 +10:00
Campbell Barton
73057cfd22 check_spelling: include *.metal files 2023-09-07 20:44:33 +10:00
Campbell Barton
9af2291541 check_spelling: rename check_spelling_osl -> check_spelling_shaders
- 'make check_spelling_shaders' now checks MSL & GLSL spelling.
- Add '--match' argument to 'check_spelling.py' for more configurable
  checks without relying on picking directories that only contain the
  desired file-type.
- Ignore spelling for scripts/addons & scripts/addons_contrib.
2023-09-03 21:35:07 +10:00
Campbell Barton
0fb4c107db Makefile: remove "make authors"
Since adding authors involves checking if their contribution requested
exclusion from the AUTHORS list, this isn't an action that should be
run and committed without some manual checking.

Since the script works without arguments and isn't an action most
developers should be running & committing, having a convenience entry
isn't especially useful.
2023-08-18 09:26:02 +10:00
Campbell Barton
63fa5b92e7 Authors Script: add script to generate individual contributors
Add the script used generate individual contributors for AUTHORS,
add "make authors" utility that updates the AUTHORS file in-place.
2023-08-16 21:00:20 +10:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
b1daf6bfad Tools: add --jobs arguments to clang checker and code-clean tool
Setting jobs to one is useful for debugging, reducing the number
of threads can be useful for code_clean as a background task.
2023-07-21 00:13:13 +10:00
Campbell Barton
2c9aa2c8e5 code checker: add 'make check_struct_comments'
This utility uses Python's clang module to validate comments intended
to match the struct member names. `cmake_static_check_clang.py` has
been written to support adding other checkers in the future.
2023-07-18 14:34:59 +10:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Campbell Barton
b44dace9d8 Build: remove smatch, sparse & splint checking scripts
These checkers were all C-only making them increasingly less useful.
2023-04-21 23:32:55 +10:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00