Skip to content

Commit

Permalink
Merge branch 'main' into cond-to-depend
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Aug 25, 2024
2 parents 1529279 + 0fd1944 commit 9a0c15e
Show file tree
Hide file tree
Showing 154 changed files with 4,946 additions and 3,235 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
60 changes: 60 additions & 0 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Presubmit

permissions:
contents: read

# Controls when the action will run.
on:
push:
workflow_dispatch:
pull_request:

# These jobs are potentially parallelizeable
jobs:
build:
name: Build spec artifacts
runs-on: ubuntu-latest
# Refer to the build container by its SHA instead of the name, to
# prevent caching problems when updating the image.
# container: khronosgroup/docker-images:asciidoctor-spec.20240702
container: khronosgroup/docker-images@sha256:4aab96a03ef292439c9bd0f972adfa29cdf838d0909b1cb4ec2a6d7b2d14a37f

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# If fetch-depth: 0 is not specified, then
# git describe --tags --dirty
# below fails.
# This could also affect SPECREVISION in the Makefile.
fetch-depth: 0

# Ownerships in the working directory are odd.
# . is owned by UID 1001, while repo files are owned by root.
# This leads to many odd messages like
# fatal: detected dubious ownership in repository at '/__w/OpenCL-Docs/OpenCL-Docs'
# The 'git config' is a brute-force workaround.
- name: Git safe directory workaround
run: |
git config --global --add safe.directory '*'
ls -lda . .. .git Makefile
- name: Validate XML
run: |
make -C xml validate
- name: Generate core specs (HTML and PDF)
run: |
python3 makeSpec -clean -spec core OUTDIR=out.core -j 5 -O api c env ext cxx4opencl
- name: Generate core + KHR extension specs (HTML)
run: |
python3 makeSpec -clean -spec khr OUTDIR=out.khr -j -O html
- name: Generate core + KHR + EXT extension specs (HTML)
run: |
python3 makeSpec -clean -spec khr+ext OUTDIR=out.khr+ext -j -O html
- name: Generate reference pages
run: |
python3 makeSpec -spec khr OUTDIR=out.refpages -j -O manhtmlpages
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
dist: focal

# Only build (and deploy) on travis for tags.
# Use GitHub actions for other CI.
if: tag IS present

language: ruby

git:
Expand Down
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ EXTOPTIONS := $(foreach ext,$(EXTS),-extension $(ext))

QUIET ?=
VERYQUIET ?= @
PYTHON ?= python3
ASCIIDOCTOR ?= asciidoctor
RM = rm -f
RMRF = rm -rf
Expand Down Expand Up @@ -72,8 +73,8 @@ SPECREVISION = $(shell echo `git describe --tags --dirty`)
# This used to be a dependency in the spec html/pdf targets,
# but that's likely to lead to merge conflicts. Just regenerate
# when pushing a new spec for review to the sandbox.
SPECREMARK = from git branch: $(shell echo `git symbolic-ref --short HEAD`) \
commit: $(shell echo `git log -1 --format="%H"`)
SPECREMARK = from git branch: $(shell echo `git symbolic-ref --short HEAD 2> /dev/null || echo Git branch not available`) \
commit: $(shell echo `git log -1 --format="%H" 2> /dev/null || echo Git commit not available`)
endif
# The C++ for OpenCL document revision scheme is aligned with its release date.
# Revision naming scheme is as follows:
Expand Down Expand Up @@ -116,7 +117,7 @@ ADOCCOMMONOPTS = -a apispec="$(CURDIR)/api" \
-a cspec="$(CURDIR)/c" \
-a images="$(CURDIR)/images" \
$(ATTRIBOPTS) $(NOTEOPTS) $(VERBOSE) $(ADOCEXTS)
ADOCOPTS = -d book $(ADOCCOMMONOPTS)
ADOCOPTS = --failure-level ERROR -d book $(ADOCCOMMONOPTS)

# Asciidoctor options to build refpages
#
Expand Down Expand Up @@ -459,7 +460,7 @@ $(REFPATH)/apispec.txt: $(SPECFILES) $(GENREF) $(SCRIPTS)/reflib.py $(PYAPIMAP)
(cat $(MANDIR)/rewritehead ; \
echo ; echo "# Aliases hard-coded in refpage markup" ; \
sort < $(REFPATH)/rewritebody) > $(REFPATH)/.htaccess
echo $(CP) $(MANDIR)/static/*.txt $(REFPATH)
$(CP) $(MANDIR)/static/*.txt $(REFPATH)

# These targets are HTML5 ref pages
#
Expand Down Expand Up @@ -493,11 +494,12 @@ $(MANHTMLDIR)/%.html: $(REFPATH)/%.txt $(MANCOPYRIGHT) $(GENDEPENDS) $(KATEXINST
$(VERYQUIET)$(ASCIIDOCTOR) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) \
$(ADOCREFOPTS) -o $@ $<

# This is not formatted as a refpage, so needs a different build rule
$(MANHTMLDIR)/intro.html: $(REFPATH)/intro.txt $(MANCOPYRIGHT)
$(VERYQUIET)echo "Building $@ from $< using default options"
$(VERYQUIET)$(MKDIR) $(MANHTMLDIR)
$(VERYQUIET)$(ASCIIDOCTOR) -b html5 $(ADOCOPTS) $(ADOCHTMLOPTS) \
$(ADOCREFOPTS) -o $@ $<
-o $@ $<

# Targets generated from the XML and registry processing scripts
# apimap.py - Python encoding of the registry
Expand All @@ -510,9 +512,11 @@ $(MANHTMLDIR)/intro.html: $(REFPATH)/intro.txt $(MANCOPYRIGHT)

REGISTRY = $(ROOTDIR)/xml
APIXML = $(REGISTRY)/cl.xml
CFEATURES = c/features.txt
GENSCRIPT = $(SCRIPTS)/gencl.py
DICTSCRIPT = $(SCRIPTS)/gen_dictionaries.py
VERSIONSCRIPT = $(SCRIPTS)/gen_version_notes.py
CFEATSCRIPT = $(SCRIPTS)/gen_c_feature_dictionary.py
GENSCRIPTOPTS = $(VERSIONOPTIONS) $(EXTOPTIONS) $(GENSCRIPTEXTRA) -registry $(APIXML)
GENSCRIPTEXTRA =

Expand All @@ -538,12 +542,14 @@ extinc: $(METADEPEND)
$(METADEPEND): $(APIXML) $(GENSCRIPT)
$(QUIET)$(MKDIR) $(METAPATH)
$(QUIET)$(PYTHON) $(GENSCRIPT) $(GENSCRIPTOPTS) -o $(METAPATH) extinc
$(QUIET)$(PYTHON) $(CFEATSCRIPT) -features $(CFEATURES) -o $(METAPATH)/c-feature-dictionary.asciidoc

# This generates a single file containing asciidoc attributes for each
# extension in the spec being built.
attribs: $(ATTRIBFILE)

$(ATTRIBFILE):
$(QUIET)$(MKDIR) $(dir $@)
for attrib in $(EXTS) ; do \
echo ":$${attrib}:" ; \
done > $@
Expand Down
3 changes: 3 additions & 0 deletions OpenCL_API.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ include::config/version-local-links.asciidoc[]
// Formatting and links for API functions and enums.
include::api/dictionary.asciidoc[]

// Feature Dictionary.
include::c/feature-dictionary.asciidoc[]

// External Footnotes
include::api/footnotes.asciidoc[]

Expand Down
Loading

0 comments on commit 9a0c15e

Please sign in to comment.