Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 5 additions & 2 deletions .github/workflows/compile_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,52 @@

jobs:
build:
runs-on: macos-latest
runs-on: macos-14
strategy:
matrix:
config: [
px4_fmu-v5_default,
px4_sitl
]
steps:
- name: install Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- uses: actions/checkout@v4

- name: setup
run: ./Tools/setup/macos.sh; ./Tools/setup/macos.sh
run: |
./Tools/setup/macos.sh

- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")

- name: ccache cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: macos_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: macos_${{matrix.config}}-ccache-

- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 40M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
ccache -s
ccache -z

- name: make ${{matrix.config}}
run: |
ccache -z
make ${{matrix.config}}
ccache -s

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
2 changes: 2 additions & 0 deletions Tools/setup/macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ else
echo "Installing PX4 general dependencies (homebrew px4-dev)"
brew tap PX4/px4
brew install px4-dev
# lock down gcc to v9 for v1.16 branch
brew install gcc-arm-none-eabi
brew install ncurses
brew install python-tk
fi
Expand Down
6 changes: 4 additions & 2 deletions platforms/posix/src/px4/common/px4_daemon/pxh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
// 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) {
arg[i] = (char *)words[i].c_str();
Expand All @@ -110,14 +110,16 @@ int Pxh::process_line(const std::string &line, bool silently_fail)
// Explicitly set this nullptr.
arg[words.size()] = nullptr;

int retval = _apps[command](words.size(), (char **)arg);
int retval = _apps[command](words.size(), arg);

if (retval) {
if (!silently_fail) {
printf("Command '%s' failed, returned %d.\n", command.c_str(), retval);
}
}

delete[] arg;

return retval;

} else if (command == "help") {
Expand Down
Loading