Common Problems (and Fixes) - commoncriteria/pp-template GitHub Wiki

Forgetting to checkout the transforms

# Go into transforms directory
cd transforms
# And update it
git submodule update --init --recursive

Pushing changes to the transforms submodule

There's a couple of different ways to make changes to the transforms project. One way is to clone it in isolation, and make changes as you would for a normal github project. To test it, you'd have another PP project somewhere and just point the TRANS variable to the transforms project:

TRANS=/path/to/tranforms make

The other way is to tinker with it when it's treated as a submodule in another project (this is probably a better way). Before tinkering with it, make sure you checkout the master (or you could lose your transforms edits):

cd transforms &&\
git checkout master

Then edit and test ad nauseam. Once you're finished, in the transform directory commit and push as you'd normally do for any project:

git commit -a &&\
git push

At this point, you've only updated the transforms. The primary project, which is using your updated transforms is only using them locally. You still have to commit that you've pulled in the new transforms:

git add transforms &&\
git commit -m "Updated transforms" &&\
git push

Don't worry too much (but do worry some) about messing up other people's project: other developers have to actually pull the changes transforms into their project before using the updated transforms and they should test their project before pushing their project with the link to the new transforms.

Pointing to an unadvertised version of the transforms submodule

Taken from here: https://stackoverflow.com/questions/36301758/git-fatal-reference-is-not-a-tree-local-submodule-directory-deleted $variable refers to a value in your specific case.

# View recent history
git log -- transforms
# Pick recent version of project that worked
git show $commit-of-major-project -- transforms
# Pick a version of the transforms that worked
# Go into transforms
cd transforms
# Checkout that version
git checkout $commit-of-transforms
# Update to latest
git pull origin master

HTML files missing from gh-pages

This error has occurred when the output directory has its own .gitignore file which includes "*.html" files.

Project Validates Against the Wrong Schema

The project's makefile, specifically the line

include $(TRANS)/...

determines what kind of document is generated. Protection Profiles should include "$(TRANS)/Helper.make", PP-Modules "$(TRANS)/module/Module.make, and PP-Packages "$(TRANS)/package/Package.make".

error: src refspec master matches more than one

This error is probably not your fault. We were testing a couple of different build actions with the Github Pages actions and one of them adds a "master" tag even when there's already a master tag. To fix, run:

git tag -d master

Submodule conflicts - Resolve in Favor of Remote transforms

   cd transforms
   git fetch
   git checkout origin/branch-name 

Replace branch-name with the branch you're merging into in your main project.

   cd .. 
   git add transforms 
   git commit -m "Update transforms to remote version"
   git push

Alternative Method (Using git submodule update):

   git submodule update --remote --merge transforms

Missing gh-pages branch

Quickbuild fails if there is no gh-pages branch. The trick is to create an empty branch. This is how.

If there are error messages, you can ignore them. It should work anyway.

    git switch --orphan gh-pages
    git commit --allow-empty -m "Initial commit on gh-pages branch"
    git push -u origin gh-pages