summaryrefslogtreecommitdiff
path: root/src/buildstream/_platform/platform.py
Commit message (Collapse)AuthorAgeFilesLines
* _platform/platform.py: Remove outdated commentChandan Singh2020-07-151-1/+0
| | | | | | | | "Preferred" sandboxes used to be a thing when we had sandbox implementations in BuildStream Core. This should probably have been removed at the same time as dropping the notion of preferred sandboxes, but that was likely an oversight.
* Completely abolish job pickling.tristan/nuke-pickle-jobberTristan van Berkom2020-06-151-14/+0
|
* Drop Platform subclasses and BST_FORCE_BACKENDjuerg/sandbox-drop-bwrapJürg Billeter2020-06-031-29/+17
| | | | | With the use of buildbox-run on all platforms, there is no longer any platform-specific code in the Platform subclasses.
* Drop sandbox selection and BST_FORCE_SANDBOXJürg Billeter2020-06-031-53/+10
| | | | | | | buildbox-run is the only local sandbox and there are no plans to add other sandboxing backends in the future. New platforms can be supported by new buildbox-run implementations without requiring any changes in BuildStream.
* _platform: Drop maximize_open_file_limit()Jürg Billeter2020-06-031-17/+0
| | | | | Without the SafeHardlinks FUSE filesystem there is no longer a need to increase the open file limit.
* Switch preferred sandbox from bwrap to buildbox-runJürg Billeter2020-04-281-1/+5
| | | | | This also enables local builds on non-Linux platforms, if a buildbox-run implementation is available.
* _platform.py: Reset Sandbox._dummy_reasons in _check_sandbox()Jürg Billeter2020-04-281-0/+1
| | | | This fixes an isolation issue in the test suite.
* _sandboxbuildboxrun.py: Detect platforms supported by buildbox-runjuerg/platformJürg Billeter2020-04-141-3/+3
| | | | | | This allows builds where the host OS or architecture doesn't match the build OS or architecture, if the buildbox-run implementation supports it. E.g., this allows x86-32 builds on x86-64 systems.
* Drop concept of partially supported sandbox configurationJürg Billeter2020-04-141-1/+1
| | | | | | | | | | | | Allowing builds without affecting the cache key but disallowing push, when the sandbox configuration is not fully compatible, results in an inconsistent user experience and may lead to unexpected build issues. Especially as push is allowed or disallowed based on the sandbox available at the time of push, not at the time of build. The previous commit making build-uid and build-gid configuration optional allows each project to decide whether the sandbox is required to support UID/GID configuration or not.
* Canonicalize OS nameJürg Billeter2020-02-271-1/+7
| | | | This matches the REAPI platform lexicon.
* _platform: Don't use psutil.Process.cpu_affinity on unsupported platformschandan/fix-cpu-countChandan Singh2019-12-311-1/+9
| | | | | | | | | | | | | `psutil.Process.cpu_affinity` is not available on many non-Linux platforms, like AIX and Solaris. We already have such a case with Darwin where we need to resort to using `os.cpu_count()`. Rather than adding more subclasses and overrides, add that logic as a fallback in the main `Process` class. `os.cpu_count()` should generally always be available, so hopefully we will only need to override this in future too much or at all. Fixes #1244.
* _platform/platform.py: Add alias for IBM AIX 7 powerpcChandan Singh2019-12-231-3/+11
| | | | | | | | | | | * `uname -m` is unusable in case of IBM AIX 7 as it reports the serial number of the machine. As a workaround, special case it and use the reported processor identifier. * tests/format/optionos.py: Don't use AIX for unsupported architecture `AIX` is special-cased in BuildStream, so use a different system for testing unsupported architectures.
* _platform/platform.py: Add alias for sun4vChandan Singh2019-12-231-0/+1
| | | | | | | | | | | Some Solaris 11 servers report `uname -m` as `sun4v`. It uses the same SPARC v9 processor architecture so add an alias for it as we already support `sparc-v9`. `uname -a` output for reference: $ uname -a SunOS sundev1 5.11 11.3 sun4v sparc sun4v Solaris
* _platform/platform.py: Add powerpc64 and powerpc64leJavier Jardón2019-12-171-0/+2
|
* _platform: Support experimental buildbox-run sandbox on all platformsJürg Billeter2019-12-101-3/+24
| | | | | The buildbox-run sandbox is used only if BST_FORCE_SANDBOX is set to buildbox-run.
* Reformat code using BlackChandan Singh2019-11-141-32/+37
| | | | | | | As discussed over the mailing list, reformat code using Black. This is a one-off change to reformat all our codebase. Moving forward, we shouldn't expect such blanket reformats. Rather, we expect each change to already comply with the Black formatting style.
* win32: _platform/win32: add support for win32Angelos Evripiotis2019-10-141-0/+4
| | | | | | Copy the approach of 'Darwin' and provide a SandboxDummy. This enables us to run 'bst workspace list' on Windows.
* Remove uneccesary _platform.multiprocessingaevri/nompAngelos Evripiotis2019-08-201-8/+0
| | | | | | | | It turns out we don't need to use multiprocessing.Manager() queues when using the 'spawn' method - the regular multiprocessing queues are also picklable, if passed as parameters to the new process. Thanks to @BenjaminSchubert for pointing this out.
* Support pickling jobs if the platform requires itAngelos Evripiotis2019-08-161-2/+19
| | | | | | | | Add support for using `multiprocessing.Manager` and the associated queues. Downgrade the queue event callback guarantees accordingly. In later work we may be able to support callbacks in all scenarios. Pickle and unpickle the child job if the platform requires it.
* Abstract mp Queue usage, prep to spawn processesAngelos Evripiotis2019-08-161-0/+5
| | | | | | | Pave the way to supporting starting processes by the 'spawn' method, by abstracting our usage of `multiprocessing.Queue`. This means we can easily switch to using a multiprocessing.Manager() and associated queues instead when necessary.
* Store Platform reference in Context instance variableJürg Billeter2019-07-171-10/+2
| | | | | This allows us to remove the platform reset helpers in tests/conftest.py.
* Refactor of Platform and SandboxWilliam Salmon2019-07-121-8/+63
|
* platform: re-scope set_resource_limitsAngelos Evripiotis2019-07-021-11/+14
| | | | | | | | | | | | | Rename 'set_resource_limits' to 'maximize_open_file_limit', as this seems to more accurately reflect it's function. Remove unused flexibility from the implementation, to make it easier to understand. Simplify the Mac implementation, and add some explanation for the OPEN_MAX magic number. In later work we should remove the magic number. Import 'resource' late, which is not available on Windows.
* _platform.get_cpu_count: use psutil instead of osaevri/psutil_affinityAngelos Evripiotis2019-06-181-1/+3
| | | | | | | | Be Windows-friendly by using the portable `psutil.Process().cpu_affinity()` instead of `os.sched_getaffinity`. Note that unfortunately this still doesn't work on Mac, so we keep that platform-specific override.
* Move source from 'buildstream' to 'src/buildstream'Chandan Singh2019-05-211-0/+164
This was discussed in #1008. Fixes #1009.