-
Notifications
You must be signed in to change notification settings - Fork 37
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
Set include and link dirs explicitly for macOS #162
Conversation
env: | ||
CFLAGS: "-Werror -Wall -Wextra" | ||
|
||
- name: Test with tox (system libmaxminddb) | ||
run: tox | ||
if: matrix.platform != 'macos-latest' |
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.
I don't know if its necessarily a better strategy, but one pattern I've used for platform specific github action workarounds is to set environment variables for specific platforms. Something like:
- name: "Work around macos arm64 homebrew directory changes"
if: runner.os == 'macos' and runner.arch = 'arm64'
run: |
echo "CFLAGS=-I/opt/homebrew/include" >> $env:GITHUB_ENV
echo "LDFLAGS=-L/opt/homebrew/lib" >> $env:GITHUB_ENV
- name: Build with Werror and Wall
run: python setup.py build
env:
CFLAGS: "${{ env.CFLAGS }} -Werror -Wall -Wextra"
- name: Test with tox (system libmaxminddb)
run: tox
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 does seem a bit cleaner. I can try doing that.
@@ -44,36 +44,19 @@ jobs: | |||
run: sudo apt install libmaxminddb-dev | |||
if: matrix.platform == 'ubuntu-latest' | |||
|
|||
- name: "Work around macos arm64 homebrew directory changes" | |||
if: runner.os == 'macos' and runner.arch = 'arm64' |
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.
This might have to be macOS
and ARM64
actually
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.
It seems like it worked. 🤷
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.
Yeah I'm confused. I guess the workflow file being invalid doesn't show as a failure? It should be
if: runner.os == 'macOS' && runner.arch == 'ARM64'
See Annotations from https://github.com/maxmind/MaxMind-DB-Reader-python/actions/runs/8897863643
[Invalid workflow file: .github/workflows/test-libmaxminddb.yml#L48](https://github.com/maxmind/MaxMind-DB-Reader-python/actions/runs/8897863643/workflow)
The workflow is not valid. .github/workflows/test-libmaxminddb.yml (Line: 48, Col: 13): Unexpected symbol: 'and'. Located at position 22 within expression: runner.os == 'macos' and runner.arch = 'arm64'
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.
Oh, I would have expected some indication that failed in the build statuses or via email. I'll fix that up.
@@ -44,36 +44,19 @@ jobs: | |||
run: sudo apt install libmaxminddb-dev | |||
if: matrix.platform == 'ubuntu-latest' | |||
|
|||
- name: "Work around macos arm64 homebrew directory changes" | |||
if: runner.os == 'macos' and runner.arch = 'arm64' |
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.
Also runner.arch =
-> runner.arch ==
1d0a322
to
6cd5555
Compare
Hmmm. I found actions/runner-images#9266 (reply in thread) which mentions:
So maybe it does need to be |
6cd5555
to
dea518f
Compare
I am not sure that is the issue. That seems to be running. I thought it might be Edit: actually it was that. I just introduced an unrelated change accidentally. |
dea518f
to
d4406f9
Compare
echo "CFLAGS=-I/opt/homebrew/include" >> "$GITHUB_ENV" | ||
echo "LDFLAGS=-L/opt/homebrew/lib" >> "$GITHUB_ENV" | ||
|
||
- name: Build with Werror and Wall (not macOS) |
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.
The (not macOS)
can be removed
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.
Thanks! I force-pushed it as a single commit to reduce the commit noise.
d4406f9
to
d6da775
Compare
No description provided.