-
-
Notifications
You must be signed in to change notification settings - Fork 396
Add scripts for releases and final 1.7 tweaks #2850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c37e56e
5ce21d0
9114c11
b1e084e
51c49ce
3269f50
18af8aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ define set_rpath | |
endef | ||
|
||
hls: bindist/ghcs | ||
for ghc in $(shell [ -e "bindist/ghcs-`uname`" ] && cat "bindist/ghcs-`uname`" || cat "bindist/ghcs") ; do \ | ||
for ghc in $(shell [ -e "bindist/ghcs-`uname -o`" ] && cat "bindist/ghcs-`uname -o`" || cat "bindist/ghcs") ; do \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried it on Windows and FreeBSD, and it seems like the only way to detect mingw without a version number so I think it is OK. |
||
$(GHCUP) -v install ghc `echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` && \ | ||
$(GHCUP) -v gc -p -s -c && \ | ||
$(MAKE) GHC_VERSION=`echo $$ghc | $(AWK) -F ',' '{ print $$1 }'` PROJECT_FILE=`echo $$ghc | $(AWK) -F ',' '{ print $$2 }'` hls-ghc && \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
8.10.7,cabal.project | ||
9.0.2,cabal-ghc90.project | ||
9.2.2,cabal-ghc92.project | ||
9.2.1,cabal-ghc92.project |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,4 @@ test-suite tests | |
, base | ||
, filepath | ||
, hls-module-name-plugin | ||
, hls-test-utils ^>=1.2 | ||
, hls-test-utils ^>=1.3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ test-suite tests | |
, base | ||
, filepath | ||
, hls-stylish-haskell-plugin | ||
, hls-test-utils ^>=1.2 | ||
, hls-test-utils ^>=1.3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Making and uploading the Gitlab release to downloads.haskell.org | ||
|
||
1. Run the gitlab release pipeline using https://gitlab.haskell.org/haskell/haskell-language-server/-/pipelines/new | ||
2. Once the pipeline has completed, download the artifacts using `fetch_gitlab.py` | ||
- For example for the `1.7.0.0` release: `python fetch_gitlab.py -p <pipeline_id> --output haskell-language-server-1.7.0.0 -r 1.7.0.0` | ||
- Ensure all the artifacts in the output directory are accurate and add any missing/extra artifacts | ||
3. `cd` to the output directory created in the previous step, and run `SIGNING_KEY=<your signing key> ../upload.sh` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# adapted from https://gitlab.haskell.org/bgamari/ghc-utils/-/blob/master/rel-eng/fetch-gitlab-artifacts/fetch_gitlab.py | ||
import logging | ||
from pathlib import Path | ||
import subprocess | ||
import gitlab | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
def strip_prefix(s, prefix): | ||
if s.startswith(prefix): | ||
return s[len(prefix):] | ||
else: | ||
return None | ||
|
||
def fetch_artifacts(release: str, pipeline_id: int, | ||
dest_dir: Path, gl: gitlab.Gitlab): | ||
dest_dir.mkdir(exist_ok=True) | ||
proj = gl.projects.get('haskell/haskell-language-server') | ||
pipeline = proj.pipelines.get(pipeline_id) | ||
tmpdir = Path("fetch-gitlab") | ||
tmpdir.mkdir(exist_ok=True) | ||
for pipeline_job in pipeline.jobs.list(all=True): | ||
if len(pipeline_job.artifacts) == 0: | ||
logging.info(f'job {pipeline_job.name} ({pipeline_job.id}) has no artifacts') | ||
continue | ||
|
||
job = proj.jobs.get(pipeline_job.id) | ||
platform = strip_prefix(job.name, 'tar-') | ||
if not platform: | ||
logging.info(f'Skipping {job.name} (not a tar job)') | ||
continue | ||
try: | ||
destdir = tmpdir / job.name | ||
zip_name = Path(f"{tmpdir}/{job.name}.zip") | ||
if not zip_name.exists() or zip_name.stat().st_size == 0: | ||
logging.info(f'downloading archive {zip_name} for job {job.name} (job {job.id})...') | ||
with open(zip_name, 'wb') as f: | ||
job.artifacts(streamed=True, action=f.write) | ||
|
||
if zip_name.stat().st_size == 0: | ||
logging.info(f'artifact archive for job {job.name} (job {job.id}) is empty') | ||
continue | ||
|
||
dest = dest_dir / f'haskell-language-server-{release}-{platform}.tar.xz' | ||
if dest.exists(): | ||
logging.info(f'bindist {dest} already exists') | ||
continue | ||
|
||
subprocess.run(['unzip', '-bo', zip_name, '-d', destdir]) | ||
bindist_files = list(destdir.glob('*/haskell-language-server*.tar.xz')) | ||
if len(bindist_files) == 0: | ||
logging.warn(f'Bindist does not exist') | ||
continue | ||
|
||
bindist = bindist_files[0] | ||
logging.info(f'extracted {job.name} to {dest}') | ||
bindist.replace(dest) | ||
except Exception as e: | ||
logging.error(f'Error fetching job {job.name}: {e}') | ||
pass | ||
|
||
def main(): | ||
import argparse | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--pipeline', '-p', required=True, type=int, help="pipeline id") | ||
parser.add_argument('--release', '-r', required=True, type=str, help="release name") | ||
parser.add_argument('--output', '-o', type=Path, default=Path.cwd(), help="output directory") | ||
parser.add_argument('--profile', '-P', default='haskell', | ||
help='python-gitlab.cfg profile name') | ||
args = parser.parse_args() | ||
gl = gitlab.Gitlab.from_config(args.profile) | ||
fetch_artifacts(args.release, args.pipeline, | ||
dest_dir=args.output, gl=gl) | ||
|
||
if __name__ == '__main__': | ||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? This will break CI once 8.10.7 is deprecated, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If hls-wrapper is compiled with 9.2.2 then the job fails because it can't find libgcc_s_seh-1.dll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this should have been fixed upstream weeks ago.