mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
[backport] macos ci fixes for v1.16 (#25672)
* ci: lockdown gcc v9 for macos Signed-off-by: Ramon Roche <mrpollo@gmail.com> * pxh: do not use variable sized array on the stack This is a compiler-specific extension * ci: macos build on older gcc Signed-off-by: Ramon Roche <mrpollo@gmail.com> --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Beat Küng <beat-kueng@gmx.net>
This commit is contained in:
@@ -16,7 +16,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macos-latest
|
runs-on: macos-14
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
config: [
|
config: [
|
||||||
@@ -32,7 +32,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: setup
|
- name: setup
|
||||||
run: ./Tools/setup/macos.sh; ./Tools/setup/macos.sh
|
run: |
|
||||||
|
./Tools/setup/macos.sh
|
||||||
|
|
||||||
- name: Prepare ccache timestamp
|
- name: Prepare ccache timestamp
|
||||||
id: ccache_cache_timestamp
|
id: ccache_cache_timestamp
|
||||||
@@ -40,12 +41,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
||||||
message("::set-output name=timestamp::${current_date}")
|
message("::set-output name=timestamp::${current_date}")
|
||||||
|
|
||||||
- name: ccache cache files
|
- name: ccache cache files
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.ccache
|
path: ~/.ccache
|
||||||
key: macos_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
|
key: macos_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
|
||||||
restore-keys: macos_${{matrix.config}}-ccache-
|
restore-keys: macos_${{matrix.config}}-ccache-
|
||||||
|
|
||||||
- name: setup ccache
|
- name: setup ccache
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ccache
|
mkdir -p ~/.ccache
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ else
|
|||||||
echo "Installing PX4 general dependencies (homebrew px4-dev)"
|
echo "Installing PX4 general dependencies (homebrew px4-dev)"
|
||||||
brew tap PX4/px4
|
brew tap PX4/px4
|
||||||
brew install px4-dev
|
brew install px4-dev
|
||||||
|
# lock down gcc to v9 for v1.16 branch
|
||||||
|
brew install gcc-arm-none-eabi
|
||||||
brew install ncurses
|
brew install ncurses
|
||||||
brew install python-tk
|
brew install python-tk
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ int Pxh::process_line(const std::string &line, bool silently_fail)
|
|||||||
|
|
||||||
// Note that argv[argc] always needs to be a nullptr.
|
// Note that argv[argc] always needs to be a nullptr.
|
||||||
// Therefore add one more entry.
|
// Therefore add one more entry.
|
||||||
const char *arg[words.size() + 1];
|
char **arg = new char *[words.size() + 1];
|
||||||
|
|
||||||
for (unsigned i = 0; i < words.size(); ++i) {
|
for (unsigned i = 0; i < words.size(); ++i) {
|
||||||
arg[i] = (char *)words[i].c_str();
|
arg[i] = (char *)words[i].c_str();
|
||||||
@@ -110,7 +110,7 @@ int Pxh::process_line(const std::string &line, bool silently_fail)
|
|||||||
// Explicitly set this nullptr.
|
// Explicitly set this nullptr.
|
||||||
arg[words.size()] = nullptr;
|
arg[words.size()] = nullptr;
|
||||||
|
|
||||||
int retval = _apps[command](words.size(), (char **)arg);
|
int retval = _apps[command](words.size(), arg);
|
||||||
|
|
||||||
if (retval) {
|
if (retval) {
|
||||||
if (!silently_fail) {
|
if (!silently_fail) {
|
||||||
@@ -118,6 +118,8 @@ int Pxh::process_line(const std::string &line, bool silently_fail)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete[] arg;
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
} else if (command == "help") {
|
} else if (command == "help") {
|
||||||
|
|||||||
Reference in New Issue
Block a user