Skip to content
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

Dev/panda #59

Merged
merged 87 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
a8440c3
Upload/download actions updated
Ansaya Mar 24, 2022
bd06ad2
Build appimage workflow update
Ansaya Mar 24, 2022
1dc9880
Workflow refactoring
Ansaya Mar 24, 2022
a53904e
Top function name warning added
Ansaya Mar 24, 2022
927a50e
Housekeeping workflow fixed
Ansaya Mar 25, 2022
c7a3e0f
Merge branch 'publicMain' into ci_update
fabrizioferrandi Mar 25, 2022
36ae3e5
Reusable workflows for grs added
Ansaya Mar 25, 2022
2d07fb7
Merge branch 'ci_update' of github.com:ferrandi/private-PandA-bambu i…
Ansaya Mar 25, 2022
ad98e87
Added clean action to dist makefile
Ansaya Mar 26, 2022
3f2adcc
Build appimage workflow calls fixed
Ansaya Mar 26, 2022
5ff873f
Reusable workflow calls fixed
Ansaya Mar 26, 2022
d98a48c
Typo fix
Ansaya Mar 26, 2022
8a075ea
Reusable workflow syntax fixed
Ansaya Mar 26, 2022
fdc8b23
Double quotes are evil
Ansaya Mar 26, 2022
606afba
Build appimage workflow output updated
Ansaya Mar 26, 2022
f06e04d
Storage upload action fixed
Ansaya Mar 26, 2022
8118919
Ci update (#281)
Ansaya Mar 26, 2022
376b16e
Merge branch 'dev-private' into ci_update
Ansaya Mar 26, 2022
8f16eba
Reusable workflows dependencies fixed
Ansaya Mar 26, 2022
3472c99
Typo fix
Ansaya Mar 28, 2022
b76920b
Fix/ci scripts (#284)
Ansaya Mar 31, 2022
d5cfaab
Fixed address bit size when -m64 is used.
fabrizioferrandi Apr 8, 2022
60cdb22
Fixed some problems when -m64 is passed.
fabrizioferrandi Apr 11, 2022
36e4ce3
Fixed an issue with multi-way if pipelining when clang is used.
fabrizioferrandi Apr 13, 2022
28d3edb
Fixed a problem with pipelining of a function with a final latency of…
fabrizioferrandi Apr 13, 2022
e540222
Fixed a problem with QtCreator includes.
fabrizioferrandi Apr 13, 2022
5f14e98
Merge pull request #50 from ferrandi/FixM64
fabrizioferrandi Apr 13, 2022
b5c1797
Allocavar names (#51)
SerenaC94 Apr 14, 2022
1b29f1b
Merge branch 'dev/panda' into uniqueReturnFix
fabrizioferrandi Apr 14, 2022
e1a4ab3
Moved to the ninth dev release.
fabrizioferrandi Apr 15, 2022
490385b
Merge pull request #53 from ferrandi/uniqueReturnFix
fabrizioferrandi Apr 15, 2022
19e2dcf
Added support to smax,smin,umin and umax clang12 instrinsics.
fabrizioferrandi Apr 15, 2022
91fffa0
Merge pull request #54 from ferrandi/feature/MaxMinIntrinsics
fabrizioferrandi Apr 15, 2022
ea1e4bf
Removed an unused field.
fabrizioferrandi Nov 28, 2021
0c0d8b8
Merge pull request #55 from ferrandi/fix/RemoveUnused
fabrizioferrandi Apr 15, 2022
4956cf2
Merge branch 'dev/private' into dev/panda
Ansaya Apr 20, 2022
2f81f27
GRS workflow setup fixed
Ansaya Apr 20, 2022
8d0fd57
Github actions version updated
Ansaya Apr 20, 2022
2f03fdd
Long regression workflows fixed
Ansaya Apr 20, 2022
6f3408d
Workflow jobs naming fixed
Ansaya Apr 20, 2022
ea8d5a4
Example scripts exceptions added
Ansaya Apr 20, 2022
ba7e312
Generate appimage action updated
Ansaya Apr 21, 2022
578bffd
Makefile init updated
Ansaya Apr 21, 2022
f12b77e
Prebuilt compilers download script added
Ansaya Apr 21, 2022
b4f73be
Github actions cache naming update
Ansaya Apr 21, 2022
5e6b83d
Codechecks workflow fixed
Ansaya Apr 21, 2022
4e2a1e9
Makefile init fixed
Ansaya Apr 21, 2022
eaa1b33
Merge pull request #58 from ferrandi/fix/ci
Ansaya Apr 22, 2022
45e7fab
Libm job matrix typo fixed
Ansaya Apr 24, 2022
88993c1
VHDL workflow job dependency update
Ansaya Apr 24, 2022
49d806e
MachSuite benchmark code fixed
Ansaya Apr 24, 2022
856a70f
RTL design function inlining skip added
Ansaya Apr 24, 2022
ce5fbd1
Clang isnanf internal support added
Ansaya Apr 24, 2022
a3ac012
Merge pull request #60 from ferrandi/fix/ci
Ansaya Apr 25, 2022
2d7763e
Tree helper is_parameter nullpointer fixed
Ansaya May 2, 2022
2ccb967
Performance check github action fixed
Ansaya May 2, 2022
69ba068
NanoXplore benchmarks added back
Ansaya May 2, 2022
15bcd8d
Natural version sorting for external tools added
Ansaya May 4, 2022
b7b6b00
NXmap synthesis script generator updated
Ansaya May 4, 2022
561704e
NXmap synthesis script license check updated
Ansaya May 4, 2022
05e85bc
Unnecessary python env unset in AppImage
Ansaya May 5, 2022
0fd870e
CI setpu readme updated
Ansaya May 5, 2022
2ce29d0
NXmap python script fixed
Ansaya May 5, 2022
f4de303
Python scripts shebang updated
Ansaya May 5, 2022
f97c94a
Performance check action fixed
Ansaya May 5, 2022
9b8d8e1
Github runners setup readme updated
Ansaya May 5, 2022
0debb41
Python script calling fixed
Ansaya May 5, 2022
8be28ac
Python scripts requirements.txt added
Ansaya May 5, 2022
789a06c
Performance check action output fixed
Ansaya May 5, 2022
69ed425
Python script calling version specified
Ansaya May 5, 2022
a65197c
Quote fix
Ansaya May 6, 2022
243f272
Boost regex usage fix
Ansaya May 6, 2022
e0fb4ff
Disable clang opt vectorization
Ansaya May 6, 2022
bd4876a
Compiler -m parameter check fix
Ansaya May 6, 2022
afa0801
Merge pull request #61 from ferrandi/fix/minor
Ansaya May 6, 2022
33c7af6
Merge branch 'main' into dev/panda
Ansaya May 12, 2022
9ee32d7
Documentation url fix
Ansaya May 12, 2022
cfe6b93
NanoXplore synthesis script generator unified
Ansaya May 14, 2022
d84a765
NXmap synthesis log parser fix
Ansaya May 15, 2022
ba0398c
Eucalyptus output path fix
Ansaya May 15, 2022
b473115
Characterization scripts updated
Ansaya May 15, 2022
401b325
Characterize workflow added
Ansaya May 15, 2022
f409fa4
Characterize workflow typo fix
Ansaya May 16, 2022
b646949
Added success gathering job for complex workflows
Ansaya May 16, 2022
8c5e5e2
Workflows branch id updated
Ansaya May 17, 2022
ec3c29e
Merge pull request #65 from ferrandi/feature/nxmap_update
Ansaya May 18, 2022
38db917
Merge workflow fix
Ansaya May 18, 2022
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
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ARG COMPILERS=gcc-4.9,clang-4
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
WORKDIR /
RUN bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
&& bash /tmp/library-scripts/compiler-setup.sh "${COMPILERS}" \
&& bash /tmp/library-scripts/compiler-download.sh "/" "${COMPILERS}" \
&& bash /tmp/library-scripts/compiler-setup.sh \
&& apt-get install --no-install-recommends -y clang-format python3-defusedxml python3-distutils \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile.yosys
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ARG COMPILERS=gcc-4.9,clang-4
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
WORKDIR /
RUN bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
&& bash /tmp/library-scripts/compiler-setup.sh "${COMPILERS}" \
&& bash /tmp/library-scripts/compiler-download.sh "/" "${COMPILERS}" \
&& bash /tmp/library-scripts/compiler-setup.sh \
&& apt-get install --no-install-recommends -y clang-format python3-defusedxml python3-distutils \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
78 changes: 78 additions & 0 deletions .devcontainer/library-scripts/compiler-download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

export XZ_OPT='-T0'

install_dir="$1"
shift
compilers_list="$1"
shift
bambuhls_compiler_url="https://release.bambuhls.eu/compiler"

inflate() {
echo "Installing $1 into $2"
case $1 in
clang-12 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-11 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-10 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-9 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang+llvm-9.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-8 )
wget https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-7 )
wget https://releases.llvm.org/7.0.1/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-6 )
wget https://releases.llvm.org/6.0.1/clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-5 )
wget https://releases.llvm.org/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-4 )
wget https://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
gcc-4.5 )
wget ${bambuhls_compiler_url}/gcc-4.5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.6 )
wget ${bambuhls_compiler_url}/gcc-4.6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.7 )
wget ${bambuhls_compiler_url}/gcc-4.7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.8 )
wget ${bambuhls_compiler_url}/gcc-4.8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.9 )
wget ${bambuhls_compiler_url}/gcc-4.9-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-5 )
wget ${bambuhls_compiler_url}/gcc-5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-6 )
wget ${bambuhls_compiler_url}/gcc-6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-7 )
wget ${bambuhls_compiler_url}/gcc-7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-8 )
wget ${bambuhls_compiler_url}/gcc-8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
* )
;;
esac
}
IFS=',' read -r -a compilers <<< "${compilers_list}"
compilers=( $(IFS=$'\n'; echo "${compilers[*]}" | sort -V) )
for compiler in "${compilers[@]}"
do
inflate $compiler $install_dir
done
wait
72 changes: 0 additions & 72 deletions .devcontainer/library-scripts/compiler-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,78 +8,6 @@
# versions of GCC compilers after newer ones may cause compatibility issues.
###
set -e
export XZ_OPT='-T0'

install="$1"

inflate() {
echo "Installing $1"
case $1 in
clang-12 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-11 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-10 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-9 )
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang+llvm-9.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-8 )
wget https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-7 )
wget https://releases.llvm.org/7.0.1/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-6 )
wget https://releases.llvm.org/6.0.1/clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-5 )
wget https://releases.llvm.org/5.0.2/clang+llvm-5.0.2-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
clang-4 )
wget https://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
gcc-4.5 )
wget https://release.bambuhls.eu/compiler/gcc-4.5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.6 )
wget https://release.bambuhls.eu/compiler/gcc-4.6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.7 )
wget https://release.bambuhls.eu/compiler/gcc-4.7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.8 )
wget https://release.bambuhls.eu/compiler/gcc-4.8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.9 )
wget https://release.bambuhls.eu/compiler/gcc-4.9-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-5 )
wget https://release.bambuhls.eu/compiler/gcc-5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-6 )
wget https://release.bambuhls.eu/compiler/gcc-6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-7 )
wget https://release.bambuhls.eu/compiler/gcc-7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-8 )
wget https://release.bambuhls.eu/compiler/gcc-8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
* )
;;
esac
}
IFS=',' read -r -a compilers <<< "${install}"
compilers=( $(IFS=$'\n'; echo "${compilers[*]}" | sort -V) )
for compiler in "${compilers[@]}"
do
inflate $compiler /
done
wait

if [[ "$PATH" != */usr/lib/ccache* ]]; then
echo "export PATH=/usr/lib/ccache:$PATH" >> /etc/profile
Expand Down
33 changes: 20 additions & 13 deletions .github/SETUP.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Expected github runners setup

## Job configuration
A worflow job may be configured to run within a docker machine or directly in the host environment, in the latter case be aware that Bambu distributions coming from other jobs as artifacts may need the _APPDIR_ variable to be set to the new install location.
Github runners may be configured to run within a docker container or directly in the host environment. In the former case there may be some issues during the execution of external vendor tools which may not support a containerized environment.

## Runner labels
Runners may expose many different labels based on what tools are available on the host machine.
Runners may expose many different labels based on what tools are available on the host machine. Comments about docker volumes are intender for a containerized environment only.

- **altera**: Altera synthesis tools are available on the host machine and a docker volume named altera-tools exposes Altera tools install directories (e.g. Quartus, QuestaSim, ...)
- **intel**: Intel synthesis tools are available on the host machine and a docker volume named intel-tools exposes modern Intel FPGA tools install directories (e.g. Quartus Prime, QuestaSim, ...)
Expand All @@ -13,20 +12,28 @@ Runners may expose many different labels based on what tools are available on th
- **nanoxplore**: NanoXplore synthesis tools are available on the host machine and a docker volume named nanoxplore-tools exposes NanoXplore tools install directories
- **xilinx**: Xilinx synthesis tools are available on the host machine and a docker volume named xilinx-tools exposes Xilinx tools install directories (e.g. Vivado, Vitis HLS, ...)

Directories containing license files should be copied or linked in container user home. Volumes may be defined as read-only to avoid issues.
If working with docker containers, directories containing license files should be copied or linked in container user home. Volumes may be defined as read-only to avoid issues.

A **licenses-home** volume is always expected when at least one of the above is defined. It should contain all necessary license files for available tools. Workflow job is expected to copy the volume content into the home directory of current user when running a container.

To create such volumes the following may be useful:

```
docker volume create --driver local --opt o=bind,ro --opt type=none --opt device=/path/to/dir vendor-tools
```

## Runner environment
## Environment variables
Some environment variables are expected to be set by each runner host:

- **J**: number of maximum parallel jobs handled by the runner
- **LM_LICENSE_FILE**: license file path for simulation/synthesis tools
- **NXLMD_LICENSE_FILE**: NanoXplore license file path (needed only if different from LM_LICENSE_FILE)
- **NANOXPLORE_BYPASS**: NanoXplore bypass setting
- **LIBRARY_PATH**: necessary to support older gcc compilers (set to: /usr/lib/x86_64-linux-gnu)

## Python support
Current CI implementation requires Python 3.6.15 to be available in the runner environment. Pyenv is recommended to provide the support.
Furthermore pip packages from `etc/scripts/requirements.txt` are required to run python scripts correctly.

Use the following to install the required Python version through PyEnv and set it as global default.

```
CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.15
pyenv global 3.6.15
pip install -r /path/to/repo/et/scripts/requirements.txt
```

Note that Github Runners are launched as systemd services, thus `~/.bashrc` or `~/.profile` are not loaded.
A `.path` file should be added in the runner directory containing standard _PATH_ variable prepended with PyEnv shims and bin paths.
23 changes: 23 additions & 0 deletions .github/actions/generate-appimage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Panda build"
description: "Configure, build, and generate Panda Bambu appimage"
inputs:
config-args:
description: "Configure command line arguments"
required: false
default: ""
jobs:
description: "Parallel jobs"
required: false
default: "1"
outputs:
appimage:
description: "Output appimage file"
dist-dir:
description: "Distribution directory with appimage contents"
runs:
using: "docker"
image: "Dockerfile"
env:
J: ${{inputs.jobs}}
args:
- ${{inputs.config-args}}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
###
set -e

workspace_dir=$PWD
workspace_dir="$PWD"
dist_dir="$workspace_dir/dist"
build_dir="$workspace_dir/build"
ccache_dir="$workspace_dir/.ccache"
autoconf_cache_dir="$workspace_dir/.autoconf"

function cleanup {
echo "::endgroup::"
Expand All @@ -36,11 +40,11 @@ export PATH=/usr/lib/ccache:$PATH
mkdir -p ~/.ccache/
cat > ~/.ccache/ccache.conf << EOF
max_size = 5.0G
cache_dir = $workspace_dir/.ccache
cache_dir = $ccache_dir
EOF
if [[ -d "dist" ]]; then
if [[ -d "$dist_dir" ]]; then
echo "Pre-initialized dist dir found. Installing system wide..."
cp -r dist/. /
cp -r $dist_dir/. /
fi

if [[ -d "compiler" ]]; then
Expand All @@ -57,12 +61,12 @@ do
NO_DELETE+=" -o -name $(basename $bin)"
done
NO_DELETE+=" ${CLANG_EXES[@]/#/-o -name }"
find dist/clang+llvm-*/bin '(' -type f -o -type l ')' ! '(' $NO_DELETE ')' -delete
rm -f dist/clang+llvm*/lib/*.a
rm -rf dist/clang+llvm*/share
rm -rf dist/usr/share
find $dist_dir/clang+llvm-*/bin '(' -type f -o -type l ')' ! '(' $NO_DELETE ')' -delete
rm -f $dist_dir/clang+llvm*/lib/*.a
rm -rf $dist_dir/clang+llvm*/share
rm -rf $dist_dir/usr/share

mkdir -p "$workspace_dir/dist/usr/bin"
mkdir -p "$dist_dir/usr/bin"
for clang_exe in $CLANG_BINS
do
CLANG_VER=$(sed 's/clang-//g' <<< "$(basename $clang_exe)")
Expand All @@ -72,7 +76,7 @@ do
do
if [[ -f "$CLANG_DIR/$app" ]]; then
ln -sf "$CLANG_DIR/$app" "/usr/bin/$app-$CLANG_VER"
ln -sf "../..$CLANG_DIR/$app" "$workspace_dir/dist/usr/bin/$app-$CLANG_VER"
ln -sf "../..$CLANG_DIR/$app" "$dist_dir/usr/bin/$app-$CLANG_VER"
fi
done
echo "Generating ccache alias for clang-$CLANG_VER"
Expand All @@ -87,7 +91,7 @@ do
ln -sf ../../bin/ccache "/usr/lib/ccache/$(basename $compiler)"
done

max_gcc_ver="$(ls -x -v -1a dist/usr/include/c++ 2> /dev/null | tail -1)"
max_gcc_ver="$(ls -x -v -1a $dist_dir/usr/include/c++ 2> /dev/null | tail -1)"
if [[ -z "${max_gcc_ver}" ]]
then
echo "At least one gcc version must be bundled in the AppImage"
Expand All @@ -100,28 +104,39 @@ make -f Makefile.init
echo "::endgroup::"

echo "::group::Configure build environment"
mkdir build
cd build
../configure --prefix=/usr $@
cd ..
mkdir -p $build_dir
cd $build_dir
if [[ -d "$autoconf_cache_dir" ]]; then
echo "Restoring autoconf cache"
mv $autoconf_cache_dir/* .
fi
../configure --prefix=/usr -C $@
autoconf_caches=("`find . -type f -path '**/config.cache'`")
for cache in $autoconf_caches
do
mirror_dir="$autoconf_cache_dir/$(dirname $cache)"
mkdir -p $mirror_dir
cp $cache $mirror_dir
done
cd $workspace_dir
echo "::endgroup::"

echo "::group::Build Bambu"
make --directory=build -j$J install-strip DESTDIR="$workspace_dir/dist"
make --directory=$build_dir -j$J install-strip DESTDIR="$dist_dir"
echo "::endgroup"

echo "::group::Package Appimage"

echo "Inflating libraries..."
mkdir dist/lib
mkdir dist/lib/x86_64-linux-gnu/
cp -d /lib/x86_64-linux-gnu/libtinfo.so* dist/lib/x86_64-linux-gnu/
cp -d /usr/lib/x86_64-linux-gnu/libicu*.so* dist/lib/x86_64-linux-gnu/
cp -d /usr/lib/libbdd.so* dist/usr/lib/
mkdir $dist_dir/lib
mkdir $dist_dir/lib/x86_64-linux-gnu/
cp -d /lib/x86_64-linux-gnu/libtinfo.so* $dist_dir/lib/x86_64-linux-gnu/
cp -d /usr/lib/x86_64-linux-gnu/libicu*.so* $dist_dir/lib/x86_64-linux-gnu/
cp -d /usr/lib/libbdd.so* $dist_dir/usr/lib/

echo "Inflating metadata..."
cp style/img/panda.png.in dist/bambu.png
cat > dist/bambu.desktop << EOF
cp style/img/panda.png.in $dist_dir/bambu.png
cat > $dist_dir/bambu.desktop << EOF
[Desktop Entry]
Name=bambu
Exec=tool_select.sh
Expand All @@ -130,9 +145,11 @@ Type=Application
Terminal=true
Categories=Development;
EOF
cat > dist/usr/bin/tool_select.sh << EOF
cat > $dist_dir/usr/bin/tool_select.sh << EOF
#!/bin/bash
export LC_ALL="C"
unset PYTHONHOME # Python is not bundled with this AppImage
unset PYTHONPATH
BINARY_NAME=\$(basename "\$ARGV0")
BINARY_PATH="\$APPDIR/usr/bin/\$BINARY_NAME"
if [ "\$BINARY_NAME" == "debug_terminal" ]; then
Expand All @@ -143,12 +160,12 @@ if [ ! -e "\$BINARY_PATH" ]; then
fi
\$BINARY_PATH "\$@"
EOF
chmod a+x dist/usr/bin/tool_select.sh
chmod a+x $dist_dir/usr/bin/tool_select.sh

echo "Generating appimage..."
curl -L https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64 -o dist/AppRun -s
chmod +x dist/AppRun
ARCH=x86_64 appimagetool dist 2> /dev/null
curl -L https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64 -o $dist_dir/AppRun -s
chmod +x $dist_dir/AppRun
ARCH=x86_64 appimagetool $dist_dir 2> /dev/null

echo "::set-output name=appimage::$(ls *.AppImage)"
echo "::set-output name=dist-dir::dist"
Loading