Skip to content

Commit 90fcf67

Browse files
committed
new: Add unstable_go toolchain. (#2018)
* Change to vecs. * Add more toolchain configs. * Add locate funcs. * Update warpgate. * Hash input files. * Update deps. * chore: Release * Update deps. * Update changelogs. * Add blog post. * Redo id check. * chore: Release * Update deps. * chore: Release * Add go config docs. * Bump versions.
1 parent 4f88e0d commit 90fcf67

31 files changed

Lines changed: 497 additions & 186 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
with:
111111
auto-install: true
112112
cache: true
113-
proto-version: '0.50.0' # Keep in sync
113+
proto-version: '0.50.1' # Keep in sync
114114
- uses: mozilla-actions/sccache-action@v0.0.7
115115
if: ${{ vars.ENABLE_SCCACHE == 'true' }}
116116
# Fixes issues where proto can't find a version because nothing is pinned globally

CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,25 @@
22

33
## Unreleased
44

5+
#### 💥 Breaking
6+
7+
- WASM API
8+
- Renamed `RegisterToolchainOutput.lock_file_name` to `RegisterToolchainOutput.lock_file_names`
9+
and its type to `Vec<String>`.
10+
- Renamed `RegisterToolchainOutput.manifest_file_name` to
11+
`RegisterToolchainOutput.manifest_file_names` and its type to `Vec<String>`.
12+
513
#### 🚀 Updates
614

15+
- Added a new
16+
[Go toolchain implementation](https://github.com/moonrepo/plugins/tree/master/toolchains/go),
17+
powered entirely by our new WASM plugin system. It can be enabled with the `unstable_go`
18+
identifier.
19+
- Supports tiers 1, 2, and 3!
20+
- Supports Go workspaces via `go.work` files.
21+
- Extracts project dependencies and relationships from `go.mod` files.
22+
- Extracts version and lockfile information from `go.sum` and `go.work.sum` files.
23+
- Basic vendor support (`go mod vendor`) during Docker prune.
724
- Added new tools for `moon mcp`.
825
- `get_touched_files` - Gets touched files between base and head.
926
- `sync_projects` - Runs the `SyncProject` action for one or many projects.
@@ -13,10 +30,27 @@
1330
- View information about a toolchain plugin with `moon toolchain info`.
1431
- Added support for terminal desktop notifications. Can be enabled with the new
1532
`notifier.terminalNotifications` setting in `.moon/workspace.yml`.
33+
- Added a `notifier.webhookAcknowledge` setting, that ensures webhooks resolve with a 2xx status
34+
code.
35+
36+
#### 🐞 Fixes
37+
38+
- Fixed an issue with task output hydration that would sometimes fail with a permission denied error
39+
when cleaning stale files.
40+
41+
#### 🧩 Plugins
42+
43+
- Updated `rust_toolchain` to v0.2.0.
44+
- Cached the globals bin directory when extending task commands/scripts.
45+
- Task hashing now includes the host OS, arch, and libc.
46+
- WASM API
47+
- Added `LocateDependenciesRootInput.toolchain_config` field.
48+
- Added `PruneDockerInput.toolchain_config` field.
49+
- Added `ScaffoldDockerInput.toolchain_config` field.
1650

1751
#### ⚙️ Internal
1852

19-
- Updated proto to [v0.50.0](https://github.com/moonrepo/proto/releases/tag/v0.50.0) (from 0.49.4).
53+
- Updated proto to [v0.50.1](https://github.com/moonrepo/proto/releases/tag/v0.50.0) (from 0.49.4).
2054

2155
## 1.37.3
2256

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ convert_case = "0.8.0"
3636
dirs = "6.0.0"
3737
futures = "0.3.31"
3838
indexmap = "2.9.0"
39-
iocraft = "0.7.9"
39+
iocraft = "0.7.10"
4040
md5 = "0.7.0"
4141
miette = "7.6.0"
4242
pathdiff = "0.2.3"
@@ -100,13 +100,13 @@ uuid = { version = "1.16.0", features = ["v4"] }
100100
# proto/plugin related
101101
extism = "=1.11.1"
102102
extism-pdk = "1.4.1"
103-
proto_core = "0.50.1"
103+
proto_core = "0.50.2"
104104
proto_installer = { version = "0.13.0", features = ["miette"] }
105105
proto_pdk_api = "0.28.0"
106106
proto_pdk_test_utils = "0.38.0"
107107
system_env = "0.8.0"
108108
version_spec = "0.9.1"
109-
warpgate = "0.25.0"
109+
warpgate = "0.25.3"
110110
warpgate_api = "0.15.1"
111111
warpgate_pdk = "0.14.0"
112112

crates/action-graph/src/action_graph_builder.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ impl<'query> ActionGraphBuilder<'query> {
347347

348348
let sync_workspace_index = self.sync_workspace().await?;
349349
let setup_toolchain_index = self.setup_toolchain(spec).await?;
350-
let toolchain = self.app_context.toolchain_registry.load(&spec.id).await?;
350+
let toolchain_registry = &self.app_context.toolchain_registry;
351+
let toolchain = toolchain_registry.load(&spec.id).await?;
351352

352353
// Toolchain does not support this action, so skip and fall through
353354
if !toolchain.supports_tier_2().await {
@@ -356,8 +357,13 @@ impl<'query> ActionGraphBuilder<'query> {
356357

357358
let output = toolchain
358359
.locate_dependencies_root(LocateDependenciesRootInput {
359-
context: self.app_context.toolchain_registry.create_context(),
360+
context: toolchain_registry.create_context(),
360361
starting_dir: toolchain.to_virtual_path(&project.root),
362+
toolchain_config: toolchain_registry.create_merged_config(
363+
&toolchain.id,
364+
&self.app_context.toolchain_config,
365+
&project.config,
366+
),
361367
})
362368
.await?;
363369

crates/action-pipeline/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ moon_toolchain_plugin = { path = "../toolchain-plugin" }
2727
moon_workspace_graph = { path = "../workspace-graph" }
2828
async-trait = { workspace = true }
2929
miette = { workspace = true }
30-
num_cpus = "1.16.0"
30+
num_cpus = "1.17.0"
3131
petgraph = { workspace = true }
3232
rustc-hash = { workspace = true }
3333
serde = { workspace = true }

crates/actions/src/actions/install_dependencies.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,21 @@ async fn create_hash_content<'action>(
253253
}
254254

255255
// Extract lockfile last modification
256-
if let Some(lock_file_name) = &toolchain.metadata.lock_file_name {
256+
for lock_file_name in &toolchain.metadata.lock_file_names {
257257
let lock_path = deps_root.join(lock_file_name);
258258

259259
if lock_path.exists() {
260260
let meta = fs::metadata(&lock_path)?;
261261

262262
if let Ok(timestamp) = meta.modified().or_else(|_| meta.created()) {
263263
content.lockfile_timestamp = Some(to_millis(timestamp));
264+
break;
264265
}
265266
}
266267
}
267268

268269
// Extract dependencies from all applicable manifests
269-
if let Some(manifest_file_name) = &toolchain.metadata.manifest_file_name {
270+
for manifest_file_name in &toolchain.metadata.manifest_file_names {
270271
let has_touched_manifests = action_context
271272
.touched_files
272273
.iter()

crates/app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ clap = { workspace = true, features = [
5252
"wrap_help",
5353
] }
5454
clap_complete = { workspace = true }
55-
clap_complete_nushell = "4.5.6"
55+
clap_complete_nushell = "4.5.7"
5656
clean-path = { workspace = true }
5757
convert_case = { workspace = true }
5858
diff = "0.1.13"

crates/app/src/commands/docker/prune.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ pub async fn prune_toolchains(session: &MoonSession, manifest: &DockerManifest)
4444
|registry, toolchain| LocateDependenciesRootInput {
4545
context: registry.create_context(),
4646
starting_dir: toolchain.to_virtual_path(&project.root),
47+
toolchain_config: registry.create_merged_config(
48+
&toolchain.id,
49+
&session.toolchain_config,
50+
&project.config,
51+
),
4752
},
4853
)
4954
.await?
@@ -99,6 +104,8 @@ pub async fn prune_toolchains(session: &MoonSession, manifest: &DockerManifest)
99104
.map(|project| project.to_fragment())
100105
.collect(),
101106
root: toolchain.to_virtual_path(&instance.deps_root),
107+
toolchain_config: toolchain_registry
108+
.create_config(&toolchain.id, &app_context.toolchain_config),
102109
})
103110
.await?;
104111
}

crates/app/src/commands/docker/scaffold.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ async fn scaffold_workspace_project(
209209
output_dir: toolchain.to_virtual_path(&docker_project_root),
210210
phase: ScaffoldDockerPhase::Configs,
211211
project: project.to_fragment(),
212+
toolchain_config: registry.create_merged_config(
213+
&toolchain.id,
214+
&session.toolchain_config,
215+
&project.config,
216+
),
212217
})
213218
.await?;
214219
}
@@ -362,6 +367,11 @@ async fn scaffold_sources_project(
362367
output_dir: toolchain.to_virtual_path(&docker_project_root),
363368
phase: ScaffoldDockerPhase::Sources,
364369
project: project.to_fragment(),
370+
toolchain_config: registry.create_merged_config(
371+
&toolchain.id,
372+
&session.toolchain_config,
373+
&project.config,
374+
),
365375
})
366376
.await?;
367377
}

0 commit comments

Comments
 (0)