Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:12:48+00:00 2026-06-11T15:12:48+00:00

I have a Rebar-based Erlang application that builds a port program. This port program

  • 0

I have a Rebar-based Erlang application that builds a port program. This port program is Linux-specific, so compilation fails on Mac OS. However, I’d like Rebar to just skip the port program when building on Mac OS. How can I do that?

The current spec in rebar.config looks like this:

{port_specs, [{"priv/my_port", ["c_src/foo.c", "c_src/bar.c"]}]}.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:12:49+00:00Added an answer on June 11, 2026 at 3:12 pm

    As documented in comments in rebar_port_compiler.erl, the list elements for port_specs have an alternative form {ArchRegex, TargetFile, Sources}. So write your Rebar configuration like this:

    {port_specs, [{"linux", "priv/my_port", ["c_src/foo.c", "c_src/bar.c"]}]}.
    

    “What is that regex matched against?”, you might ask. It is matched against the return value of rebar_utils:get_arch, which consists of the following parts, separated by hyphens:

    • The OTP release as returned by erlang:system_info(otp_release), e.g. "R15B02"
    • The system architecture as returned by erlang:system_info(system_architecture). For Unix-like systems, this is the CPU-vendor-OS triplet determined by the configure script, e.g. "i386-apple-darwin10.8.0" or "x86_64-unknown-linux-gnu".
    • The emulator word size, 32 or 64, based on the return value of erlang:system_info({wordsize, external}).
    • The OS family, unix or win32. (The first element of the tuple returned by os:type/0)

    So the end result will be something like "R15B01-i386-apple-darwin10.8.0-32-unix" or "R15B02-x86_64-unknown-linux-gnu-64-unix".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird problem building a release of an erlang application that I'm
I have a rebar.config that contains this deps entry: {cowboy, .*, {git, http://github.com/extend/cowboy.git, {branch,
When I'm testing my erlang application on localhost, I have a script that starts
I have a program that gets the FOV angle of the device's rear-facing camera,
I am trying to organize my program into functions and have ran into this,
I'm attempting to understand how to build a multiple-application Erlang OTP release using Rebar.
I have an application that I have taking a picture, and then it is
I have an Erlang code file which is not an OTP application. I do
I have a Rebar project with a top-level release directory that just includes the
have written this little class, which generates a UUID every time an object of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.