Skip to content

Commit

Permalink
[ci] build.py: Add nice when compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
feisuzhu committed Apr 27, 2023
1 parent 23ac5da commit 5a7ead1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/scripts/ti_build/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .ospkg import setup_os_pkgs
from .python import get_desired_python_version, setup_python
from .sccache import setup_sccache
from .tinysh import Command, CommandFailed, git
from .tinysh import Command, CommandFailed, git, nice
from .vulkan import setup_vulkan


Expand Down Expand Up @@ -50,7 +50,8 @@ def build_wheel(python: Command, pip: Command) -> None:
python("setup.py", "clean")
python("misc/make_changelog.py", "--ver", "origin/master", "--repo_dir", "./", "--save")

python("setup.py", *proj_tags, "bdist_wheel", *extra)
with nice():
python("setup.py", *proj_tags, "bdist_wheel", *extra)


@banner("Install Build Wheel Dependencies")
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/scripts/ti_build/tinysh.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,19 @@ def sudo():
return prefix("sudo")


def nice():
"""
Wrap a command with sudo.
"""
if IS_WINDOWS:
from .misc import warn

warn("nice is not yet implemented on Windows")
return with_options({})
else:
return prefix("nice")


sh = Command()
git = sh.git
# Use setup_python !
Expand Down

0 comments on commit 5a7ead1

Please sign in to comment.