Skip to content

Commit cdeff27

Browse files
authored
Merge pull request #902 from pq-code-package/slothy-ortools_9_12
SLOTHY: Update ortools to 9.12 + LLVM nix clean-up
2 parents ad7a6f9 + b35aa57 commit cdeff27

File tree

6 files changed

+71
-25
lines changed

6 files changed

+71
-25
lines changed

.github/actions/functest/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ inputs:
4646
examples:
4747
description: Determine whether to run examples or not
4848
default: "true"
49+
check_namespace:
50+
description: Determine whether to check namespacing or not
51+
default: "true"
4952
runs:
5053
using: composite
5154
steps:
@@ -95,6 +98,7 @@ runs:
9598
make clean
9699
./scripts/tests all --exec-wrapper="${{ inputs.exec_wrapper }}" --cross-prefix="${{ inputs.cross_prefix }}" --cflags="${{ inputs.cflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.NISTKAT }} --${{ env.ACVP }} --${{ env.EXAMPLES }} -v
97100
- name: Check namespacing ${{ env.MODE }} ${{ inputs.opt }} tests (${{ env.FUNC }}, ${{ env.KAT }}, ${{ env.NISTKAT }}, ${{ env.EXAMPLES }})
101+
if: ${{ inputs.check_namespace == 'true' }}
98102
shell: ${{ env.SHELL }}
99103
run: |
100104
./scripts/check-namespace

.github/actions/multi-functest/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ inputs:
4343
examples:
4444
description: Determine whether to run examples or not
4545
default: "true"
46+
check_namespace:
47+
description: Determine whether to check namespacing or not
48+
default: "true"
4649
runs:
4750
using: composite
4851
steps:
@@ -62,6 +65,7 @@ runs:
6265
nistkat: ${{ inputs.nistkat }}
6366
acvp: ${{ inputs.acvp }}
6467
examples: ${{ inputs.examples }}
68+
check_namespace: ${{ inputs.check_namespace }}
6569
- name: Cross x86_64 Tests
6670
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross-x86_64') && (success() || failure()) }}
6771
uses: ./.github/actions/functest
@@ -80,6 +84,7 @@ runs:
8084
nistkat: ${{ inputs.nistkat }}
8185
acvp: ${{ inputs.acvp }}
8286
examples: ${{ inputs.examples }}
87+
check_namespace: ${{ inputs.check_namespace }}
8388
- name: Cross aarch64 Tests
8489
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross-aarch64') && (success() || failure()) }}
8590
uses: ./.github/actions/functest
@@ -98,6 +103,7 @@ runs:
98103
nistkat: ${{ inputs.nistkat }}
99104
acvp: ${{ inputs.acvp }}
100105
examples: ${{ inputs.examples }}
106+
check_namespace: ${{ inputs.check_namespace }}
101107
- name: Cross aarch64_be Tests
102108
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross-aarch64_be') && (success() || failure()) }}
103109
uses: ./.github/actions/functest
@@ -116,6 +122,7 @@ runs:
116122
nistkat: ${{ inputs.nistkat }}
117123
acvp: ${{ inputs.acvp }}
118124
examples: ${{ inputs.examples }}
125+
check_namespace: ${{ inputs.check_namespace }}
119126
- name: Cross riscv64 Tests
120127
if: ${{ (inputs.compile_mode == 'all' || inputs.compile_mode == 'cross-riscv64') && (success() || failure()) }}
121128
uses: ./.github/actions/functest
@@ -134,3 +141,4 @@ runs:
134141
nistkat: ${{ inputs.nistkat }}
135142
acvp: ${{ inputs.acvp }}
136143
examples: ${{ inputs.examples }}
144+
check_namespace: ${{ inputs.check_namespace }}

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110
gh_token: ${{ secrets.GITHUB_TOKEN }}
111111
compile_mode: native
112112
cflags: "-DMLKEM_DEBUG -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
113+
check_namespace: 'false'
113114
backend_tests:
114115
name: AArch64 FIPS202 backends (${{ matrix.backend }})
115116
strategy:
@@ -129,6 +130,7 @@ jobs:
129130
opt: 'opt'
130131
examples: 'false'
131132
cflags: "-DMLKEM_DEBUG -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -DMLK_FORCE_AARCH64 -DMLK_FIPS202_BACKEND_FILE=\\\\\\\"fips202/native/aarch64/${{ matrix.backend }}.h\\\\\\\""
133+
check_namespace: 'false'
132134
compiler_tests:
133135
name: Compiler tests (${{ matrix.compiler.name }}, ${{ matrix.target.name }})
134136
strategy:

mlkem/debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void mlk_debug_check_bounds(const char *file, int line, const int16_t *ptr,
5959
* value_ub: Exclusive upper value bound */
6060
#define mlk_assert_bound(ptr, len, value_lb, value_ub) \
6161
mlk_debug_check_bounds(__FILE__, __LINE__, (const int16_t *)(ptr), (len), \
62-
(value_lb)-1, (value_ub))
62+
(value_lb) - 1, (value_ub))
6363

6464
/* Check absolute bounds in array of int16_t's
6565
* ptr: Base of array, expression of type int16_t*

nix/slothy/default.nix

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
{ stdenvNoCC
44
, fetchFromGitHub
5-
, python311
5+
, python312
66
, pkgs
7-
, callPackage
8-
, python311Packages
7+
, python312Packages
98
, fetchPypi
109
, stdenv
1110
, cmake
@@ -16,54 +15,87 @@
1615

1716

1817
let
19-
ortools97 = python311Packages.buildPythonPackage rec {
18+
# TODO: switch to protobuf from nixpkgs
19+
# ortools 9.12 requires protobuf >= 5.29.3 - currently nixpkgs 24.11 has
20+
# protobuf 5.28.3
21+
protobuf_6_30_1 = python312Packages.buildPythonPackage rec {
22+
pname = "protobuf";
23+
version = "6.30.1";
24+
25+
propagatedBuildInputs = [
26+
python312Packages.setuptools
27+
];
28+
29+
build-system = with python312Packages; [
30+
setuptools
31+
];
32+
33+
dontConfigure = true;
34+
nativeBuildInputs =
35+
[
36+
cmake
37+
pkg-config
38+
];
39+
40+
src = fetchPypi {
41+
inherit pname version;
42+
hash = "sha256-U1+05E0CNok9XPEmOg9wbxFgtomnq5YunaipzkBQt4A=";
43+
};
44+
};
45+
46+
47+
ortools912 = python312Packages.buildPythonPackage rec {
2048
pname = "ortools";
21-
version = "9.7.2996";
49+
version = "9.12.4544";
2250

2351
format = "wheel";
2452

2553
src = fetchPypi {
2654
inherit pname version;
2755
format = "wheel";
28-
dist = "cp311";
29-
python = "cp311";
30-
abi = "cp311";
56+
dist = "cp312";
57+
python = "cp312";
58+
abi = "cp312";
3159
platform =
3260
if stdenv.isDarwin then
3361
if stdenv.isAarch64 then "macosx_11_0_arm64"
3462
else "macosx_10_15_x86_64"
3563
else if stdenv.isLinux then
36-
if stdenv.isAarch64 then "manylinux_2_17_aarch64.manylinux2014_aarch64"
37-
else "manylinux_2_17_x86_64.manylinux2014_x86_64"
64+
if stdenv.isAarch64 then "manylinux_2_27_aarch64.manylinux_2_28_aarch64"
65+
else "manylinux_2_27_x86_64.manylinux_2_28_x86_64"
3866
else throw "Unsupported platform";
3967

4068
hash =
4169
if stdenv.isDarwin then
42-
if stdenv.isAarch64 then "sha256-Oc8xz9iRuOiDyZBc85qlS57u0efP/f4cDpi2k9ZlCQI="
43-
else "sha256-0ax/I7604BumV+VRV7Y5fNDs0XrxkK+ocr9yU1oFMDQ="
70+
if stdenv.isAarch64 then "sha256-Z/4bhlMndFZ4okBm2CbbJaEBmqIH6pAXygGvLPIUVlI="
71+
else "sha256-FnaLGfyzBT9EvYTEYMuXjyop1046XZugYSNYn+sQrxI="
4472
else if stdenv.isLinux then
45-
if stdenv.isAarch64 then "sha256-B8QfDoYT2OxrpoUzSQTNduRbxG2j1S8XPpMBZo/yI90="
46-
else "sha256-pUerlb2cykE9cYraz68MnuBKDM4V1Du0Ta3yve16K/o="
73+
if stdenv.isAarch64 then "sha256-VVD+nuVSt7jtAcrZHVimjsDkjNQN0necELGZFCmncFg="
74+
else "sha256-kiEh1vSPjuseuIqMZF/wC2H2CFYxkxTOK48iD6uJYIM="
4775
else throw "Unsupported platform";
4876
};
4977

50-
propagatedBuildInputs = with python311Packages; [
78+
propagatedBuildInputs = with python312Packages; [
5179
numpy
5280
pandas
53-
protobuf
81+
protobuf_6_30_1
5482
];
5583

5684
};
5785

58-
unicorn_2_1_3 = python311Packages.buildPythonPackage rec {
86+
# TODO: switch to unicorn from nixpkgs
87+
# nixpkgs 24.11 currently has 2.1.1 - we are experiencing some issues with
88+
# that version on MacOS. 2.1.2/2.1.3 (and also some older versions) don't
89+
# have that problem
90+
unicorn_2_1_3 = python312Packages.buildPythonPackage rec {
5991
pname = "unicorn";
6092
version = "2.1.3";
6193

6294
propagatedBuildInputs = [
63-
python311Packages.setuptools
95+
python312Packages.setuptools
6496
];
6597

66-
build-system = with python311Packages; [
98+
build-system = with python312Packages; [
6799
setuptools
68100
];
69101

@@ -80,8 +112,8 @@ let
80112
};
81113
};
82114

83-
pythonEnv = python311.withPackages (ps: with ps; [
84-
ortools97
115+
pythonEnv = python312.withPackages (ps: with ps; [
116+
ortools912
85117
sympy
86118
unicorn_2_1_3
87119
]);

nix/util.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rec {
1717

1818
native-gcc =
1919
if pkgs.stdenv.isDarwin
20-
then pkgs.clang_15
20+
then pkgs.clang_16
2121
else wrap-gcc pkgs;
2222

2323
# cross is for determining whether to install the cross toolchain dependencies or not
@@ -74,10 +74,10 @@ rec {
7474
name = "pqcp-linters";
7575
paths = builtins.attrValues {
7676
clang-tools = pkgs.clang-tools.overrideAttrs {
77-
unwrapped = pkgs.llvmPackages_17.clang-unwrapped;
77+
unwrapped = pkgs.llvmPackages_18.clang-unwrapped;
7878
};
7979

80-
inherit (pkgs.llvmPackages_17)
80+
inherit (pkgs.llvmPackages_18)
8181
bintools;
8282

8383
inherit (pkgs)

0 commit comments

Comments
 (0)