Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Issues
  • #2367
Closed
Open
Issue created Jan 12, 2020 by Administrator@rootContributor

Escaping compiler and linker options causes wrong behaviour

Created by: shybovycha

On OSX the -framework is a valid linker CLI flag, which could be set in Buck with usual cxx_binary / cxx_library rules which, in combination with platform_linker_flags allows to go away from platform-dependent targets.

But due to argument escaping turned on by default, clang complains about unknown arguments:

cxx_binary(
  name = 'main',
  srcs = [ 'main.cpp' ],
  platform_linker_flags = [
    ('macos', [
      '-framework $SDKROOT/System/Library/Frameworks/Cocoa.framework',
    ])
  ],
)

gives

unknown argument: '-framework $SDKROOT/System/Library/Frameworks/Cocoa.framework'

The behaviors defined in buck sources do not consider any way to disable this escaping. I tried getting around this by defining a new option for [cxx] section in .buckconfig, but I could not get my head around com.facebook.buck.cxx.CxxPrepareForLinkStep - simply can't see a good way to pass the option there.

Assignee
Assign to
Time tracking