From 37f5d0a4db3e1472539a67913ad82befcf903cbb Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Thu, 25 Apr 2024 10:29:53 -0400 Subject: [PATCH 1/4] Update README for example of use and description of how to verify customization success condition --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ec0ede4..be5ce54 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,20 @@ You can see the packs available in your workspace by running `codeql pack ls -- With both a CodeQL bundle and a CodeQL workspace you can create a bundle with the command: ```bash -codeql-bundle --bundle --output codeql-custom-bundle.tar.gz --workspace --log INFO +codeql-bundle --bundle --output codeql-custom-bundle.tar.gz --workspace --log INFO ``` If the source bundle is the platform agnostic bundle then you can create platform specific bundles to reduce the size of the used bundle(s). The following example creates platform specific bundles for all the currently supported platforms. ```bash -codeql-bundle --bundle --output --workspace --log INFO -p linux64 -p osx64 -p win64 +codeql-bundle --bundle --output --workspace --log INFO -p linux64 -p osx64 -p win64 +``` + +An example of creation of a custom bundle for OSX containing a customization pack with the name `foo/cpp-customizations` would look as follows: + +```bash +codeql-bundle --bundle codeql-bundle-osx64.tar.gz --output codeql-custom-bundle --workspace codeql-workspace.yml --log INFO foo/cpp-customizations -p osx64 ``` ## CodeQL customization packs @@ -63,6 +69,18 @@ This example targets the C/C++ language, but you can use this for any supported 3. Add a dependency on `codeql/cpp-all` with `codeql pack add --dir=cpp-customizations codeql/cpp-all` 4. Implement the customizations module with `mkdir -p cpp-customizations/foo/cpp_customizations && echo "import cpp" > cpp-customizations/foo/cpp_customizations/Customizations.qll` +To verify that the customization pack was correctly imported one can check that it is listed as a dependency in the standard library pack it was added to. It will look as follows (for example for a pack named `foo/cpp-customizations` added to `codeql/cpp-all`): + +#### **`codeql/qlpacks/codeql/cpp-all//qlpack.yml`** +``` +... +dependencies: + ... + ... + foo/cpp-customizationss: 0.0.1 +... +``` + ## Limitations - The customization pack must directly rely on a CodeQL language pack. From 3455af7c6e2dc4c6f33961b1ab1823e6fa0efd96 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Thu, 25 Apr 2024 10:33:36 -0400 Subject: [PATCH 2/4] Fix small formatting in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be5ce54..013f7a4 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ To verify that the customization pack was correctly imported one can check that dependencies: ... ... - foo/cpp-customizationss: 0.0.1 + foo/cpp-customizations: 0.0.1 ... ``` From 698370a10929d488bba50c86b1f2d21e52e68427 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Thu, 25 Apr 2024 12:02:08 -0400 Subject: [PATCH 3/4] Update README.md Co-authored-by: Remco Vermeulen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 013f7a4..0efef4e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ You can see the packs available in your workspace by running `codeql pack ls -- With both a CodeQL bundle and a CodeQL workspace you can create a bundle with the command: ```bash -codeql-bundle --bundle --output codeql-custom-bundle.tar.gz --workspace --log INFO +codeql-bundle --bundle --output codeql-custom-bundle.tar.gz --workspace --log INFO ``` If the source bundle is the platform agnostic bundle then you can create platform specific bundles to reduce the size of the used bundle(s). From 1a0fc9980677a7bfcab9aeb9e83cff9d0193c5f8 Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Thu, 25 Apr 2024 12:02:30 -0400 Subject: [PATCH 4/4] Update README.md Co-authored-by: Remco Vermeulen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0efef4e..70a1a14 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ codeql-bundle --bundle --output