-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix all tests on windows #56
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On windows a path cannot be represented as a file:// URL because of the backslashes and colons in the file name. This causes all of the tests which rely on git to fail on windows. This commit changes the representation of the location of a package to be an enum, Location, with two variants: Remote and Local. When parsing Cargo.toml, all locations which begin with the string "file:" have that prefix stripped and are then interpreted as Local packages. Everything else is parsed as a URL and used as a Remote package.
The windows terminal does not use terminfo and is much different, so these tests will fail on windows or actually write to the console.
Apparently git checkouts have objects in the database with permissions 444 which need to be changed to something with a write permission before removal.
This is the same as the libstd Command builder, and will soon be used in the tests for spawning processes on windows.
* Add a convenience method bin() for generating the name of a binary. On windows this remembers to append `.exe`. * Stop executing relative paths to binaries and relying on PATH. This is suffering from rust-lang/rust#15149 and failing to spawn processes on windows. Additionally, this allows the tests to work with a pre-installed cargo becuase the freshly built executables are precisely specified. * A new function, escape_path(), was added for tests. When generated source files with paths, this function needs to be called to properly escape the \-character that appears in windows path names. Without this function we would be generating invalid TOML and rust.
Windows occasionally has \r\n while everywhere else has \n. Instead of worrying about the difference, just replace all instances of \r with nothing and rely on matching against \n.
alexcrichton
pushed a commit
to alexcrichton/cargo
that referenced
this pull request
Sep 2, 2014
Fix all tests on windows
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This brings cargo up to date in all aspects with respect to windows.
The commits have all the nitty-gritty details. There were two assumptions which ended up having far reaching impact:
file://
urls could be used for local git repos. This was too difficult with\
characters in filenames.Closes #32