-
-
Notifications
You must be signed in to change notification settings - Fork 390
Use ghc+integer-gmp for alpine linux build release #2615
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
05115c8
Remove integer-simple workaround
jneira 95d9abe
Skip upload to the release
jneira 32e952d
Fix echo cabal.project
jneira 4023d39
Echo PATH
jneira a96e088
Use specific cache for build
jneira 35c6606
Merge branch 'master' into integer-gmp
jneira d4e1072
runner not allowed out of steps
jneira 286ddd1
Use common cache
jneira 6e99bb6
Use raw ubuntu for ghc-9.2.1
jneira 94f6c27
Enable alpine for ghc-9.2.1
jneira 6767122
Replace gitrev with githash
jneira 1c8a3f0
Handle GitInfo exception
jneira 437bd3f
Merge branch 'master' into integer-gmp
jneira 86bf836
Clean up build workflow
jneira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,10 @@ on: | |
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
container: ${{ (matrix.os == 'ubuntu-18.04' && 'alpine:3.12') || '' }} | ||
container: ${{ (startsWith(matrix.os,'ubuntu') && 'alpine:3.12') || '' }} | ||
defaults: | ||
run: | ||
shell: ${{ (matrix.os == 'windows-latest' && 'bash') || 'sh' }} | ||
shell: ${{ (startsWith(matrix.os,'windows') && 'bash') || 'sh' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -35,58 +35,45 @@ jobs: | |
|
||
steps: | ||
- name: Install system dependencies | ||
if: matrix.os == 'ubuntu-18.04' | ||
if: runner.os == 'Linux' | ||
run: | | ||
apk add --no-cache curl gcc g++ gmp-dev ncurses-dev libffi-dev make xz gzip tar perl git bash sudo binutils-gold | ||
apk add --no-cache zlib zlib-dev zlib-static gmp gmp-dev ncurses-static | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Disable tests and bechmarks | ||
run: | | ||
echo -e 'tests: false' >> cabal.project.local | ||
echo -e 'benchmarks: false' >> cabal.project.local | ||
echo "tests: false" >> cabal.project.local | ||
echo "benchmarks: false" >> cabal.project.local | ||
|
||
- uses: ./.github/actions/setup-build | ||
with: | ||
ghc: ${{ matrix.ghc }} | ||
os: ${{ runner.os }} | ||
|
||
- name: (Windows) Platform specifics | ||
if: matrix.os == 'windows-latest' | ||
env: | ||
GHC_VER: ${{ matrix.ghc }} | ||
if: runner.os == 'Windows' | ||
run: | | ||
echo "EXE_EXT=.exe" >> $GITHUB_ENV | ||
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV | ||
|
||
- name: (Linux) Platform specifics | ||
if: matrix.os == 'ubuntu-18.04' | ||
env: | ||
GHC_VER: ${{ matrix.ghc }} | ||
run: | | ||
echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV | ||
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV | ||
|
||
- name: (macOS) Platform specifics | ||
if: matrix.os == 'macOS-latest' | ||
env: | ||
GHC_VER: ${{ matrix.ghc }} | ||
if: runner.os == 'Linux' | ||
run: | | ||
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV | ||
echo "CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV | ||
|
||
- name: Build the server | ||
# Try building it twice in case of flakey builds on Windows | ||
run: | | ||
cabal build exe:hls -O2 $LINUX_CABAL_ARGS || cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1 | ||
cabal build exe:hls -O2 $CABAL_ARGS || cabal build exe:hls -O2 $CABAL_ARGS -j1 | ||
|
||
- name: Compress server binary | ||
id: compress_server_binary | ||
run: | | ||
HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f) | ||
HLS=haskell-language-server-${{env.GHC_VERSION}} | ||
mv $HLS_BUILD $HLS${{env.EXE_EXT}} | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
7z a $HLS.zip $HLS${{env.EXE_EXT}} | ||
HLS=haskell-language-server-${{ matrix.ghc }} | ||
mv $HLS_BUILD $HLS${{ env.EXE_EXT }} | ||
if [[ "${{ runner.os }}" == "Windows" ]]; then | ||
7z a $HLS.zip $HLS${{ env.EXE_EXT }} | ||
echo ::set-output name=path::$HLS.zip | ||
echo ::set-output name=content_type::application/zip | ||
echo ::set-output name=extension::zip | ||
|
@@ -97,36 +84,36 @@ jobs: | |
echo ::set-output name=extension::gz | ||
fi | ||
|
||
- name: (not check) Upload server to release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload server to release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != ''}} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.compress_server_binary.outputs.path }} | ||
asset_name: haskell-language-server-${{ runner.OS }}-${{ env.GHC_VERSION }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} | ||
asset_name: haskell-language-server-${{ runner.os }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} | ||
asset_content_type: ${{ steps.compress_server_binary.outputs.content_type }} | ||
|
||
- name: Upload server to workflow artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} | ||
name: haskell-language-server-${{ runner.os }}-${{ matrix.ghc }}${{ env.EXE_EXT }}.${{ steps.compress_server_binary.outputs.extension }} | ||
path: ${{ steps.compress_server_binary.outputs.path }} | ||
|
||
- name: (GHC 8.10) Build the wrapper | ||
- name: Build the wrapper | ||
if: matrix.ghc == '8.10.7' | ||
run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS | ||
|
||
- name: (GHC 8.10) Compress wrapper binary | ||
- name: Compress wrapper binary | ||
if: matrix.ghc == '8.10.7' | ||
id: compress_wrapper_binary | ||
run: | | ||
HLS_WRAPPER_BUILD=$(find dist-newstyle \( -name 'hls-wrapper' -o -name 'hls-wrapper.exe' \) -type f) | ||
HLS_WRAPPER=haskell-language-server-wrapper | ||
mv $HLS_WRAPPER_BUILD $HLS_WRAPPER${{env.EXE_EXT}} | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
7z a $HLS_WRAPPER.zip $HLS_WRAPPER${{env.EXE_EXT}} | ||
mv $HLS_WRAPPER_BUILD $HLS_WRAPPER${{ env.EXE_EXT }} | ||
if [[ "${{ runner.os }}" == "Windows" ]]; then | ||
7z a $HLS_WRAPPER.zip $HLS_WRAPPER${{ env.EXE_EXT }} | ||
echo ::set-output name=path::$HLS_WRAPPER.zip | ||
echo ::set-output name=content_type::application/zip | ||
echo ::set-output name=extension::zip | ||
|
@@ -137,22 +124,22 @@ jobs: | |
echo ::set-output name=extension::gz | ||
fi | ||
|
||
- name: (GHC 8.10, not check) Upload wrapper to the release | ||
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }} | ||
- name: Upload wrapper to the release | ||
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.compress_wrapper_binary.outputs.path }} | ||
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }} | ||
asset_name: haskell-language-server-wrapper-${{ runner.os }}${{ env.EXE_EXT }}.${{ steps.compress_wrapper_binary.outputs.extension }} | ||
asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}} | ||
|
||
- name: (GHC 8.10) Upload wrapper to workflow artifacts | ||
- name: Upload wrapper to workflow artifacts | ||
uses: actions/upload-artifact@v2 | ||
if: matrix.ghc == '8.10.7' | ||
with: | ||
name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }} | ||
name: haskell-language-server-wrapper-${{ runner.os }}${{ env.EXE_EXT }}.${{ steps.compress_wrapper_binary.outputs.extension }} | ||
path: ${{ steps.compress_wrapper_binary.outputs.path }} | ||
|
||
# generates a custom tarball with sources, used by `ghcup compile hls` | ||
|
@@ -163,29 +150,38 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set hls release version | ||
run: | | ||
HLS_VER="${{ github.event.release.tag_name }}" | ||
if [[ -z $HLS_VER ]]; then | ||
HLS_VER=${{ github.sha }} | ||
HLS_VER=${HLS_VER:0:5} | ||
fi | ||
echo "HLS_VER=$HLS_VER" >> $GITHUB_ENV | ||
|
||
- name: Create source tarball | ||
run: | | ||
mkdir src-dist | ||
git archive --prefix=haskell-language-server-${{ github.event.release.tag_name }}/ \ | ||
git archive --prefix=haskell-language-server-${{ env.HLS_VER }}/ \ | ||
--format=tar.gz \ | ||
-o src-dist/haskell-language-server.tar.gz \ | ||
HEAD | ||
|
||
- name: (not check) Upload source tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload source tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: src-dist/haskell-language-server.tar.gz | ||
asset_name: haskell-language-server-${{ github.event.release.tag_name }}-src.tar.gz | ||
asset_name: haskell-language-server-${{ env.HLS_VER }}-src.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
- name: Upload source tarball to workflow artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: haskell-language-server-${{ github.event.release.tag_name }}-src.tar.gz | ||
name: haskell-language-server-${{ env.HLS_VER }}-src.tar.gz | ||
path: src-dist/haskell-language-server.tar.gz | ||
|
||
# this generates .gz tarfiles containing binaries for all GHC versions and OS's | ||
|
@@ -195,44 +191,53 @@ jobs: | |
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
os: [ "Linux" | ||
, "macOS" | ||
, "Windows" | ||
] | ||
target-os: [ "Linux" | ||
, "macOS" | ||
, "Windows" | ||
] | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
|
||
- name: Generate tarball with all binaries | ||
run: | | ||
# move the binaries for the specific platform into bin/ | ||
mkdir bin | ||
mv haskell-language-server-${{ matrix.os }}-*/* bin | ||
mv haskell-language-server-wrapper-${{ matrix.os }}.*/* bin | ||
mv haskell-language-server-${{ matrix.target-os }}-*/* bin | ||
mv haskell-language-server-wrapper-${{ matrix.target-os }}.*/* bin | ||
# decompress them | ||
cd bin | ||
if [[ "${{ matrix.os }}" == "Windows" ]]; then | ||
if [[ "${{ matrix.target-os }}" == "Windows" ]]; then | ||
7z x "*.zip" | ||
rm *.zip | ||
else | ||
gzip -d *.gz | ||
fi | ||
tar -czpf haskell-language-server.tar.gz * | ||
|
||
- name: (not check) Upload binaries tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload binaries tarball to the release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: bin/haskell-language-server.tar.gz | ||
asset_name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz | ||
asset_name: haskell-language-server-${{ matrix.target-os }}-${{ github.event.release.tag_name }}.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
- name: Set hls release version | ||
run: | | ||
HLS_VER="${{ github.event.release.tag_name }}" | ||
if [[ -z $HLS_VER ]]; then | ||
HLS_VER=${{ github.sha }} | ||
HLS_VER=${HLS_VER:0:5} | ||
fi | ||
echo "HLS_VER=$HLS_VER" >> $GITHUB_ENV | ||
|
||
- name: Upload binaries tarball to workflow artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: haskell-language-server-${{ matrix.os }}-${{ github.event.release.tag_name }}.tar.gz | ||
name: haskell-language-server-${{ matrix.target-os }}-${{ env.HLS_VER }}.tar.gz | ||
path: bin/haskell-language-server.tar.gz | ||
|
||
sha256sum: | ||
|
@@ -247,8 +252,8 @@ jobs: | |
# we clean up tags to match the release file names | ||
sed -i 's/\/.*)/)/g' SHA256SUMS | ||
|
||
- name: (not check) Upload sha256sums to the release | ||
if: ${{ !contains(github.ref_name, 'check') }} | ||
- name: Upload sha256sums to the release | ||
if: ${{ !contains(github.ref_name, 'check') && github.event.release.upload_url != '' }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ library | |
, data-default | ||
, ghc | ||
, ghcide ^>=1.4 || ^>=1.5 | ||
, gitrev | ||
, githash | ||
, lsp | ||
, hie-bios | ||
, hiedb | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
does this need to be
$CABAL_ARGS
?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.
omg 😧
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.
that should have failed, as @hasufell suggested, setting the appropriate bash flag