Skip to content

Commit

Permalink
Switch to '#!/usr/bin/env python3' shebang lines
Browse files Browse the repository at this point in the history
Since the Docker build image runs a python virtual environment now.

Also added 'scripts/runDocker' script which will invoke docker locally
with the same image used in Github CI, for testing.

Note this script will pull over a GB of Docker stuff onto the machine
it's invoked on, if the image is not already cached.
  • Loading branch information
oddhack committed Jul 9, 2024
1 parent 2554b17 commit 839e5df
Show file tree
Hide file tree
Showing 19 changed files with 48 additions and 18 deletions.
2 changes: 1 addition & 1 deletion scripts/apiconventions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2021-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/cgenerator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/checklinks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
#
# Copyright 2013-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/clconventions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/docgenerator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/extensionmetadocgenerator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/genRef.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
#
# Copyright 2016-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_dictionaries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3

# Copyright 2019-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_version_notes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3

# Copyright 2019-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/gencl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/parse_dependency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3

# Copyright 2022-2024 The Khronos Group Inc.
# Copyright 2003-2019 Paul McGuire
Expand Down
2 changes: 1 addition & 1 deletion scripts/pygenerator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/realign.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
#
# Copyright 2013-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/reflib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
#
# Copyright 2016-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/reg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
30 changes: 30 additions & 0 deletions scripts/runDocker
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Copyright 2022-2024 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0

# runDocker - run the Khronos `asciidoctor-spec` Docker image with a local
# clone of the specification repository.
# The following command-line tools are required to run this script:
# awk dirname docker grep id realpath
# These are all normal Linux developer tools except for 'docker' itself.

# Determine path to repository root directory
scriptpath=`dirname $0`
repopath=`realpath $scriptpath/..`

# Get SHA256 of the asciidoctor-spec image build used by CI.
image=`grep -m 1 khronosgroup/docker-images@sha256: $repopath/.github/workflows/presubmit.yml | \
awk '{print $2}'`

uid=`id -u`
gid=`id -g`
echo "Executing Docker with spec build image and mounted spec repository root:"

# --user causes Docker to run as the specified UID:GID instead of as root
# -it runs interactively and uses a pseudotty
# --rm removes the container on exit
# -v mounts the repository clone as /vulkan in the container
# $image is image to run
# /bin/bash drops into a shell in the container
set -x
docker run --network=host --user ${uid}:${gid} -it --rm -v ${repopath}:/opencl $image /bin/bash
2 changes: 1 addition & 1 deletion scripts/scriptgenerator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/spec_tools/conventions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3 -i
#!/usr/bin/env python3 -i
#
# Copyright 2013-2024 The Khronos Group Inc.
#
Expand Down

0 comments on commit 839e5df

Please sign in to comment.