Skip to content

Commit c8dc94d

Browse files
authored
Make sure the .ddev/.downloads directory is available, even on mutagen, fixes ddev#4721 (ddev#4723)
1 parent 1748e9a commit c8dc94d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

docs/content/users/install/performance.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ Mutagen can offer a big performance boost on macOS and Windows. It’s fast and
5151

5252
### Mutagen and User-Generated Uploads
5353

54-
When Mutagen is enabled, DDEV attempts to exclude user-generated files in `upload_dir`—when it exists—from syncing. It does this by using a bind-mount in the generated docker-compose configuration, and excluding the directory from syncing in `.ddev/mutagen/mutagen.yml`. This behavior is automatic and you shouldn’t have to take any action in most cases.
54+
When Mutagen is enabled, DDEV attempts to exclude user-generated files in `upload_dir`—when it exists—from syncing. It does this by using a bind-mount in the generated docker-compose configuration, and excluding the directory from syncing in `.ddev/mutagen/mutagen.yml`.
5555

5656
If you have a non-standard location for user-generated files, like `private/fileadmin` with the deprecated `typo3-secure-web` approach, you should override the project defaults by setting `upload_dir` in `.ddev/config.yaml` and pointing it at the correct directory. This will allow Mutagen to sync correctly.
5757

58+
If you change the `upload_dir` do a `ddev mutagen reset` to let mutagen know about the changed behavior.
59+
5860
### Mutagen Integration Caveats
5961

6062
If you run into an issue with Mutagen, please try to recreate and report it via a [support channel](../support.md)!
@@ -63,6 +65,7 @@ Mutagen can offer a big performance boost on macOS and Windows. It’s fast and
6365

6466
* **It’s not the right choice for every project.**
6567
Filesystem consistency has been excellent with Mutagen, but performance is its specialty. If consistency is your highest priority, then there are reasons to be cautious. Two-way sync is a very difficult computational problem, and problems *may* surface.
68+
* **If you take control of the `mutagen.yml` file and make changes to it, do a `ddev mutagen reset` after making changes.**
6669
* **Avoid file changes when DDEV is stopped.**
6770
If you change files—checking out a different branch, removing a file—while DDEV is stopped, Mutagen has no way to know about it. When you start again, it will get the files that are stored and bring them back to the host. If you *do* change files while DDEV is stopped, run `ddev mutagen reset` before restarting the project so Mutagen only starts with awareness of the host’s file contents.
6871
* **It modestly increases disk usage.**
@@ -137,9 +140,9 @@ Mutagen can offer a big performance boost on macOS and Windows. It’s fast and
137140

138141
### Troubleshooting Mutagen Sync Issues
139142

140-
* Avoid having Mutagen sync large binaries, which can cause `ddev start` to take a long time. The `.tarballs` directory is automatically excluded, so Mutagen will ignore anything you move there. To see what Mutagen is trying to sync, run `ddev mutagen status -l` in another window.
141143
* Please make sure that DDEV projects work *without* Mutagen before troubleshooting it. Run `ddev config --mutagen-enabled=false && ddev restart`.
142144
* Rename your project’s `.ddev/mutagen/mutagen.yml` file to `.ddev/mutagen/mutagen.yml.bak` and run `ddev restart`. This ensures you’ll have a fresh version in case the file has been changed and `#ddev-generated` removed.
145+
* Avoid having Mutagen sync large binaries, which can cause `ddev start` to take a long time. The `.tarballs` directory is automatically excluded, so Mutagen will ignore anything you move there. To see what Mutagen is trying to sync, run `ddev mutagen status -l` in another window.
143146
* `export DDEV_DEBUG=true` will provide more information about what’s going on with Mutagen.
144147
* As of DDEV v1.21.2, DDEV’s Mutagen daemon keeps its data in a DDEV-only `MUTAGEN_DATA_DIRECTORY`, `~/.ddev_mutagen_data_directory`.
145148
* DDEV’s private Mutagen binary is installed in `~/.ddev/bin/mutagen`. You can use all the features of Mutagen with `export MUTAGEN_DATA_DIRECTORY=~/.ddev_mutagen_data_directory` and running the Mutagen binary in `~/.ddev/bin/mutagen`, for example:and `~/.ddev/bin/mutagen daemon stop`.

pkg/ddevapp/config.go

+3
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,9 @@ func PrepDdevDirectory(app *DdevApp) error {
12691269
}
12701270
}
12711271

1272+
// The .downloads directory shouldn't have anything in it to begin with.
1273+
_ = os.RemoveAll(app.GetConfigPath(".downloads"))
1274+
12721275
err = os.MkdirAll(filepath.Join(dir, "web-entrypoint.d"), 0755)
12731276
if err != nil {
12741277
return err

pkg/ddevapp/mutagen_config_assets/mutagen.yml

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ sync:
2020
- "/.tarballs"
2121
- "/.ddev/db_snapshots"
2222
- "/.ddev/.importdb*"
23-
- "/.ddev/.downloads"
2423
- ".DS_Store"
2524
- ".idea"
2625
{{ if .UploadDir }}

0 commit comments

Comments
 (0)