Skip to content

Commit 6582a39

Browse files
committed
Merge branch 'topic/deps' into 'master'
Use dependency commits from a file to build ALS. See merge request eng/ide/ada_language_server!1685
2 parents 9a310e7 + 338d7b6 commit 6582a39

File tree

5 files changed

+48
-30
lines changed

5 files changed

+48
-30
lines changed

.github/workflows/build-binaries.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ jobs:
7070
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/aarch64-Linux-gmp-6.2.1.tar.bz2 . --sse=AES256
7171
sudo tar xjf aarch64-Linux-gcc-14.2.tar.bz2 -C /
7272
sudo tar xjf aarch64-Linux-gmp-6.2.1.tar.bz2 -C /
73+
- name: Fetch dependency commits numbers
74+
shell: bash
75+
if: ${{ env.TAG != env.DEFAULT_TAG }}
76+
run: |
77+
# For tags `actions/checkout@v2` action fetches a tag's commit, but
78+
# not the tag annotation itself. Let's refetch the tag from origin.
79+
# This makes `git show --no-patch --format=%n $TAG` work again.
80+
git tag --delete $TAG
81+
git fetch --tags
82+
git show --no-patch --format=%n $TAG > deps.txt
7383
- name: Build
7484
shell: bash
7585
run: |
@@ -100,7 +110,6 @@ jobs:
100110
path: |
101111
integration/vscode/ada/arm*
102112
integration/vscode/ada/x64*
103-
commits.txt
104113
- name: Upload release
105114
shell: bash
106115
if: ${{ env.TAG != env.DEFAULT_TAG }}

.github/workflows/release.sh

+2-19
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,11 @@ else
1919
NAME=${NODE_ARCH_PLATFORM%/*}-${NODE_ARCH_PLATFORM#*/}
2020
fi
2121

22-
# For tags `actions/checkout@v2` action fetches a tag's commit, but
23-
# not the tag annotation itself. Let's refetch the tag from origin.
24-
# This makes `git show --no-patch --format=%n $TAG` work again.
25-
git tag --delete "$TAG"
26-
git fetch --tags
27-
2822
function release_notes() {
2923
echo "# Release notes"
3024

3125
# Select the content of the first section of CHANGELOG.md
32-
sed -n -e '/^## \\<next>/,/^##/p' <CHANGELOG.md | tail -n +2 | head -n -1
33-
34-
COMMITS=commits.txt
35-
36-
if [ -f "$COMMITS" ]; then
37-
{
38-
echo "# Dependency commits"
39-
echo ""
40-
cat "$COMMITS"
41-
echo ""
42-
}
43-
fi
26+
sed -n -e '/^## \\<next>/,/^##/p' CHANGELOG.md | sed -e '1d;$d'
4427
}
4528

4629
release_notes >release_notes.md
@@ -69,7 +52,7 @@ upload_url=$(curl \
6952
echo "upload_url=$upload_url"
7053

7154
FILE=$NAME.tar.gz
72-
tar czvf "$FILE" "integration/vscode/ada/$NODE_ARCH_PLATFORM" commits.txt
55+
tar czvf "$FILE" "integration/vscode/ada/$NODE_ARCH_PLATFORM"
7356

7457
# Upload $FILE as an asset to the release
7558
curl \

doc/build.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Building Ada Language Server from sources
2+
3+
1. Install Alire, Python 3, NodeJS. Add them to `PATH`.
4+
5+
2. Disable dependency sharing in Alire
6+
7+
alr settings --global --set dependencies.shared false
8+
9+
3. Clone repository
10+
11+
git clone https://github.com/AdaCore/ada_language_server.git
12+
cd ada_language_server
13+
14+
4. If you know dependency commits numbers then create `deps.txt` file
15+
with lines `<repo_name>=commit`. Otherwise checkout `edge` branch.
16+
17+
5. Build scripts installs Python modules. So it's better to activate
18+
`venv` for Python:
19+
20+
python -m venv venv
21+
source venv/bin/activate
22+
23+
5. Run `build_als.sh` script
24+
25+
./scripts/build_als.sh

scripts/build_als.sh

+9-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ vss
3232

3333
# Pins repo names (crate name by default)
3434

35-
repo_adasat=AdaSAT
3635
repo_gnatcoll=gnatcoll-core
3736
repo_lal_refactor=lal-refactor
3837
repo_langkit_support=langkit
@@ -72,21 +71,23 @@ function install_index() {
7271

7372
# Clone dependencies
7473
function pin_crates() {
75-
echo "$(git rev-parse HEAD) ada_language_server" >commits.txt
76-
7774
for crate in $PINS; do
7875
repo_var=repo_$crate
7976
branch_var=branch_$crate
8077

8178
repo=${!repo_var}
8279
branch=${!branch_var}
80+
commit=""
81+
82+
if [ -f deps.txt ]; then
83+
commit=$(grep "^${repo:-$crate}=" deps.txt | sed -e 's/.*=//')
84+
fi
8385

8486
URL="https://github.com/AdaCore/${repo:-$crate}.git"
85-
GIT="git clone --depth=1"
86-
[ -d "subprojects/$crate" ] ||
87-
$GIT -b "${branch:-master}" "$URL" "subprojects/$crate"
88-
commit=$(git -C "subprojects/$crate" rev-parse HEAD)
89-
echo "$commit $crate" >>commits.txt
87+
if [ ! -d "subprojects/$crate" ]; then
88+
git clone "$URL" "subprojects/$crate"
89+
git -C "subprojects/$crate" checkout "${commit:-${branch:-master}}"
90+
fi
9091
cp -v "subprojects/$crate".toml "subprojects/$crate/alire.toml"
9192
alr --force --non-interactive pin "$crate" "--use=$PWD/subprojects/$crate"
9293
done

subprojects/gnatcoll.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ prepend = "${CRATE_ROOT}/core:${CRATE_ROOT}/projects:${CRATE_ROOT}/minimal"
2222
prepend = "${CRATE_ROOT}/core:${CRATE_ROOT}/projects:${CRATE_ROOT}/minimal"
2323

2424
[environment.'case(os)'.macos.DYLD_LIBRARY_PATH]
25-
append = "${CRATE_ROOT}/projects/lib/gnatcoll_projects/relocatable:${CRATE_ROOT}/core/lib/gnatcoll_core/relocatable:${CRATE_ROOT}/minimal/lib/gnatcoll_core/relocatable"
25+
append = "${CRATE_ROOT}/projects/lib/gnatcoll_projects/relocatable:${CRATE_ROOT}/core/lib/gnatcoll_core/relocatable:${CRATE_ROOT}/minimal/lib/gnatcoll_core/relocatable:${CRATE_ROOT}/lib/gnatcoll_projects/relocatable:${CRATE_ROOT}/lib/gnatcoll_core/relocatable"
2626

2727
[environment.'case(os)'.windows.PATH]
28-
append = "${CRATE_ROOT}/projects/lib/gnatcoll_projects/relocatable;${CRATE_ROOT}/core/lib/gnatcoll_core/relocatable;${CRATE_ROOT}/minimal/lib/gnatcoll_core/relocatable"
28+
append = "${CRATE_ROOT}/projects/lib/gnatcoll_projects/relocatable;${CRATE_ROOT}/core/lib/gnatcoll_core/relocatable;${CRATE_ROOT}/minimal/lib/gnatcoll_core/relocatable;${CRATE_ROOT}/lib/gnatcoll_projects/relocatable;${CRATE_ROOT}/lib/gnatcoll_core/relocatable"
2929

3030
[gpr-externals]
3131
GNATCOLL_ATOMICS = ["intrinsic", "mutex"]

0 commit comments

Comments
 (0)