Skip to content

Commit 2874fd2

Browse files
authored
Merge pull request #9070 from microsoft/main
Merge for 1.9.7
2 parents d4df455 + 56db55a commit 2874fd2

File tree

154 files changed

+2632
-1016
lines changed

Some content is hidden

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

154 files changed

+2632
-1016
lines changed

.github/actions/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build/lldb-mi/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This folder contains the entitlements needed for the debugger to run on macOS.
2+
3+
We use the entitlements that the .net runtime uses. See https://github.com/dotnet/runtime/blob/57678512d214af368ff055f358c5106f1aa19ac4/eng/pipelines/common/entitlements.plist
4+
5+
Related Links:
6+
https://docs.microsoft.com/en-us/dotnet/core/install/macos-notarization-issues#default-entitlements
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-jit</key>
6+
<true/>
7+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
8+
<true/>
9+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
10+
<true/>
11+
<key>com.apple.security.cs.disable-library-validation</key>
12+
<true/>
13+
<key>com.apple.security.cs.debugger</key>
14+
<true/>
15+
<key>com.apple.security.get-task-allow</key>
16+
<true/>
17+
<key>com.apple.security.task_for_pid-allow</key>
18+
<true/>
19+
</dict>
20+
</plist>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
parameters:
3+
archs: ["x86_64", "arm64"]
4+
5+
jobs:
6+
- job:
7+
pool:
8+
name: VSEngSS-MicroBuild2022-1ES
9+
steps:
10+
- checkout: none
11+
12+
- ${{ each arch in parameters.archs }}:
13+
- task: DownloadPipelineArtifact@1
14+
displayName: 'Downloading unsigned_lldb-mi_${{ arch }}'
15+
inputs:
16+
targetPath: '$(Pipeline.Workspace)/Artifacts'
17+
artifactName: 'unsigned_lldb-mi_${{ arch }}'
18+
19+
- task: MicroBuildSignMacFiles@1
20+
displayName: 'ESRP Sign'
21+
inputs:
22+
SigningTarget: '$(Pipeline.Workspace)\Artifacts\lldb-mi_${{ arch }}.zip'
23+
SigningCert: 8023
24+
25+
- task: PublishPipelineArtifact@1
26+
displayName: 'Publish signed LLDB-MI'
27+
inputs:
28+
targetPath: '$(Pipeline.Workspace)\Artifacts\lldb-mi_${{ arch }}.zip'
29+
artifactName: 'lldb-mi_${{ arch }}_zip'
30+
...

Build/lldb-mi/lldb-mi.template.yml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
parameters:
2+
# Note: Make sure llvm_repo is the same as the one in Extension/cgmanifest.json
3+
# 'RepositoryUrl' for llvm-project.
4+
llvm_repo: https://github.com/llvm/llvm-project.git
5+
6+
# Note: Make sure llvm_commit is the same as the one in Extension/cgmanifest.json
7+
# 'CommitHash' for llvm-project.
8+
llvm_commit: 0d44201451f03ba907cdb268ddddfc3fa38a0ebd
9+
10+
llvm_build_type: Release
11+
12+
llvm_arch: x86_64
13+
14+
llvm_additional_parameters: "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_INCLUDE_TESTS=OFF -DLLDB_BUILD_FRAMEWORK=1"
15+
16+
# Note: Make sure lldb_mi_repo is the same as the one in Extension/cgmanifest.json
17+
# 'CommitHash' for lldb-mi.
18+
lldb_mi_repo: https://github.com/lldb-tools/lldb-mi.git
19+
20+
# Note: Make sure lldb_mi_commit is the same as the one in Extension/cgmanifest.json
21+
# 'CommitHash' for lldb-mi.
22+
lldb_mi_commit: 2388bd74133bc21eac59b2e2bf97f2a30770a315
23+
24+
lldb_mi_additional_parameters: "-DUSE_LLDB_FRAMEWORK=1"
25+
26+
jobs:
27+
- job: LLDB_MI_${{ parameters.llvm_arch }}
28+
timeoutInMinutes: 360
29+
pool:
30+
${{if eq(parameters['llvm_arch'], 'arm64')}}:
31+
name: cpptoolsMacM1pool
32+
${{ else }}:
33+
vmImage: macOS-latest
34+
steps:
35+
- task: CmdLine@2
36+
displayName: 'Install Dependencies'
37+
inputs:
38+
script: brew install cmake ninja swig
39+
continueOnError: true
40+
41+
- task: CmdLine@2
42+
displayName: 'Make sure buildspace does not exist'
43+
inputs:
44+
script: rm -rf $(Build.StagingDirectory)/buildspace
45+
condition: always()
46+
47+
- task: CmdLine@2
48+
displayName: 'Build LLVM Project'
49+
inputs:
50+
script: |
51+
log_and_exec_cmd() {
52+
echo "##[command] $1"
53+
$1
54+
}
55+
56+
log_and_exec_cmd "sudo rm -rf /Library/Developer/CommandLineTools"
57+
log_and_exec_cmd "sudo xcode-select --switch /Applications/XCode.app"
58+
59+
log_and_exec_cmd "cd $(Build.StagingDirectory)"
60+
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace"
61+
62+
log_and_exec_cmd "git clone ${{ parameters.llvm_repo }} llvm-project"
63+
log_and_exec_cmd "cd llvm-project"
64+
log_and_exec_cmd "git checkout ${{ parameters.llvm_commit }}"
65+
66+
log_and_exec_cmd "./lldb/scripts/macos-setup-codesign.sh"
67+
68+
log_and_exec_cmd "cd .."
69+
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace/llvm-inst"
70+
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace/llvm-build"
71+
log_and_exec_cmd "cd $(Build.StagingDirectory)/buildspace/llvm-build"
72+
73+
log_and_exec_cmd "cmake -DLLVM_ENABLE_PROJECTS=clang;lldb -DCMAKE_BUILD_TYPE=${{ parameters.llvm_build_type }} -DCMAKE_INSTALL_PREFIX=$(Build.StagingDirectory)/buildspace/llvm-inst/ -DCMAKE_OSX_ARCHITECTURES=${{ parameters.llvm_arch }} ${{ parameters.llvm_additional_parameters }} -GNinja $(Build.StagingDirectory)/llvm-project/llvm"
74+
if [[ $? -ne 0 ]]
75+
then
76+
echo "##[error] cmake llvm failed"
77+
cat $(Build.SourcesDirectory)/buildspace/llvm-build/CMakeFiles/CMakeError.log
78+
exit 1
79+
fi
80+
81+
log_and_exec_cmd ninja
82+
if [[ $? -ne 0 ]]
83+
then
84+
echo "##[error] ninja failed"
85+
exit 1
86+
fi
87+
88+
### Workaround for https://github.com/llvm/llvm-project/issues/108
89+
log_and_exec_cmd "ninja install"
90+
91+
# Remove conflicting LLDB.framework file.
92+
log_and_exec_cmd "rm -rf $(Build.StagingDirectory)/buildspace/llvm-inst/Library/Frameworks/LLDB.framework"
93+
94+
# Build lldb/sources/API first
95+
log_and_exec_cmd "cmake -P $(Build.StagingDirectory)/buildspace/llvm-build/tools/lldb/source/API/cmake_install.cmake"
96+
### End of Workaround
97+
98+
log_and_exec_cmd "ninja install"
99+
if [[ $? -ne 0 ]]
100+
then
101+
echo "##[error] ninja install failed"
102+
exit 1
103+
fi
104+
105+
echo "##[section] Build LLDB-MI"
106+
# Download lldb-mi and build it against our custom installation.
107+
log_and_exec_cmd "cd $(Build.StagingDirectory)/buildspace"
108+
log_and_exec_cmd "git clone ${{ parameters.lldb_mi_repo }} lldb-mi"
109+
log_and_exec_cmd "cd lldb-mi"
110+
log_and_exec_cmd "git checkout ${{ parameters.lldb_mi_commit }}"
111+
112+
# Create a separate build directory for building lldb-mi.
113+
log_and_exec_cmd "mkdir build"
114+
log_and_exec_cmd "cd build"
115+
log_and_exec_cmd "cmake -DCMAKE_PREFIX_PATH=$(Build.StagingDirectory)/buildspace/llvm-inst/ -DCMAKE_OSX_ARCHITECTURES=${{ parameters.llvm_arch }} ${{ parameters.lldb_mi_additional_parameters }} -GNinja .."
116+
log_and_exec_cmd "ninja"
117+
if [[ $? -ne 0 ]]
118+
then
119+
echo "##[error] ninja failed"
120+
exit 1
121+
fi
122+
123+
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/publish"
124+
log_and_exec_cmd "cd $(Build.StagingDirectory)/publish"
125+
126+
log_and_exec_cmd "mkdir -p ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/bin"
127+
128+
log_and_exec_cmd "cp $(Build.StagingDirectory)/buildspace/lldb-mi/build/src/lldb-mi ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/bin/."
129+
130+
# Set rpath for finding LLDB.Framework
131+
log_and_exec_cmd "install_name_tool -add_rpath @rpath/LLDB.framework/Versions/A/LLDB ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/bin/lldb-mi"
132+
133+
# Set rpath for App Store XCode LLDB.Framework
134+
log_and_exec_cmd "install_name_tool -add_rpath /Applications/Xcode.app/Contents/SharedFrameworks/ ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/bin/lldb-mi"
135+
136+
# Set rpath for XCode CLI LLDB.Framework
137+
log_and_exec_cmd "install_name_tool -add_rpath /Library/Developer/CommandLineTools/Library/PrivateFrameworks/ ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/bin/lldb-mi"
138+
139+
# Set rpath next to the lldb-mi executable LLDB.Framework
140+
log_and_exec_cmd "install_name_tool -add_rpath @executable_path/. ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/bin/lldb-mi"
141+
142+
# Add entitlements
143+
log_and_exec_cmd "codesign -s - -f --entitlements $(Build.SourcesDirectory)/Build/lldb-mi/debugger-entitlements.plist ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/bin/lldb-mi"
144+
145+
# Grab NOTICE.TXT
146+
cp $(Build.SourcesDirectory)/Build/lldb-mi/NOTICE.TXT ./debugAdapters/lldb-mi_${{ parameters.llvm_arch }}/.
147+
148+
zip -r $(Build.StagingDirectory)/lldb-mi_${{ parameters.llvm_arch }}.zip ./debugAdapters
149+
150+
- task: PublishPipelineArtifact@1
151+
displayName: 'Publish LLDB-MI'
152+
inputs:
153+
targetPath: '$(Build.StagingDirectory)/lldb-mi_${{ parameters.llvm_arch }}.zip'
154+
artifactName: 'unsigned_lldb-mi_${{ parameters.llvm_arch }}'
155+
156+
- task: CmdLine@2
157+
displayName: 'Clean up'
158+
inputs:
159+
script: rm -rf $(Build.StagingDirectory)/buildspace
160+
condition: always()

Build/lldb-mi/lldb-mi.yml

Lines changed: 23 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,23 @@
1-
variables:
2-
llvm_repo: https://github.com/llvm/llvm-project.git
3-
llvm_branch: release/10.x
4-
llvm_build_type: Release
5-
llvm_arch: x86_64
6-
llvm_additional_parameters: "-DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_INCLUDE_TESTS=OFF -DLLDB_BUILD_FRAMEWORK=1"
7-
# TODO: fix lldb_mi_repo and lldb_mi_branch (https://github.com/lldb-tools/lldb-mi/pull/37 and https://github.com/lldb-tools/lldb-mi/pull/39)
8-
lldb_mi_repo: https://github.com/WardenGnaw/lldb-mi # TODO: Change to lldb-tools
9-
lldb_mi_branch: release/cpptools # TODO: Change to main
10-
lldb_mi_additional_parameters: "-DUSE_LLDB_FRAMEWORK=1"
11-
12-
jobs:
13-
- job: LLDB_MI
14-
timeoutInMinutes: 360
15-
pool:
16-
vmImage: 'macOS-latest'
17-
steps:
18-
- task: CmdLine@2
19-
displayName: 'Install Dependencies'
20-
inputs:
21-
script: brew install cmake ninja swig
22-
continueOnError: true
23-
24-
- task: CmdLine@2
25-
displayName: 'Build LLVM Project'
26-
inputs:
27-
script: |
28-
log_and_exec_cmd() {
29-
echo "##[command] $1"
30-
$1
31-
}
32-
33-
log_and_exec_cmd "cd $(Build.StagingDirectory)"
34-
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace"
35-
36-
log_and_exec_cmd "git clone $(llvm_repo) llvm-project"
37-
log_and_exec_cmd "cd llvm-project"
38-
log_and_exec_cmd "git checkout $(llvm_branch)"
39-
40-
log_and_exec_cmd "./lldb/scripts/macos-setup-codesign.sh"
41-
42-
log_and_exec_cmd "cd .."
43-
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace/llvm-inst"
44-
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/buildspace/llvm-build"
45-
log_and_exec_cmd "cd $(Build.StagingDirectory)/buildspace/llvm-build"
46-
47-
log_and_exec_cmd "cmake -DLLVM_ENABLE_PROJECTS=clang;lldb -DCMAKE_BUILD_TYPE=$(llvm_build_type) -DCMAKE_INSTALL_PREFIX=$(Build.StagingDirectory)/buildspace/llvm-inst/ -DCMAKE_OSX_ARCHITECTURES=$(llvm_arch) $(llvm_additional_parameters) -GNinja $(Build.StagingDirectory)/llvm-project/llvm"
48-
if [[ $? -ne 0 ]]
49-
then
50-
echo "##[error] cmake llvm failed"
51-
cat $(Build.SourcesDirectory)/buildspace/llvm-build/CMakeFiles/CMakeError.log
52-
exit 1
53-
fi
54-
55-
log_and_exec_cmd ninja
56-
if [[ $? -ne 0 ]]
57-
then
58-
echo "##[error] ninja failed"
59-
exit 1
60-
fi
61-
62-
### Workaround for https://github.com/llvm/llvm-project/issues/108
63-
log_and_exec_cmd "ninja install"
64-
65-
# Remove conflicting LLDB.framework file.
66-
log_and_exec_cmd "rm -rf $(Build.StagingDirectory)/buildspace/llvm-inst/Library/Frameworks/LLDB.framework"
67-
68-
# Build lldb/sources/API first
69-
log_and_exec_cmd "cmake -P $(Build.StagingDirectory)/buildspace/llvm-build/tools/lldb/source/API/cmake_install.cmake"
70-
### End of Workaround
71-
72-
log_and_exec_cmd "ninja install"
73-
if [[ $? -ne 0 ]]
74-
then
75-
echo "##[error] ninja install failed"
76-
exit 1
77-
fi
78-
79-
echo "##[section] Build LLDB-MI"
80-
# Download lldb-mi and build it against our custom installation.
81-
log_and_exec_cmd "cd $(Build.StagingDirectory)/buildspace"
82-
log_and_exec_cmd "git clone $(lldb_mi_repo) lldb-mi"
83-
log_and_exec_cmd "cd lldb-mi"
84-
log_and_exec_cmd "git checkout $(lldb_mi_branch)"
85-
86-
# Create a separate build directory for building lldb-mi.
87-
log_and_exec_cmd "mkdir build"
88-
log_and_exec_cmd "cd build"
89-
log_and_exec_cmd "cmake -DCMAKE_PREFIX_PATH=$(Build.StagingDirectory)/buildspace/llvm-inst/ $(lldb_mi_additional_parameters) -GNinja .."
90-
log_and_exec_cmd "ninja"
91-
if [[ $? -ne 0 ]]
92-
then
93-
echo "##[error] ninja failed"
94-
exit 1
95-
fi
96-
97-
log_and_exec_cmd "mkdir $(Build.StagingDirectory)/publish"
98-
log_and_exec_cmd "cd $(Build.StagingDirectory)/publish"
99-
100-
log_and_exec_cmd "mkdir -p ./debugAdapters/lldb-mi/bin"
101-
102-
log_and_exec_cmd "cp $(Build.StagingDirectory)/buildspace/lldb-mi/build/src/lldb-mi ./debugAdapters/lldb-mi/bin/."
103-
104-
# Set rpath for finding LLDB.Framework
105-
log_and_exec_cmd "install_name_tool -add_rpath @rpath/LLDB.framework/Versions/A/LLDB ./debugAdapters/lldb-mi/bin/lldb-mi"
106-
107-
# Set rpath for App Store XCode LLDB.Framework
108-
log_and_exec_cmd "install_name_tool -add_rpath /Applications/Xcode.app/Contents/SharedFrameworks/ ./debugAdapters/lldb-mi/bin/lldb-mi"
109-
110-
# Set rpath for XCode CLI LLDB.Framework
111-
log_and_exec_cmd "install_name_tool -add_rpath /Library/Developer/CommandLineTools/Library/PrivateFrameworks/ ./debugAdapters/lldb-mi/bin/lldb-mi"
112-
113-
# Set rpath next to the lldb-mi executable LLDB.Framework
114-
log_and_exec_cmd "install_name_tool -add_rpath @executable_path/. ./debugAdapters/lldb-mi/bin/lldb-mi"
115-
116-
# Grab NOTICE.TXT
117-
cp $(Build.SourcesDirectory)/Build/lldb-mi/NOTICE.TXT ./debugAdapters/lldb-mi/.
118-
119-
# Build can be found at https://dev.azure.com/ms/vscode-cpptools/_build?definitionId=313
120-
# Click on the build and select 'Artifacts'
121-
- task: PublishPipelineArtifact@1
122-
displayName: 'Publish LLDB-MI'
123-
inputs:
124-
targetPath: '$(Build.StagingDirectory)/publish'
125-
artifactName: 'lldb-mi'
1+
parameters:
2+
- name: Build_Type
3+
displayName: Build Type
4+
type: string
5+
default: Release
6+
7+
stages:
8+
- stage: Build
9+
dependsOn: []
10+
jobs:
11+
- template: lldb-mi.template.yml
12+
parameters:
13+
llvm_build_type: ${{ parameters.Build_Type }}
14+
llvm_arch: x86_64
15+
- template: lldb-mi.template.yml
16+
parameters:
17+
llvm_build_type: ${{ parameters.Build_Type }}
18+
llvm_arch: arm64
19+
20+
- stage: Signing
21+
dependsOn: ["Build"]
22+
jobs:
23+
- template: lldb-mi-sign.template.yml

Build/loc/TranslationsImportExport.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ schedules:
1919
always: true
2020

2121
pool:
22-
vmImage: 'windows-latest'
22+
name: 'AzurePipelines-EO'
23+
demands:
24+
- ImageOverride -equals AzurePipelinesWindows2022compliant
2325

2426
steps:
2527
- task: CmdLine@2

0 commit comments

Comments
 (0)