Skip to content

Commit 20c8450

Browse files
edvilmeCopilot
andauthored
Fix DevDiv NOTICE registration and ARMv7 linking
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 597235d1-bab7-440a-a583-e790ea7f1962
1 parent f4432bd commit 20c8450

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

‎azure-pipelines/devdiv-pre-release.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ extends:
182182
sudo apt-get update
183183
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
184184
echo "##vso[task.setvariable variable=CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER]arm-linux-gnueabihf-gcc"
185+
# Match the legacy static non-PIE binary; Ubuntu armhf lacks rcrt1.o.
186+
echo "##vso[task.setvariable variable=CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS]-Crelocation-model=static"
185187
displayName: Install armv7 cross toolchain
186188
187189
- script: cargo build --release --frozen --target ${{ platform.target }}
@@ -215,6 +217,11 @@ extends:
215217
}
216218
displayName: Verify Authenticode signature
217219
220+
- task: ComponentGovernanceComponentDetection@0
221+
displayName: Register components for NOTICE
222+
inputs:
223+
scanType: Register
224+
218225
- task: notice@0
219226
displayName: NOTICE file generation
220227
inputs:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
import unittest
5+
from pathlib import Path
6+
7+
8+
ROOT = Path(__file__).resolve().parents[2]
9+
10+
11+
class DevDivPipelineTests(unittest.TestCase):
12+
def test_notice_follows_a_registered_component_scan_after_build(self):
13+
pipeline = (ROOT / 'azure-pipelines' / 'devdiv-pre-release.yml').read_text(encoding='utf-8')
14+
build = pipeline.index('- script: cargo build --release')
15+
scan = pipeline.index('- task: ComponentGovernanceComponentDetection@0')
16+
notice = pipeline.index('- task: notice@0')
17+
18+
self.assertLess(build, scan)
19+
self.assertLess(scan, notice)
20+
scan_step = pipeline[scan:notice]
21+
self.assertIn('scanType: Register', scan_step)
22+
self.assertNotIn('continueOnError: true', scan_step)
23+
self.assertNotIn('condition:', scan_step)
24+
25+
26+
if __name__ == '__main__':
27+
unittest.main()

0 commit comments

Comments
 (0)