Skip to content

Commit 2e637fd

Browse files
Merge pull request PowerShell#2008 from PowerShell/andschwa/x64-macOS
Update build documentation to include platyPS requirement
2 parents d4b6425 + 92e681d commit 2e637fd

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.github/workflows/emacs-test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ jobs:
2525
run: tools/azurePipelinesBuild.ps1
2626

2727
- name: Install Emacs
28-
uses: purcell/setup-emacs@v4.0
28+
uses: purcell/setup-emacs@master
2929
with:
30-
version: '28.1'
30+
version: '28.2'
3131

3232
- name: Run ERT
33-
run: emacs -batch -l ert -l test/emacs-test.el -f ert-run-tests-batch-and-exit
33+
run: |
34+
emacs -Q --batch -f package-refresh-contents --eval "(package-install 'eglot)"
35+
emacs -Q --batch -l test/emacs-test.el -f ert-run-tests-batch-and-exit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ App_Data
1111
*.sln.cache
1212
*.suo
1313
TestResults
14+
test/emacs-session.json
1415
[Tt]humbs.db
1516
buildd.*
1617
release/

PowerShellEditorServices.build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ $script:dotnetTestArgs = @("test") + $script:dotnetBuildArgs + $TestArgs + @(
4242
$script:IsNix = $IsLinux -or $IsMacOS
4343
# For Apple M1, pwsh might be getting emulated, in which case we need to check
4444
# for the proc_translated flag, otherwise we can check the architecture.
45-
$script:IsAppleM1 = $IsMacOS -and ((sysctl -n sysctl.proc_translated) -eq 1 -or (uname -m) -eq "arm64")
45+
$script:IsAppleM1 = $IsMacOS -and ((sysctl -n sysctl.proc_translated 2> $null) -eq 1 -or
46+
[System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64")
4647
$script:IsArm64 = -not $script:IsNix -and @("ARM64") -contains $env:PROCESSOR_ARCHITECTURE
4748
$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Hosting", "BuildInfo.cs")
4849
$script:PsesCommonProps = [xml](Get-Content -Raw "$PSScriptRoot/PowerShellEditorServices.Common.props")
@@ -272,7 +273,6 @@ Task LayoutModule -After Build {
272273
}
273274

274275
# Assemble the PowerShellEditorServices.VSCode module
275-
276276
foreach ($vscodeComponent in Get-ChildItem $script:VSCodeOutput) {
277277
if (-not $includedDlls.Contains($vscodeComponent.Name)) {
278278
Copy-Item -Path $vscodeComponent.FullName -Destination $psesVSCodeBinOutputPath -Force

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ git clone https://github.com/PowerShell/PowerShellEditorServices.git
159159

160160
```powershell
161161
Install-Module InvokeBuild -Scope CurrentUser
162+
Install-Module platyPS -Scope CurrentUser
162163
```
163164

164165
Now you're ready to build the code. You can do so in one of two ways:

test/emacs-test.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
;;; Code:
1010

11-
(require 'ert)
11+
;; Avoid using old packages.
12+
(setq load-prefer-newer t)
1213

1314
;; Improved TLS Security.
1415
(with-eval-after-load 'gnutls
@@ -21,16 +22,17 @@
2122
(add-to-list 'package-archives
2223
'("melpa" . "https://melpa.org/packages/") t)
2324
(package-initialize)
25+
(package-refresh-contents)
26+
27+
(require 'ert)
2428

2529
(require 'flymake)
2630

2731
(unless (package-installed-p 'powershell)
28-
(package-refresh-contents)
2932
(package-install 'powershell))
3033
(require 'powershell)
3134

3235
(unless (package-installed-p 'eglot)
33-
(package-refresh-contents)
3436
(package-install 'eglot))
3537
(require 'eglot)
3638

0 commit comments

Comments
 (0)