From 54a97f1902d0026acfab5f81d3422afaef00ad57 Mon Sep 17 00:00:00 2001 From: Thomas Jiang Date: Fri, 7 Jan 2022 12:56:23 -0800 Subject: [PATCH] Config/value/define cli options work Summary: Previously, hh_single_compile_cpp would accept the following command line arguments: `-c` for config files `-v` for hdf style cli options `-d` for ini style cli options However, despite accepting these command line arguments, hh_single_compile_cpp didn't do anything with them. Instead, it just accepted them and threw them away, opting to use some default parser and hhbc options instead. This diff changes this behavior. Now these three options are accepted and they are parsed and they actually go on to influence compilation behavior. I'm using Hack Native's rust implementation of options parsing. I've done a preliminary sweep of options usage in the wild using zbgs to determine which variants of flags are used. I can't guarantee perfect accuracy, but good enough I think. Reviewed By: aorenste Differential Revision: D33426218 fbshipit-source-id: 6c0d9a5aa993e593a533678ee9a558cf65a0bb8e --- hphp/hack/src/hackc/compile/compile.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hphp/hack/src/hackc/compile/compile.rs b/hphp/hack/src/hackc/compile/compile.rs index 67df687a4ad..0abcb32a2e2 100644 --- a/hphp/hack/src/hackc/compile/compile.rs +++ b/hphp/hack/src/hackc/compile/compile.rs @@ -70,6 +70,7 @@ bitflags! { } } +// Keep in sync with rust_compile_ffi_bridge.rs bitflags! { pub struct HHBCFlags: u32 { const LTR_ASSIGN=1 << 0; @@ -91,7 +92,7 @@ bitflags! { } } -// Mapping must match getParserFlags() in runtime-option.cpp +// Mapping must match getParserFlags() in runtime-option.cpp and rust_compile_ffi_bridge.rs bitflags! { pub struct ParserFlags: u32 { const ABSTRACT_STATIC_PROPS=1 << 0; -- 2.11.4.GIT