Skip to content

Commit c09b370

Browse files
committed
chore: sync files from source repo
1 parent 9952d95 commit c09b370

15 files changed

Lines changed: 83 additions & 44 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
[1.42.4](https://github.com/casey/just/releases/tag/1.42.4) - 2025-07-24
5+
------------------------------------------------------------------------
6+
7+
### Fixed
8+
- Run imported recipes in correct scope ([#2835](https://github.com/casey/just/pull/2835) by [casey](https://github.com/casey))
9+
- Fix alias doc comment ([#2833](https://github.com/casey/just/pull/2833) by [casey](https://github.com/casey))
10+
411
[1.42.3](https://github.com/casey/just/releases/tag/1.42.3) - 2025-07-18
512
------------------------------------------------------------------------
613

Cargo.lock

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "just"
3-
version = "1.42.3"
3+
version = "1.42.4"
44
authors = ["Casey Rodarmor <casey@rodarmor.com>"]
55
autotests = false
66
categories = ["command-line-utilities", "development-tools"]

src/alias.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) struct Alias<'src, T = Arc<Recipe<'src>>> {
1414

1515
impl<'src> Alias<'src, Namepath<'src>> {
1616
pub(crate) fn resolve(self, target: Arc<Recipe<'src>>) -> Alias<'src> {
17-
assert!(self.target.last().lexeme() == target.namepath.last().lexeme());
17+
assert!(self.target.last().lexeme() == target.name());
1818

1919
Alias {
2020
attributes: self.attributes,

src/analyzer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ impl<'run, 'src> Analyzer<'run, 'src> {
147147

148148
let recipes = RecipeResolver::resolve_recipes(
149149
&assignments,
150+
&ast.module_path,
150151
&self.modules,
151152
&settings,
152153
deduplicated_recipes,

src/compiler.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ impl Compiler {
1616
stack.push(Source::root(root));
1717

1818
while let Some(current) = stack.pop() {
19+
if paths.contains_key(&current.path) {
20+
continue;
21+
}
22+
1923
let (relative, src) = loader.load(root, &current.path)?;
2024
loaded.push(relative.into());
25+
2126
let tokens = Lexer::lex(relative, src)?;
2227
let mut ast = Parser::parse(
2328
current.file_depth,

src/justfile.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,12 @@ impl<'src> Justfile<'src> {
303303
config: &Config,
304304
dotenv: &BTreeMap<String, String>,
305305
is_dependency: bool,
306-
ran: &Ran<'src>,
306+
ran: &Ran,
307307
recipe: &Recipe<'src>,
308308
scopes: &BTreeMap<String, (&Justfile<'src>, &Scope<'src, '_>)>,
309309
search: &Search,
310310
) -> RunResult<'src> {
311-
let mutex = ran.mutex(&recipe.namepath, arguments);
311+
let mutex = ran.mutex(recipe, arguments);
312312

313313
let mut guard = mutex.lock().unwrap();
314314

@@ -323,7 +323,7 @@ impl<'src> Justfile<'src> {
323323
}
324324

325325
let (module, scope) = scopes
326-
.get(&recipe.module_path())
326+
.get(recipe.module_path())
327327
.expect("failed to retrieve scope for module");
328328

329329
let context = ExecutionContext {
@@ -382,7 +382,7 @@ impl<'src> Justfile<'src> {
382382
dependencies: &[Dependency<'src>],
383383
dotenv: &BTreeMap<String, String>,
384384
evaluator: &mut Evaluator<'src, 'run>,
385-
ran: &Ran<'src>,
385+
ran: &Ran,
386386
recipe: &Recipe<'src>,
387387
scopes: &BTreeMap<String, (&Justfile<'src>, &Scope<'src, 'run>)>,
388388
search: &Search,

src/namepath.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ impl<'src> Namepath<'src> {
88
Self(self.0.iter().copied().chain(iter::once(name)).collect())
99
}
1010

11-
pub(crate) fn spaced(&self) -> ModulePath {
12-
ModulePath {
13-
path: self.0.iter().map(|name| name.lexeme().into()).collect(),
14-
spaced: true,
15-
}
16-
}
17-
1811
pub(crate) fn push(&mut self, name: Name<'src>) {
1912
self.0.push(name);
2013
}

src/parser.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,9 +1013,7 @@ impl<'run, 'src> Parser<'run, 'src> {
10131013
file_depth: self.file_depth,
10141014
import_offsets: self.import_offsets.clone(),
10151015
name,
1016-
namepath: self
1017-
.module_namepath
1018-
.map_or_else(|| name.into(), |module_namepath| module_namepath.join(name)),
1016+
namepath: None,
10191017
parameters: positional.into_iter().chain(variadic).collect(),
10201018
priors,
10211019
private,

src/ran.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
use super::*;
22

33
#[derive(Default)]
4-
pub(crate) struct Ran<'src>(
5-
Mutex<BTreeMap<Namepath<'src>, BTreeMap<Vec<String>, Arc<Mutex<bool>>>>>,
6-
);
4+
pub(crate) struct Ran(Mutex<BTreeMap<String, BTreeMap<Vec<String>, Arc<Mutex<bool>>>>>);
75

8-
impl<'src> Ran<'src> {
9-
pub(crate) fn mutex(&self, recipe: &Namepath<'src>, arguments: &[String]) -> Arc<Mutex<bool>> {
6+
impl Ran {
7+
pub(crate) fn mutex(&self, recipe: &Recipe, arguments: &[String]) -> Arc<Mutex<bool>> {
108
self
119
.0
1210
.lock()
1311
.unwrap()
14-
.entry(recipe.clone())
12+
.entry(recipe.namepath().into())
1513
.or_default()
1614
.entry(arguments.into())
1715
.or_default()

0 commit comments

Comments
 (0)