Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/build_flang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v2

- name: ccache
uses: hendrikmuhs/ccache-action@v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to use this custom cacching action over the Github-provided one (https://github.com/actions/cache)?

Copy link
Contributor Author

@janisozaur janisozaur Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the GitHub cache action only provides a way of caching, the use of which you actually have to implement yourself. The ccache action used here provides that and builds on top of that - installs ccache itself, configures some options (the ones I mentioned in the opening comment), ensures ccache is available in the $PATH, creates a log entry with stats.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only concern is using an action in a private individual's repo.

WDYT, @bryanpkc @shivaramaarao

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TypeScript code looks pretty straightforward. Does the presence of the action in the GitHub Marketplace ensure its continued availability? Will it disappear suddenly and break our CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt presence on the actions marketplace guarantees anything. If that's a concern for you, you may consider forking the project into flang-compiler organisation. Personally though I wouldn't recommend that, this PR is quite small and self-contained. Should the action ever be removed, fallback to previous version is easy enough.

Alternatively, ccache installation and caching can be rewritten in bash so that you don't need to rely on external actions, but I'm not keen on doing that when current solution seems sufficient.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janisozaur I agree with your view. I don't have a concern with this use.


- if: matrix.cc == 'gcc' && matrix.version == '10'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
Expand Down Expand Up @@ -164,7 +167,9 @@ jobs:
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/usr/bin/${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=/usr/bin/${{ matrix.cpp }}"
-DCMAKE_CXX_COMPILER=/usr/bin/${{ matrix.cpp }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
git clone --depth 1 --single-branch --branch release_90 https://github.com/llvm-mirror/openmp.git
cd openmp
mkdir -p build && cd build
Expand All @@ -178,7 +183,9 @@ jobs:
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/usr/bin/${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=/usr/bin/${{ matrix.cpp }}"
-DCMAKE_CXX_COMPILER=/usr/bin/${{ matrix.cpp }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
cd runtime/libpgmath
mkdir -p build && cd build
cmake $CMAKE_OPTIONS ..
Expand All @@ -197,6 +204,8 @@ jobs:
-DCMAKE_Fortran_COMPILER_ID=Flang \
-DFLANG_INCLUDE_DOCS=ON \
-DFLANG_LLVM_EXTENSIONS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
..
make -j$(nproc)
sudo make install
Expand Down