Skip to content

Commit deb876d

Browse files
authored
Use short-form license pragmas (#1750)
* Update check-license-headers.sh Signed-off-by: Yosh <github@yosh.is> * Update license pragma in all Rust files Signed-off-by: Yosh <github@yosh.is> --------- Signed-off-by: Yosh <github@yosh.is>
1 parent d00d503 commit deb876d

245 files changed

Lines changed: 517 additions & 3701 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev/check-license-headers.sh

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,15 @@
55
REPO_ROOT="$(git rev-parse --show-toplevel)"
66
cd "$REPO_ROOT" || exit 1
77

8-
# Define the license header pattern to look for
9-
LICENSE_PATTERN="Copyright .* The Hyperlight Authors..*Licensed under the Apache License, Version 2.0"
8+
# Define the license patterns to look for
9+
SPDX_PATTERN="^// SPDX-License-Identifier: Apache-2\.0$"
10+
COPYRIGHT_PATTERN="^// Copyright .* The Hyperlight Authors\.$"
1011

1112
# Define the full license header for files that need it
12-
LICENSE_HEADER='/*
13-
Copyright 2025 The Hyperlight Authors.
14-
15-
Licensed under the Apache License, Version 2.0 (the "License");
16-
you may not use this file except in compliance with the License.
17-
You may obtain a copy of the License at
18-
19-
http://www.apache.org/licenses/LICENSE-2.0
20-
21-
Unless required by applicable law or agreed to in writing, software
22-
distributed under the License is distributed on an "AS IS" BASIS,
23-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24-
See the License for the specific language governing permissions and
25-
limitations under the License.
26-
*/
27-
28-
'
13+
YEAR="$(date +"%Y")"
14+
LICENSE_HEADER="// SPDX-License-Identifier: Apache-2.0
15+
// Copyright $YEAR The Hyperlight Authors.
16+
"
2917

3018
# Initialize a variable to track missing headers
3119
MISSING_HEADERS=0
@@ -43,8 +31,8 @@ while IFS= read -r -d $'\0' file; do
4331
continue
4432
fi
4533

46-
# Check if the file has the license header (allowing for multi-line matching)
47-
if ! grep -q -z "$LICENSE_PATTERN" "$file"; then
34+
header="$(head -2 "$file")"
35+
if ! grep -q "$SPDX_PATTERN" <<< "$header" || ! grep -q "$COPYRIGHT_PATTERN" <<< "$header"; then
4836
echo "Missing or invalid license header in $file"
4937
MISSING_FILES="$MISSING_FILES\n $file"
5038
MISSING_HEADERS=$((MISSING_HEADERS + 1))

fuzz/fuzz_targets/guest_call.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2025 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2025 The Hyperlight Authors.
163

174
#![no_main]
185

fuzz/fuzz_targets/guest_estimate_trace_event.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2025 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2025 The Hyperlight Authors.
163
#![no_main]
174

185
#[cfg(not(feature = "trace"))]

fuzz/fuzz_targets/guest_trace.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2025 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2025 The Hyperlight Authors.
163

174
#![no_main]
185

fuzz/fuzz_targets/host_call.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2025 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2025 The Hyperlight Authors.
163

174
#![no_main]
185

fuzz/fuzz_targets/virtq_packed_ring.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2026 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2026 The Hyperlight Authors.
163

174
#![no_main]
185

src/hyperlight_common/benches/buffer_pool.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2026 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2026 The Hyperlight Authors.
163

174
use std::hint::black_box;
185

src/hyperlight_common/benches/common/mod.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2026 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2026 The Hyperlight Authors.
163

174
//! Shared harness for the `virtq_api` benchmarks: an in-memory [`MemOps`]
185
//! backend, a counting [`Notifier`], producer/consumer pair construction, pool

src/hyperlight_common/benches/virtq_api.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2026 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2026 The Hyperlight Authors.
163

174
use std::hint::black_box;
185

src/hyperlight_common/src/arch/aarch64/exn.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
/*
2-
Copyright 2026 The Hyperlight Authors.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2026 The Hyperlight Authors.
163

174
use crate::vmem::bits;
185

0 commit comments

Comments
 (0)