Skip to content

Commit

Permalink
Remove SPHINCS+ aarch64 code (#1972)
Browse files Browse the repository at this point in the history
* Add a --delete option to copy_from_upstream to remove unwanted implementation subdirectories.
* Enable the --delete option in CI to detect files included by mistake
* Switch to git status --porcelain in CI for script stability
* Remove unused SPHINCS+ aarch64 implementation using the --delete option

Signed-off-by: Spencer Wilson <[email protected]>
  • Loading branch information
SWilson4 authored Nov 4, 2024
1 parent 35cc700 commit f7f6af0
Show file tree
Hide file tree
Showing 200 changed files with 24 additions and 14,773 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ jobs:
- name: Verify copy_from_upstream state after copy
working-directory: "scripts/copy_from_upstream"
run: |
python3 copy_from_upstream.py copy && \
! git status | grep -i modified
python3 copy_from_upstream.py -d copy && \
git status --porcelain && \
test -z "$(git status --porcelain)"
- name: Verify copy_from_upstream state after libjade
working-directory: "scripts/copy_from_upstream"
run: |
python3 copy_from_upstream.py libjade && \
! git status | grep -i modified
python3 copy_from_upstream.py -d libjade && \
git status --porcelain && \
test -z "$(git status --porcelain)"
buildcheck:
name: Check that code passes a basic build
Expand Down
19 changes: 18 additions & 1 deletion scripts/copy_from_upstream/copy_from_upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

parser = argparse.ArgumentParser()
parser.add_argument("-v", "--verbosity", type=int)
parser.add_argument("-k", "--keep_data", action='store_true')
parser.add_argument("-k", "--keep_data", action='store_true', help='Keep upstream code in the "repos" folder')
parser.add_argument("-d", "--delete", action='store_true', help='Delete untracked files from implementation directories')
parser.add_argument("operation", choices=["copy", "verify", "libjade"])
args = parser.parse_args()

Expand All @@ -34,6 +35,8 @@

keepdata = True if args.keep_data else False

delete = True if args.delete else False

if 'LIBOQS_DIR' not in os.environ:
print("Must set environment variable LIBOQS_DIR")
exit(1)
Expand Down Expand Up @@ -543,6 +546,20 @@ def process_families(instructions, basedir, with_kat, with_generator, with_libja
try:
os.makedirs(os.path.join(basedir, 'src', family['type'], family['name']))
except:
if delete:
# clear out all subdirectories
with os.scandir(os.path.join(basedir, 'src', family['type'], family['name'])) as ls:
for entry in ls:
if entry.is_dir(follow_symlinks=False):
if with_libjade:
if not entry.name.startswith('libjade'):
continue
elif entry.name.startswith('libjade'):
continue
to_rm = os.path.join(basedir, 'src', family['type'], family['name'], entry.name)
if DEBUG > 3:
print("removing %s" % to_rm)
shutil.rmtree(to_rm)
pass
if 'common_deps' in family:
for common_dep in family['common_deps']:
Expand Down
116 changes: 0 additions & 116 deletions src/sig/sphincs/pqclean_sphincs-shake-128f-simple_aarch64/LICENSE

This file was deleted.

This file was deleted.

This file was deleted.

77 changes: 0 additions & 77 deletions src/sig/sphincs/pqclean_sphincs-shake-128f-simple_aarch64/api.h

This file was deleted.

Loading

0 comments on commit f7f6af0

Please sign in to comment.