Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions crates/moon/src/watch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,56 +498,6 @@ mod tests {
assert!(result);
}

#[test]
fn rerun_triggered_for_moonlex_input() {
use std::fs;

let temp_dir = tempfile::tempdir().unwrap();
let root = temp_dir.path();
let target_dir = root.join(BUILD_DIR);
std::fs::create_dir_all(&target_dir).unwrap();

let file = root.join("src/main/lexer.mbl");
fs::create_dir_all(file.parent().unwrap()).unwrap();
fs::write(&file, "rule token = parse").unwrap();

let event = build_event(&file);
let result = check_rerun_trigger(
&target_dir,
root,
&[event],
&AdditionalWatchPaths::default(),
)
.unwrap();

assert!(result);
}

#[test]
fn rerun_triggered_for_moonyacc_input() {
use std::fs;

let temp_dir = tempfile::tempdir().unwrap();
let root = temp_dir.path();
let target_dir = root.join(BUILD_DIR);
std::fs::create_dir_all(&target_dir).unwrap();

let file = root.join("src/main/parser.mby");
fs::create_dir_all(file.parent().unwrap()).unwrap();
fs::write(&file, "%%").unwrap();

let event = build_event(&file);
let result = check_rerun_trigger(
&target_dir,
root,
&[event],
&AdditionalWatchPaths::default(),
)
.unwrap();

assert!(result);
}

#[test]
fn rerun_triggered_for_explicitly_watched_prebuild_input() {
use std::fs;
Expand Down
11 changes: 0 additions & 11 deletions crates/moon/src/watch/prebuild_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ pub(crate) fn rr_get_prebuild_watch_paths(env: &ResolveOutput) -> PrebuildWatchP
&pkg.root_path,
);
}

ignored_paths.extend(
pkg.mbt_lex_files
.iter()
.map(|path| path.with_extension("mbt")),
);
ignored_paths.extend(
pkg.mbt_yacc_files
.iter()
.map(|path| path.with_extension("mbt")),
);
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/moon/tests/test_cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ mod native_stub_stability;
mod no_export_when_test;
mod output_format;
mod packages;
mod prebuild;
mod prebuild_config_script;
mod prebuild_link_config_self;
mod query_symbol;
Expand Down Expand Up @@ -2136,7 +2135,7 @@ fn test_exports_in_native_backend() {
}

#[test]
#[ignore = "moonyacc is not updated for a long time, and this test case is broken"]
#[ignore = "known broken test case"]
fn test_diag_loc_map() {
let dir = TestDir::new("diag_loc_map.in");
check(
Expand Down
10 changes: 0 additions & 10 deletions crates/moon/tests/test_cases/prebuild/mod.rs

This file was deleted.

3 changes: 0 additions & 3 deletions crates/moon/tests/test_cases/prebuild/moonlex/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion crates/moon/tests/test_cases/prebuild/moonlex/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions crates/moon/tests/test_cases/prebuild/moonlex/moon.mod.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions crates/moonbuild-rupes-recta/src/build_lower/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ impl<'a> BuildPlanLowerContext<'a> {
BuildPlanNode::BuildRuntimeLib => self.lower_compile_runtime(),
BuildPlanNode::BuildDocs(module_id) => self.lower_build_docs(module_id),
BuildPlanNode::RunPrebuild(pkg, idx) => self.lower_run_prebuild(pkg, idx),
BuildPlanNode::RunMoonLexPrebuild(pkg, idx) => self.lower_moon_lex_prebuild(pkg, idx),
BuildPlanNode::RunMoonYaccPrebuild(pkg, idx) => self.lower_moon_yacc_prebuild(pkg, idx),
};

// Collect n2 inputs and outputs.
Expand Down Expand Up @@ -435,16 +433,6 @@ impl<'a> BuildPlanLowerContext<'a> {
self.opt.target_backend.into(),
));
}
BuildPlanNode::RunMoonLexPrebuild(pkg, idx) => {
let pkg_info = self.packages.get_package(pkg);
let mbtlex_file = &pkg_info.mbt_lex_files[idx as usize];
out.push(mbtlex_file.with_extension("mbt"));
}
BuildPlanNode::RunMoonYaccPrebuild(pkg, idx) => {
let pkg_info = self.packages.get_package(pkg);
let mbtyacc_file = &pkg_info.mbt_yacc_files[idx as usize];
out.push(mbtyacc_file.with_extension("mbt"));
}
}
}

Expand Down
48 changes: 0 additions & 48 deletions crates/moonbuild-rupes-recta/src/build_lower/lower_aux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,52 +279,4 @@ impl<'a> super::BuildPlanLowerContext<'a> {
extra_inputs: info.resolved_inputs.clone(),
}
}

pub(super) fn lower_moon_lex_prebuild(&self, pkg: PackageId, idx: u32) -> BuildCommand {
let pkg = self.packages.get_package(pkg);
let mbtlex_path = pkg
.mbt_lex_files
.get(idx as usize)
.expect("mbt_lex file index out of bounds")
.clone();
let output = mbtlex_path.with_extension("mbt");

let commandline = vec![
moonutil::BINARIES.moonrun.display().to_string(),
moonutil::BINARIES.moonlex.display().to_string(),
"--".into(),
mbtlex_path.display().to_string(),
"-o".into(),
output.display().to_string(),
];

BuildCommand {
commandline: commandline.into(),
extra_inputs: vec![mbtlex_path],
}
}

pub(super) fn lower_moon_yacc_prebuild(&self, pkg: PackageId, idx: u32) -> BuildCommand {
let pkg = self.packages.get_package(pkg);
let mby_path = pkg
.mbt_yacc_files
.get(idx as usize)
.expect("mbt_yacc file index out of bounds")
.clone();
let output = mby_path.with_extension("mbt");

let commandline = vec![
moonutil::BINARIES.moonrun.display().to_string(),
moonutil::BINARIES.moonyacc.display().to_string(),
"--".into(),
mby_path.display().to_string(),
"-o".into(),
output.display().to_string(),
];

BuildCommand {
commandline: commandline.into(),
extra_inputs: vec![mby_path],
}
}
}
46 changes: 1 addition & 45 deletions crates/moonbuild-rupes-recta/src/build_plan/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ impl<'a> BuildPlanConstructor<'a> {
self.add_edge(node, prebuild_node);
}
}
for i in 0..pkg.mbt_lex_files.len() {
let prebuild_node = self.need_node(BuildPlanNode::RunMoonLexPrebuild(pkg_id, i as u32));
self.add_edge(node, prebuild_node);
}
for i in 0..pkg.mbt_yacc_files.len() {
let prebuild_node =
self.need_node(BuildPlanNode::RunMoonYaccPrebuild(pkg_id, i as u32));
self.add_edge(node, prebuild_node);
}
}

fn check_backend_compatibility_for_dep(
Expand Down Expand Up @@ -434,24 +425,10 @@ impl<'a> BuildPlanConstructor<'a> {
})
});

// MAINTAINERS: These predefined prebuild operations that have a fixed
// meaning. If these are not needed in the future, they can be removed.
let mbtlex_iter = pkg
.mbt_lex_files
.iter()
.map(|x| Cow::Owned(x.with_extension("mbt")));
let mbtyacc_iter = pkg
.mbt_yacc_files
.iter()
.map(|x| Cow::Owned(x.with_extension("mbt")));

// Filter source files
let source_files = cond_comp::filter_files(
&pkg.raw,
source_iter
.chain(prebuild_output_iter)
.chain(mbtlex_iter)
.chain(mbtyacc_iter),
source_iter.chain(prebuild_output_iter),
&compile_condition,
);

Expand Down Expand Up @@ -1343,27 +1320,6 @@ impl<'a> BuildPlanConstructor<'a> {
}
v[index as usize] = Some(info);
}

pub(super) fn build_lex_prebuild(
&mut self,
node: BuildPlanNode,
) -> Result<(), BuildPlanConstructError> {
// Not much things to do here, moonlex is straightforward
// the hassle is telling the build system we have the files to compile
self.need_node(node);
self.resolved_node(node);
Ok(())
}

pub(super) fn build_yacc_prebuild(
&mut self,
node: BuildPlanNode,
) -> Result<(), BuildPlanConstructError> {
// similar to lex prebuild
self.need_node(node);
self.resolved_node(node);
Ok(())
}
}

/// Concatenate two optional strings
Expand Down
6 changes: 0 additions & 6 deletions crates/moonbuild-rupes-recta/src/build_plan/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ impl<'a> BuildPlanConstructor<'a> {
node
);
}
BuildPlanNode::RunMoonLexPrebuild(_pkg, _idx) => (),
BuildPlanNode::RunMoonYaccPrebuild(_pkg, _idx) => (),
BuildPlanNode::BuildVirtual(_build_target) => (),
}
}
Expand Down Expand Up @@ -432,10 +430,6 @@ impl<'a> BuildPlanConstructor<'a> {
BuildPlanNode::RunPrebuild(package_id, index) => {
self.build_run_prebuild(node, package_id, index)
}
BuildPlanNode::RunMoonLexPrebuild(_package_id, _index) => self.build_lex_prebuild(node),
BuildPlanNode::RunMoonYaccPrebuild(_package_id, _index) => {
self.build_yacc_prebuild(node)
}
BuildPlanNode::BuildVirtual(target) => self.build_parse_mbti(node, target),
}
}
Expand Down
Loading
Loading