summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2019-12-04 18:34:07 -0500
committerDavid Pursehouse <dpursehouse@collab.net>2019-12-05 01:02:08 +0000
commit7ac12a9b2296028a2e9fe5eb8a0dcc07c81a630a (patch)
tree6e4cfd9a416de7f654db39688d54e843df2f4114
parent0b304c06ffdf3072fc498683be3e237f9b611a02 (diff)
downloadgit-repo-7ac12a9b2296028a2e9fe5eb8a0dcc07c81a630a.tar.gz
docs: add Windows support info
Change-Id: I82a1bec3a29d622c76b5709b96bbe8bff8aa427f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/247573 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
-rw-r--r--README.md1
-rw-r--r--docs/windows.md144
2 files changed, 145 insertions, 0 deletions
diff --git a/README.md b/README.md
index 316b93a9..5c886359 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ that you can put anywhere in your path.
14* [repo Manifest Format](./docs/manifest-format.md) 14* [repo Manifest Format](./docs/manifest-format.md)
15* [repo Hooks](./docs/repo-hooks.md) 15* [repo Hooks](./docs/repo-hooks.md)
16* [Submitting patches](./SUBMITTING_PATCHES.md) 16* [Submitting patches](./SUBMITTING_PATCHES.md)
17* Running Repo in [Microsoft Windows](./docs/windows.md)
17 18
18## Install 19## Install
19 20
diff --git a/docs/windows.md b/docs/windows.md
new file mode 100644
index 00000000..80912964
--- /dev/null
+++ b/docs/windows.md
@@ -0,0 +1,144 @@
1# Microsoft Windows Details
2
3Repo is primarily developed on Linux with a lot of users on macOS.
4Windows is, unfortunately, not a common platform.
5There is support in repo for Windows, but there might be some rough edges.
6
7Keep in mind that Windows in general is "best effort" and "community supported".
8That means we don't actively test or verify behavior, but rely heavily on users
9to report problems back to us, and to contribute fixes as needed.
10
11[TOC]
12
13## Windows
14
15We only support Windows 10 or newer.
16This is largely due to symlinks not being available in older versions, but it's
17also due to most developers not using Windows.
18
19We will never add code specific to older versions of Windows.
20It might work, but it most likely won't, so please don't bother asking.
21
22## Symlinks
23
24Repo will use symlinks heavily internally.
25On *NIX platforms, this isn't an issue, but Windows makes it a bit difficult.
26
27There are some documents out there for how to do this, but usually the easiest
28answer is to run your shell as an Administrator and invoke repo/git in that.
29
30This isn't a great solution, but Windows doesn't make this easy, so here we are.
31
32### Launch Git Bash
33
34If you install Git Bash (see below), you can launch that with appropriate
35permissions so that all programs "just work".
36
37* Open the Start Menu (i.e. press the ⊞ key).
38* Find/search for "Git Bash".
39* Right click it and select "Run as administrator".
40
41*** note
42**NB**: This environment is only needed when running `repo`, or any specific `git`
43command that might involve symlinks (e.g. `pull` or `checkout`).
44You do not need to run all your commands in here such as your editor.
45***
46
47### Symlinks with GNU tools
48
49If you want to use `ln -s` inside of the default Git/bash shell, you might need
50to export this environment variable:
51```sh
52$ export MSYS="winsymlinks:nativestrict"
53```
54
55Otherwise `ln -s` will copy files and not actually create a symlink.
56This also helps `tar` unpack symlinks, so that's nice.
57
58### References
59
60* https://github.com/git-for-windows/git/wiki/Symbolic-Links
61* https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/
62
63## Python
64
65You should make sure to be running Python 3.6 or newer under Windows.
66Python 2 might work, but due to already limited platform testing, you should
67only run newer Python versions.
68See our [Python Support](./python-support.md) document for more details.
69
70You can grab the latest Windows installer here:<br>
71https://www.python.org/downloads/release/python-3
72
73## Git
74
75You should install the most recent version of Git for Windows:<br>
76https://git-scm.com/download/win
77
78When installing, make sure to turn on "Enable symbolic links" when prompted.
79
80If you've already installed Git for Windows, you can simply download the latest
81installer from above and run it again.
82It should safely upgrade things in situ for you.
83This is useful if you want to switch the symbolic link option after the fact.
84
85## Shell
86
87We don't have a specific requirement for shell environments when running repo.
88Most developers use MinTTY/bash that's included with the Git for Windows install
89(so see above for installing Git).
90
91Command & Powershell & the Windows Terminal probably work.
92Who knows!
93
94## FAQ
95
96### repo upload always complains about allowing hooks or using --no-verify!
97
98When using `repo upload` in projects that have custom repohooks, you might get
99an error like the following:
100```sh
101$ repo upload
102ERROR: You must allow the pre-upload hook or use --no-verify.
103```
104
105This can be confusing as you never get prompted.
106[MinTTY has a bug][mintty] that breaks isatty checking inside of repo which
107causes repo to never interactively prompt the user which means the upload check
108always fails.
109
110You can workaround this by manually granting consent when uploading.
111Simply add the `--verify` option whenever uploading:
112```sh
113$ repo upload --verify
114```
115
116You will have to specify this flag every time you upload.
117
118[mintty]: https://github.com/mintty/mintty/issues/56
119
120### repohooks always fail with an close_fds error.
121
122When using the [reference repohooks project][repohooks] included in AOSP,
123you might see errors like this when running `repo upload`:
124```sh
125$ repo upload
126ERROR: Traceback (most recent call last):
127 ...
128 File "C:\...\lib\subprocess.py", line 351, in __init__
129 raise ValueError("close_fds is not supported on Windows "
130ValueError: close_fds is not supported on Windows platforms if you redirect stdin/stderr/stdout
131
132Failed to run main() for pre-upload hook; see traceback above.
133```
134
135This error shows up when using Python 2.
136You should upgrade to Python 3 instead (see above).
137
138If you already have Python 3 installed, make sure it's the default version.
139Running `python --version` should say `Python 3`, not `Python 2`.
140If you didn't install the Python versions, or don't have permission to change
141the default version, you can probably workaround this by changing `$PATH` in
142your shell so the Python 3 version is found first.
143
144[repohooks]: https://android.googlesource.com/platform/tools/repohooks