Граф коммитов

595 Коммитов

Автор SHA1 Сообщение Дата
Ralph Giles 48d925773f Replace Future::boxed with Box::new.
In futures 0.1.15, the boxed() method on Future structs was
deprecated. This returned a BoxFuture type which had to be
declared either Send or 'static while wrapping a Future
in Box::new() allows inference of the appropriate trait bounds.

We already don't use the BoxFuture trait, so just call Box::new()
directly instead to avoid the deprecation warning and make it
easier to port to future releases.

See also https://github.com/alexcrichton/futures-rs/issues/228
2017-10-11 06:19:11 -04:00
Alex Crichton 646be05bc0 Update iovec to fix a soundness hole on Windows
Also update a few other dependencies that transitively needed fixing
2017-10-06 11:47:23 -04:00
Ted Mielczarek df04fa530d (cargo-release) version 0.2.1 2017-08-18 14:42:53 -07:00
Mike Hommey 4457e3efb2 Don't pass a CpuPool to preprocess and compile
They don't need it anymore.
2017-08-18 14:36:19 -07:00
Mike Hommey 05b5d73ddf Don't pass the preprocessor output to the compiler
It doesn't need it anymore.
2017-08-18 14:36:19 -07:00
Mike Hommey 47c08c595c Never compile from the preprocessed output
Increasingly, compilers are integrating with the preprocessor in such a
way that they know some things expanded from the preprocessor don't need
to be warned about. Consequently, this leads to compiling from the
preprocessor output to usually contain a lot of warning noise, that far
outweigh the benefit of compiling from the preprocessor output.

Even worse, in the case of recent GCC, with -fprofile-generate (cached),
this leads to -Wcoverage-mismatch warnings during the -fprofile-use
(not cached) phase.

Also, it has been necessary to implement a "retry" strategy when the
compilation from the preprocessor output fails, and it's not clear we're
not doing that a lot anyways.

As this changes the warnings output, which is part of the cache, we
bump the cache version.
2017-08-18 14:36:19 -07:00
Mike Hommey f027685561 Move the clang compilation tests to gcc
They are really testing the gcc module behavior.
2017-08-18 14:36:19 -07:00
Felix Obenhuber 16d0ef0883 Add a link to the Jenkins notes in README 2017-08-16 14:34:58 -07:00
Ted Mielczarek 210bc79151 Switch S3 storage to use standard storage instead of reduced redundancy. Fixes #167
Amazon updated their S3 pricing recently and now standard storage is now cheaper
than reduced redundancy storage. They're trying to phase out reduced redundancy
and so they didn't bother lowering the RR price. In light of that we should just
use standard storage for sccache cache entries.
2017-08-16 10:48:33 -07:00
Felix Obenhuber 629813f2d2 Add a note about using sccache with Jenkins CI
Running sccache in Jenkins jobs without any virtualization may cause
problems if sccache is not configured properly. This notes tries to
explain this topic and offers two possible solutions for a problem that
occoured in a real world CI setup.
2017-08-16 10:44:42 -07:00
Mike Hommey ee10eae2ea Always pass a -x argument to gcc/clang
First and foremost, to generically convey the type of compilation, we
normalize the file extension, and will use that information to feed
the right -x argument to the preprocessor and compiler.

When the compiler command sccache is invoked with already contains a -x
argument, we set the normalized file extension accordingly, such that
it matches what the caller wants, rather than what the source file
extension says.

On the preprocessor end, we then always pass one of `-x c`, `-x c++`,
`-x objective-c` or `-x objective-c++` according to the normalized file
extension.

On the compiler end, we always pass one of `-x cpp-output`, `-x
c++-cpp-output`, `-x objective-c-cpp-output` or `-x
objective-c++-cpp-output` accordingly.

Note that we used to pass `-x objc-cpp-output` to gcc, but that's a
deprecated form that it now warns about. The new form has been available
since at least gcc 4.3, so is fine to use.

And because a same source compiled as C or C++ will yield different
object code, include the normalized extension when computing the hashed
value.

Fixes #163.
2017-08-16 10:38:52 -07:00
Mike Hommey af8d6b0a32 For C compilers, store the language instead of the input file extension. 2017-08-16 10:38:52 -07:00
Mike Hommey cae21a2421 Refactor compiler argument parsing
Each compiler essentially had its own, rather minimalist, argument handling.
It didn't allow to fully handle the vast breadth of arguments that
compilers can take, and wouldn't allow to find out which arguments are
related to preprocessing, and which aren't. Furthermore, gcc-type
arguments are very lax, and allow things like "-includefile" and
"-include file" to mean the same thing, making things even harder.
And then there's rust, that allows "--emit=dep-info" and "--emit dep-info"
to mean the same thing.

We introduce a new generic API that can handle all sorts of arguments,
based on flat descriptions of the arguments that can be handled, and
proceed with defining more of the arguments that the various compilers
support.

While the argument list for gcc/clang is rather exhaustive, it is still
based on a combination of what ccache handles, and what sccache used to
handle, and might still miss some of the arguments that can take values.

The argument list for msvc is not exhaustive and might need some
improvement. For instance, I haven't actually checked whether some of
the arguments allow non-concatenated forms.
2017-08-16 10:38:52 -07:00
Mike Hommey 57cdb1d597 Add a test case to avoid regressing 37e1826 2017-08-16 10:38:52 -07:00
Adrian Perez de Castro 7b658cf1a7 Support -B argument for GCC
Fixes #126
2017-08-02 06:30:29 -04:00
Mike Hommey a310f6a62e Allow to override the default idle timeout with an environment variable
While the default is reasonable for developers, CI environment may want
to choose larger timeouts, or to disable it entirely.

The new SCCACHE_IDLE_TIMEOUT environment variable allows to pass a value
in seconds for the idle timeout before shutdown, and a value of 0
disables the timeout entirely.
2017-08-02 06:28:00 -04:00
Taylor Cramer 4e9ee4cc5f Revert "Move from openssl to pem-parser for PEM to DER conversion for GCS"
This reverts commit 39fdfd83a8.
2017-08-02 06:25:05 -04:00
Ted Mielczarek 6267caf603 (cargo-release) start next development iteration 0.2.1-pre 2017-07-25 15:47:24 -04:00
Ted Mielczarek 43300e1976 add a version to lru-disk-cache dep 2017-07-25 15:46:09 -04:00
Ted Mielczarek 79137588f3 tweak lru-disk-cache metadata 2017-07-25 15:43:23 -04:00
Ted Mielczarek 5a9009a250 (cargo-release) version 0.2.0 2017-07-25 15:41:17 -04:00
Ted Mielczarek aea73d619d Fix lru-disk-cache tests on Windows 2017-07-25 15:22:32 -04:00
Ted Mielczarek 63cd62913a Use cargo test --all on all builds, add a 1.17 build to AppVeyor 2017-07-25 09:32:42 -04:00
Ted Mielczarek 14b7f2aa4a Fix lru_disk_cache's test_existing_file_too_large to be more reliable,
and also skip the doctests in the vendored lru-cache source, since they
don't work when it's not a standalone crate.
2017-07-25 08:40:54 -04:00
Ted Mielczarek 15587879a6 Vendor my fork of lru-cache. Fixes #152 2017-07-25 08:29:14 -04:00
Mike Hommey 76e6224db0 Treat -include as a preprocessor flag
When the original compiler invocation contains -include, passing the
flag to the compiler invocation for the preprocessed source can lead to
errors because it will cause another pass of the preprocessor (although
arguably, with -x cpp-output, it shouldn't).

Ideally, other flags like -I, -idirafter, etc. should be handled the
same, but there are other issues that should be addressed for those
(as well as -include, but this addresses the most immediate issue)
See https://github.com/mozilla/sccache/issues/117#issuecomment-315569559

Fixes #117
2017-07-25 06:47:31 -04:00
Ralph Giles 5a4ea95202 Merge pull request #149 from glandium/master
Miscellaneous changes
2017-07-13 14:39:17 -07:00
Alex Crichton da8fbdb3b5 Depend on tokio-serde-bincode from crates.io 2017-07-13 11:34:22 -07:00
Mike Hommey a8c1658612 Add duration on more cache debug messages 2017-07-12 21:11:05 +09:00
Mike Hommey f16fe948e3 Add support for Objective C 2017-07-12 21:06:36 +09:00
Mike Hommey 37e1826f28 Favor NotCompilation over CannotCache("multiple input files")
When the compiler is invoked for linkage, the command line usually comes
with multiple input arguments. It's confusing that sccache tells that
something is not cached because of the number of input arguments when it
wouldn't cache anyways because it's not a compilation in the first
place.
2017-07-12 21:02:53 +09:00
Ted Mielczarek 69334a26ba Fix compilation with GCC to properly handle preprocessor arguments when
re-compiling when the first compile fails with -Werror.

People have been seeing this in try pushes where their code is failing to
compile, but instead of getting the compiler error they get a GCC error because
we're passing it bad commandline arguments. We weren't treating -MP as a
preprocessor argument, and we also weren't passing preprocessor arguments
to the compiler when we retry compilation from the source if it fails
with -Werror compiling from the preprocessed source.

This is a regression because we didn't used to retry compilation on failures
with -Werror with gcc, and clang doesn't produce this error in this situation.
2017-07-05 15:24:03 -04:00
Taylor Cramer 39fdfd83a8 Move from openssl to pem-parser for PEM to DER conversion for GCS 2017-06-19 05:54:09 -04:00
Taylor Cramer aa1ec04a28 Cleanup GCS service account key error handling 2017-06-19 05:54:09 -04:00
Taylor Cramer dbdaab1b2b Read GCS service account key on startup 2017-06-19 05:54:09 -04:00
Taylor Cramer bb3eba317d GCS implementation cleanup 2017-06-19 05:54:09 -04:00
Taylor Cramer 9d1cc77c31 Fixup GCS documentation 2017-06-19 05:54:09 -04:00
Taylor Cramer 3da16a7c33 Update README and remove unnecessary flags 2017-06-19 05:54:09 -04:00
Taylor Cramer 17fb0dd018 Make credentials optional 2017-06-19 05:54:09 -04:00
Taylor Cramer 4dc4578a69 Cleanup extra GCS fields 2017-06-19 05:54:09 -04:00
Taylor Cramer afa99ccf6d Implement GCS backend 2017-06-19 05:54:09 -04:00
Ted Mielczarek 7619bd0129 fix update-gecko-manifests script to catch more manifests 2017-06-15 10:16:53 -04:00
Alex Crichton 3ede3446a8 Use hyper-tls from crates.io 2017-06-14 15:30:32 -07:00
Adrian Perez de Castro 90c6a2cfe4 Fix build with --no-default-features --features=redis
The serde_json crate is always needed by src/commands.rs even when
building only with support for Redis, but serde_json would be left
out when the S3 feature is disabled. This make it possible to build
sccache only with Redis support.

Building with S3 disabled trims down a stripped release build from
5.1 MiB down to 4.4 MiB on x86_64.
2017-06-14 12:22:02 -04:00
Andre Parodi c596150045 added some undocumented environment variables for s3 2017-06-14 12:01:32 -04:00
Andre Parodi 132ef5d048 added missing args with values on clang osx 2017-06-14 11:59:21 -04:00
F3real 007391ace2 Clean use of future::ok and error 2017-06-14 11:56:54 -04:00
Alex Crichton ac131fc715 Update dependencies
Notably bring in hyper from crates.io
2017-06-14 08:20:12 -07:00
Tetsuharu OHZEKI c92e0d6325 Update gcc to build sccache with MSVC2017 2017-06-08 19:42:01 -04:00
Ted Mielczarek 3544d1241a Don't pass flags to `wide_char_to_multi_byte`.
The MSDN docs for WideCharToMultiByte say:
"WC_ERR_INVALID_CHARS - ... Note that this flag only applies when CodePage is
specified as CP_UTF8 or 54936 (for Windows Vista and later). It cannot be used
with other code page values."
https://msdn.microsoft.com/en-us/library/windows/desktop/dd374130(v=vs.85).aspx

We're currently getting ERROR_INVALID_FLAGS here. I've also added a test
that -deps works for MSVC which catches this error.
2017-06-08 14:01:33 -04:00