Skip to content

Commit

Permalink
Back out "Back out "Revert D54289470: [redex] Promote redex-staging t…
Browse files Browse the repository at this point in the history
…o redex-stable""

Summary:
Original commit changeset: 6131d6892539

Original Phabricator Diff: D54648671

A summary of issues:
1) Build failures on mac: https://fb.workplace.com/groups/buck2users/permalink/3610890652500623/, https://fb.workplace.com/groups/redex.feedback/posts/7155760447827011
2) Sporadic failures observed at land time and continuous builds via our own reporting: https://fburl.com/scuba/android_redex_failures/k9d8kiqi
3) Perhaps because of #1, I cannot land a speculative change for #2, see D54707997 (https://www.internalfb.com/sandcastle/workflow/4228880050103139544/artifact/actionlog.4228880050147425325.stderr.1?selectedLines=37320-37320-98-98)

Reviewed By: beicy

Differential Revision: D54714856

fbshipit-source-id: 4690b26427ca9bef8a4cbabc313b44fd2445c4fa
  • Loading branch information
wsanville authored and facebook-github-bot committed Mar 11, 2024
1 parent ed6a223 commit f59bb8a
Show file tree
Hide file tree
Showing 526 changed files with 8,396 additions and 13,689 deletions.
21 changes: 6 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,28 +104,19 @@ commands:
# It is OK to generically restore boost, even if it is not used.
- restore_cache:
keys:
- boost-1-71-0-v5
- restore_cache:
keys:
- protobuf3-v3
- boost-1-71-0-v1
- run:
name: Setup
environment:
TOOLCHAIN_TMP: /tmp/toolchain
command: |
sudo -E ./setup_oss_toolchain.sh << parameters.setup_toolchain_extra >>
sudo ./setup_oss_toolchain.sh << parameters.setup_toolchain_extra >>
# Only save the cache when asked, e.g., hopefully when it was populated.
- when:
condition: << parameters.save_boost_cache >>
steps:
- save_cache:
paths:
- /tmp/toolchain/dl_cache/boost_cache
key: boost-1-71-0-v5
- save_cache:
paths:
- /tmp/toolchain/dl_cache/protobuf
key: protobuf3-v3
- boost_cache
key: boost-1-71-0-v1

# For testing, need additional dependencies not provided by the image.

Expand Down Expand Up @@ -387,15 +378,15 @@ jobs:
steps:
- build_debian:
use_sdk: false
save_boost_cache: true

build-20_04:
docker:
- image: circleci/buildpack-deps:focal
# GCC is hungry.
resource_class: large
steps:
- build_debian
- build_debian:
save_boost_cache: true

build-22_04:
docker:
Expand Down
21 changes: 3 additions & 18 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ DISABLED_WARNINGS = \
$(DISABLED_WARNINGS_HARD) \
-Wno-array-bounds \
-Wno-class-memaccess \
-Wno-deprecated-copy \
-Wno-deprecated-declarations \
-Wno-enum-constexpr-conversion \
-Wno-format-truncation \
Expand Down Expand Up @@ -75,16 +74,6 @@ proto_res_header_out = $(addprefix protores/, $(notdir ${proto_res_in:.proto=.pb
proto_res_body_out = $(addprefix protores/, $(notdir ${proto_res_in:.proto=.pb.cc}))
BUILT_SOURCES = $(proto_res_header_out)

proto_cfg_in = \
proto/config.proto

protocfg/%.pb.cc protocfg/%.pb.h: proto/config.proto | mdir ; $(PROTOC) --proto_path=$(dir $^) --cpp_out=$(top_srcdir)/protocfg $^
mdir: ; mkdir -p $(top_srcdir)/protocfg

proto_cfg_header_out = $(addprefix protocfg/, $(notdir ${proto_cfg_in:.proto=.pb.h}))
proto_cfg_body_out = $(addprefix protocfg/, $(notdir ${proto_cfg_in:.proto=.pb.cc}))
BUILT_SOURCES += $(proto_cfg_header_out)

endif

#
Expand Down Expand Up @@ -151,6 +140,7 @@ libredex_la_SOURCES = \
libredex/GlobalConfig.cpp \
libredex/GraphVisualizer.cpp \
libredex/HierarchyUtil.cpp \
libredex/InitCollisionFinder.cpp \
libredex/InitClassesWithSideEffects.cpp \
libredex/InlinerConfig.cpp \
libredex/InstructionLowering.cpp \
Expand Down Expand Up @@ -208,7 +198,6 @@ libredex_la_SOURCES = \
libredex/RedexMappedFile.cpp \
libredex/ReadMaybeMapped.cpp \
libredex/RedexContext.cpp \
libredex/RedexProperties.cpp \
libredex/RedexPropertiesManager.cpp \
libredex/RedexPropertyChecker.cpp \
libredex/RedexPropertyCheckerRegistry.cpp \
Expand All @@ -225,7 +214,6 @@ libredex_la_SOURCES = \
libredex/SourceBlocks.cpp \
libredex/StringTreeSet.cpp \
libredex/Timer.cpp \
libredex/ThreadPool.cpp \
libredex/ThrowPropagationImpl.cpp \
libredex/Trace.cpp \
libredex/Transform.cpp \
Expand Down Expand Up @@ -321,6 +309,7 @@ libredex_la_SOURCES = \
service/shrinker/Shrinker.cpp \
service/switch-dispatch/SwitchDispatch.cpp \
service/switch-partitioning/SwitchEquivFinder.cpp \
service/switch-partitioning/SwitchMethodPartitioning.cpp \
service/type-analysis/GlobalTypeAnalyzer.cpp \
service/type-analysis/LocalTypeAnalyzer.cpp \
service/type-analysis/WholeProgramState.cpp \
Expand All @@ -346,8 +335,7 @@ libredex_la_LIBADD = \
if SET_PROTOBUF
libredex_la_SOURCES += \
protores/Resources.pb.cc \
protores/Configuration.pb.cc \
protocfg/config.pb.cc
protores/Configuration.pb.cc

libredex_la_LIBADD += \
$(LIBPROTOBUF_LIBS)
Expand All @@ -363,7 +351,6 @@ endif

libopt_la_SOURCES = \
checkers/HasSourceBlocksChecker.cpp \
checkers/InitialRenameClassCheker.cpp \
checkers/InjectionIdInstructionsChecker.cpp \
checkers/NoInitClassInstructionsChecker.cpp \
checkers/NoUnreachableInstructionsChecker.cpp \
Expand Down Expand Up @@ -411,7 +398,6 @@ libopt_la_SOURCES = \
opt/int_type_patcher/IntTypePatcher.cpp \
opt/interdex/InterDex.cpp \
opt/interdex/InterDexPass.cpp \
opt/interdex/InterDexReshuffleImpl.cpp \
opt/interdex/InterDexReshufflePass.cpp \
opt/interdex/SortRemainingClassesPass.cpp \
opt/kotlin-lambda/RewriteKotlinSingletonInstance.cpp \
Expand Down Expand Up @@ -499,7 +485,6 @@ libopt_la_SOURCES = \
opt/split_huge_switches/SplitHugeSwitchPass.cpp \
opt/split_resource_tables/SplitResourceTables.cpp \
opt/object-escape-analysis/ExpandableMethodParams.cpp \
opt/object-escape-analysis/ObjectEscapeAnalysisImpl.cpp \
opt/object-escape-analysis/ObjectEscapeAnalysis.cpp \
opt/staticrelo/StaticReloV2.cpp \
opt/string_concatenator/StringConcatenator.cpp \
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-02-27
2023-12-15
13 changes: 7 additions & 6 deletions analysis/ip-reflection-analysis/IPReflectionAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ struct Caller {
using Domain = PatriciaTreeMapAbstractPartition<const DexMethod*,
reflection::CallingContext>;

Domain analyze_edge(const call_graph::EdgeId edge, const Domain& original) {
Domain analyze_edge(const std::shared_ptr<call_graph::Edge>& edge,
const Domain& original) {
auto callee = edge->callee()->method();
if (!callee) {
return Domain::bottom();
Expand Down Expand Up @@ -148,8 +149,8 @@ class ReflectionAnalyzer : public Base {

reflection::SummaryQueryFn query_fn =
[&](const IRInstruction* insn) -> reflection::AbstractObjectDomain {
auto callees =
call_graph::resolve_callees_in_graph(*this->get_call_graph(), insn);
auto callees = call_graph::resolve_callees_in_graph(
*this->get_call_graph(), m_method, insn);

reflection::AbstractObjectDomain ret =
reflection::AbstractObjectDomain::bottom();
Expand Down Expand Up @@ -180,8 +181,8 @@ class ReflectionAnalyzer : public Base {
auto op = insn->opcode();
always_assert(opcode::is_an_invoke(op));

auto callees =
call_graph::resolve_callees_in_graph(*this->get_call_graph(), insn);
auto callees = call_graph::resolve_callees_in_graph(
*this->get_call_graph(), m_method, insn);

for (const DexMethod* method : callees) {
this->get_caller_context()->update(
Expand Down Expand Up @@ -235,7 +236,7 @@ void IPReflectionAnalysisPass::run_pass(DexStoresVector& stores,
AnalysisParameters param;
auto analysis = Analysis(scope, m_max_iteration, &param);
analysis.run();
const auto& summaries = analysis.registry.get_map();
auto summaries = analysis.registry.get_map();
m_result = std::make_shared<Result>();
for (const auto& entry : summaries) {
(*m_result)[entry.first] = entry.second.get_reflection_sites();
Expand Down
4 changes: 3 additions & 1 deletion analysis/ip-reflection-analysis/IPReflectionAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class IPReflectionAnalysisPass : public Pass {
const override {
using namespace redex_properties::interactions;
using namespace redex_properties::names;
return {};
return {
{HasSourceBlocks, Preserves},
};
}

void bind_config() override {
Expand Down
4 changes: 3 additions & 1 deletion analysis/max-depth/MaxDepthAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class MaxDepthAnalysisPass : public Pass {
const override {
using namespace redex_properties::interactions;
using namespace redex_properties::names;
return {};
return {
{HasSourceBlocks, Preserves},
};
}

void bind_config() override { bind("max_iteration", 20U, m_max_iteration); }
Expand Down
38 changes: 0 additions & 38 deletions checkers/InitialRenameClassCheker.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions checkers/InitialRenameClassCheker.h

This file was deleted.

2 changes: 1 addition & 1 deletion checkers/InjectionIdInstructionsChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void InjectionIdInstructionsChecker::run_checker(DexStoresVector& stores,
walk::parallel::opcodes(scope, [&](DexMethod* method, IRInstruction* insn) {
always_assert_log(!opcode::is_injection_id(insn->opcode()),
"[%s] %s contains injection id instruction!\n {%s}",
get_name(get_property()), SHOW(method), SHOW(insn));
get_property_name().c_str(), SHOW(method), SHOW(insn));
});
}

Expand Down
Loading

0 comments on commit f59bb8a

Please sign in to comment.