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
  • #2436
Closed
Open
Issue created Apr 06, 2020 by Administrator@rootContributor

Lua standalone won't build after switching between packaged formats

Created by: v-jizhang

with starter_type = native and native_link_strategy = merged, switching between packaging does not work. Repro steps: $cat BUCK

lua_binary(
    name = "simple",
    main_module = "simple",
    deps = [
        ":simple-lib",
    ],
)

lua_library(
    name = "simple-lib",
    srcs = [
        "simple.lua",
    ],
)

python_binary(
    name = "packager",
    main_module = "packager",
    deps = [
        ":lib-packager",
    ],
)

python_library(
    name = "lib-packager",
    srcs = [
        "packager.py",
    ],
)

$cat .buckconfig

[lua]
  starter_type = native
  native_link_strategy = merged

$cat packager.py

import json
import optparse
import shutil
import sys


def main(argv):
    parser = optparse.OptionParser()
    parser.add_option("--entry-point")
    parser.add_option("--interpreter")
    options, args = parser.parse_args(argv[1:])

    with open(args[0], "w") as f:
        shutil.copyfileobj(sys.stdin, f)


sys.exit(main(sys.argv))

$touch simple.lua

  • Run an inital build using the standalone packaging style buck build --show-outputs -c lua.package_style=standalone -c lua.packager=//:packager //:simple

  • Now rebuild with just changing to an in-place packaging style buck build --show-outputs -c lua.package_style=inplace //:simple

  • Now rebuild again, switching back to in-place, and verify the output matches the original build's output. (Actual, the build seems successful but no output generated) buck build --show-outputs -c lua.package_style=standalone -c lua.packager=//:packager //:simple

Assignee
Assign to
Time tracking