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