mapbox / mapbox/mason

Android compile flags leaking into dependencies

Open
#392 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
258
Forks
68
PR merge metrics
No merged PRs in 30d

Description

I wasn't sure how to name this one.

Environment: Compiling Android libraries on OSX

harfbuzz 1.4.4-ft has a dependency on ragel-6.9 on the HOST system.

CXXFLAGS and such are exported in the main mason.sh file. They retain their values when we begin compiling the dependency in mason_prepare_compile.

The android specific compile flags are being sent through as I try to compile ragel for OSX, which causes configure to fail.

I think there's also going to be a future issue here; any changes made to CXXFLAGS while building the dependencies will pollute the original library.

Having this be the order of events might fix it
mason_prepare_compile
export CXXFLAGS=...
mason_compile

If mason_prepare_compile needs those flags in some cases, maybe dependency resolution needs to be an explicit step beforehand.
mason_prepare_dependencies
export CXXFLAGS=...
mason_prepare_compile
mason_compile

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mason.sh at mason_prepare_compile and trace how the harfbuzz dependency invokes ragel-6.9 on the host. Reproduce the Android library build on OSX, then verify that host dependencies do not receive Android-specific flags and that dependency changes do not leak into the original library build.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cpp, macos
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.