Commit f285c19
Stop
Summary:
`--dry-run` is documented as "Show build plan without building". It did two
things to disk before showing anything.
**`--clean` ran first.** `main()` handles `--clean` at the point where the
directory manager is created, which is above the `--dry-run` early return. So
`--dry-run --clean` — a natural thing to type when you want to see what a clean
rebuild would do — called `DirectoryManager.clean_all()` and `rmtree`d every
fetched source and every build tree, then printed the plan and exited without
rebuilding any of it. The next real build re-clones all 23 repositories.
**The directory manager created its tree in `__init__`.** Constructing it
mkdir'd `install/`, `source/` and `build/`, so a dry run in any directory left
an `ocean_3rdparty/` skeleton behind — including when the plan it printed was
for a `--output-dir` the user was only evaluating.
`--clean` is now skipped under `--dry-run` with a line saying what it would
have deleted, and `DirectoryManager` takes `create=False` so it resolves paths
without creating them.
Found by an exhaustive review of `build/python/`; tracked as `OB-038`.
___
Differential Revision: D116053695
fbshipit-source-id: 498aba375d891af9b1d312577c25c3e990bedc3f--dry-run from touching the filesystem1 parent a8042c8 commit f285c19
2 files changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1899 | 1899 | | |
1900 | 1900 | | |
1901 | 1901 | | |
| 1902 | + | |
1902 | 1903 | | |
1903 | 1904 | | |
1904 | 1905 | | |
1905 | 1906 | | |
1906 | 1907 | | |
1907 | 1908 | | |
1908 | | - | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
1909 | 1912 | | |
1910 | | - | |
1911 | | - | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
1912 | 1918 | | |
1913 | 1919 | | |
1914 | 1920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
| |||
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
140 | | - | |
141 | | - | |
142 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
0 commit comments