Skip to content

Commit 6a8d6fc

Browse files
committed
Merge branch 'master' of github.com:jaredly/reason-language-server
2 parents 9557e89 + d833879 commit 6a8d6fc

22 files changed

+229
-281
lines changed

.ci/build-platform.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Cross-platform set of build steps for building esy projects
2+
3+
parameters:
4+
platform: "macOS"
5+
vmImage: "macOS-10.13"
6+
7+
jobs:
8+
- job: ${{ parameters.platform }}
9+
pool:
10+
vmImage: ${{ parameters.vmImage }}
11+
demands: node.js
12+
timeoutInMinutes: 120 # This is mostly for Windows
13+
variables:
14+
ESY__CACHE_INSTALL_PATH: ${{ parameters.ESY__CACHE_INSTALL_PATH }}
15+
CACHE_FOLDER: $(Pipeline.Workspace)/cache
16+
steps:
17+
- template: utils/use-node.yml
18+
- template: utils/use-esy.yml
19+
- template: utils/restore-build-cache.yml
20+
- script: "esy install"
21+
displayName: "esy install"
22+
- script: "esy build"
23+
displayName: "esy build"
24+
# - script: "esy test"
25+
# displayName: "Test command"
26+
- template: utils/publish-build-cache.yml
27+
- bash: ./_build/default/src/analyze_example_tests/ExamplesTests.exe
28+
- bash: ./_build/default/util_tests/UtilTests.exe
29+
- bash: mkdir -p rls-release
30+
- bash: cp _build/default/bin/Bin.exe rls-release/reason-language-server.exe
31+
- task: PublishBuildArtifacts@1
32+
displayName: 'Upload binary'
33+
inputs:
34+
pathToPublish: 'rls-release'
35+
artifactName: 'rls-$(Agent.OS)'
36+
parallel: true
37+
parallelCount: 8

.ci/esy-build-steps.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.ci/publish-build-cache.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.ci/restore-build-cache.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.ci/use-calc-esy-install-path.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.ci/utils/publish-build-cache.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
steps:
2+
- pwsh: Copy-Item -Path $(ESY__CACHE_INSTALL_PATH) -Destination $(CACHE_FOLDER) -Recurse
3+
displayName: '[Cache][Publish] Copy builds to be cached'

.ci/utils/restore-build-cache.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# The cache key is built up of the following:
2+
# We use a string that we can change to bust the cache
3+
# The string "esy"
4+
# The string for the OS
5+
# The hash of the lock file
6+
steps:
7+
- bash: |
8+
# COMPUTE THE ESY INSTALL CACHE LOCATION AHEAD OF TIME
9+
DESIRED_LEN="86"
10+
# Note: This will need to change when upgrading esy version
11+
# that reenables long paths on windows.
12+
if [ "$AGENT_OS" == "Windows_NT" ]; then
13+
DESIRED_LEN="33"
14+
fi
15+
HOME_ESY3="$HOME/.esy/3"
16+
HOME_ESY3_LEN=${#HOME_ESY3}
17+
NUM_UNDERS=$(echo "$(($DESIRED_LEN-$HOME_ESY3_LEN))")
18+
UNDERS=$(printf "%-${NUM_UNDERS}s" "_")
19+
UNDERS="${UNDERS// /_}"
20+
THE_ESY__CACHE_INSTALL_PATH=${HOME_ESY3}${UNDERS}/i
21+
if [ "$AGENT_OS" == "Windows_NT" ]; then
22+
THE_ESY__CACHE_INSTALL_PATH=$( cygpath --mixed --absolute "$THE_ESY__CACHE_INSTALL_PATH")
23+
fi
24+
echo "THE_ESY__CACHE_INSTALL_PATH: $THE_ESY__CACHE_INSTALL_PATH"
25+
# This will be exposed as an env var ESY__CACHE_INSTALL_PATH, or an
26+
# Azure var esy__cache_install_path
27+
echo "##vso[task.setvariable variable=esy__cache_install_path]$THE_ESY__CACHE_INSTALL_PATH"
28+
displayName: '[Cache] calculate esy store path'
29+
30+
- task: Cache@2
31+
inputs:
32+
# "v1" prefix added just to keep the ability to clear a cache without having to wait 7 days
33+
key: v1 | esy | $(Agent.OS) | esy.lock/index.json
34+
restoreKeys: v1 | esy | $(Agent.OS)
35+
path: $(CACHE_FOLDER)
36+
cacheHitVar: CACHE_RESTORED
37+
displayName: '[Cache] esy packages'
38+
39+
- pwsh: 'New-Item $(ESY__CACHE_INSTALL_PATH) -ItemType Directory'
40+
condition: eq(variables.CACHE_RESTORED, 'true')
41+
displayName: '[Cache][Restore] Create esy cache directory'
42+
43+
- pwsh: Move-Item -Path $(CACHE_FOLDER)/* -Destination $(ESY__CACHE_INSTALL_PATH)
44+
displayName: '[Cache][Restore] Move downloaded cache in place'
45+
condition: eq(variables.CACHE_RESTORED, 'true')

.ci/utils/use-esy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# steps to install esy globally
2+
3+
steps:
4+
- script: "npm install -g esy@0.5.8"
5+
displayName: "install esy"

.ci/utils/use-node.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# steps to use node on agent
2+
3+
steps:
4+
- task: NodeTool@0
5+
displayName: "Use Node 8.x"
6+
inputs:
7+
versionSpec: 8.x

azure-pipelines.yml

Lines changed: 41 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,51 @@
1-
# Starter pipeline
2-
# Start with a minimal pipeline that you can customize to build and deploy your code.
3-
# Add steps that build, run tests, deploy, and more:
4-
# https://aka.ms/yaml
5-
6-
71
name: $(Build.SourceVersion)
8-
jobs:
9-
- job: Linux
10-
timeoutInMinutes: 0
11-
pool:
12-
vmImage: 'Ubuntu 16.04'
13-
14-
variables:
15-
STAGING_DIRECTORY: /home/vsts/STAGING
16-
STAGING_DIRECTORY_UNIX: /home/vsts/STAGING
17-
ESY__CACHE_INSTALL_PATH: /home/vsts/.esy/3_____________________________________________________________________/i
18-
ESY__CACHE_SOURCE_TARBALL_PATH: /home/vsts/.esy/source/i
19-
# ESY__NPM_ROOT: /opt/hostedtoolcache/node/8.14.0/x64/lib/node_modules/esy
202

21-
steps:
22-
- template: .ci/use-node.yml
23-
- template: .ci/restore-build-cache.yml
24-
- template: .ci/esy-build-steps.yml
25-
- template: .ci/publish-build-cache.yml
3+
trigger:
4+
branches:
5+
include:
6+
- master
267

27-
- job: MacOS
28-
timeoutInMinutes: 0
29-
pool:
30-
vmImage: 'macOS 10.13'
8+
pr:
9+
branches:
10+
include:
11+
- "*"
3112

32-
variables:
33-
STAGING_DIRECTORY: /Users/runner/STAGING
34-
STAGING_DIRECTORY_UNIX: /Users/runner/STAGING
35-
ESY__CACHE_SOURCE_TARBALL_PATH: /Users/runner/.esy/source/i
36-
# ESY__NPM_ROOT: /usr/local/lib/node_modules/esy
37-
38-
steps:
39-
- template: .ci/use-calc-esy-install-path.yml
40-
- template: .ci/use-node.yml
41-
- template: .ci/restore-build-cache.yml
42-
- template: .ci/esy-build-steps.yml
43-
- template: .ci/publish-build-cache.yml
44-
45-
- job: Windows
46-
timeoutInMinutes: 0
47-
pool:
48-
vmImage: 'vs2017-win2016'
13+
jobs:
14+
- template: .ci/build-platform.yml
15+
parameters:
16+
platform: Linux
17+
vmImage: ubuntu-16.04
4918

50-
variables:
51-
STAGING_DIRECTORY: C:\Users\VssAdministrator\STAGING
52-
STAGING_DIRECTORY_UNIX: /C/Users/VssAdministrator/STAGING
53-
ESY__CACHE_INSTALL_PATH: /C/Users/VssAdministrator/.esy/3_/i
54-
ESY__CACHE_SOURCE_TARBALL_PATH: /C/Users/VssAdministrator/.esy/source/i
55-
# ESY__NPM_ROOT: /C/npm/prefix/node_modules/esy
19+
- template: .ci/build-platform.yml
20+
parameters:
21+
platform: macOS
22+
vmImage: macOS-10.13
5623

57-
steps:
58-
- template: .ci/use-node.yml
59-
- template: .ci/restore-build-cache.yml
60-
- template: .ci/esy-build-steps.yml
61-
- template: .ci/publish-build-cache.yml
24+
# Need windows-2019 to do esy import/export-dependencies
25+
# which assumes you have bsdtar (tar.exe) in your system
26+
# otherwise it will end up using the esy-bash tar which doesn't
27+
# understand drives like D:/ (thinks it's an scp path).
28+
- template: .ci/build-platform.yml
29+
parameters:
30+
platform: Windows
31+
vmImage: windows-2019
6232

63-
- job: Release
64-
timeoutInMinutes: 0
65-
displayName: Release
66-
dependsOn:
67-
- Linux
68-
- MacOS
69-
- Windows
70-
condition: succeeded()
71-
pool:
72-
vmImage: ubuntu-16.04
73-
steps:
74-
- task: PublishBuildArtifacts@1
75-
displayName: 'Release Package'
76-
inputs:
77-
PathtoPublish: './editor-extensions/vscode/'
78-
ArtifactName: npm-package
33+
- job: Release
34+
timeoutInMinutes: 0
35+
displayName: Release
36+
dependsOn:
37+
- Linux
38+
- MacOS
39+
- Windows
40+
condition: succeeded()
41+
pool:
42+
vmImage: ubuntu-16.04
43+
steps:
44+
- task: PublishBuildArtifacts@1
45+
displayName: 'Release Package'
46+
inputs:
47+
PathtoPublish: './editor-extensions/vscode/'
48+
ArtifactName: npm-package
7949

8050

8151
# - name: release

core/Query.re

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ let findInScope = (pos, name, stamps) => {
4646

4747
let rec joinPaths = (modulePath, path) => {
4848
switch modulePath {
49-
| Path.Pident(ident) => (Current.ident_binding_time(ident), Ident.name(ident), path)
49+
| Path.Pident(ident) => (Current.ident_binding_time_408(ident), Ident.name(ident), path)
5050
| Path.Papply(fnPath, _argPath) => joinPaths(fnPath, path)
5151
| Path.Pdot(inner, name) => joinPaths(inner, Nested(name, path))
5252
}
5353
};
5454

5555
let rec makePath = (modulePath) => {
5656
switch modulePath {
57-
| Path.Pident(ident) when Current.ident_binding_time(ident) === 0 =>
57+
| Path.Pident(ident) when Current.ident_binding_time_408(ident) === 0 =>
5858
`GlobalMod(Ident.name(ident))
59-
| Path.Pident(ident) => `Stamp(Current.ident_binding_time(ident))
59+
| Path.Pident(ident) => `Stamp(Current.ident_binding_time_408(ident))
6060
| Path.Papply(fnPath, _argPath) => makePath(fnPath)
6161
| Path.Pdot(inner, name) => `Path(joinPaths(inner, Tip(name)))
6262
}

ocaml_typing/current/Current.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ type longident = Longident.t =
1414

1515
type abstract_ident = Ident.t
1616

17-
type ident =
17+
type ident_408 =
1818
| Local of { name: string; stamp: int }
1919
| Scoped of { name: string; stamp: int; scope: int }
2020
| Global of string
2121
| Predef of { name: string; stamp: int }
2222

23-
let ident_binding_time ident =
24-
let current_ident = (Obj.magic ident : ident) in
23+
let ident_binding_time_408 (ident: Ident.t) =
24+
let current_ident = (Obj.magic ident : ident_408) in
2525
match current_ident with
2626
| Predef { stamp }
2727
| Scoped { stamp }

0 commit comments

Comments
 (0)