Commit Graph

130 Commits

Author SHA1 Message Date
Joel Rosdahl
530dfe7c11 Format code to use a more consistent coding style 2010-08-01 17:20:33 +02:00
Joel Rosdahl
7daab1e4c2 Use lock files instead of POSIX locks when writing stats files
When writing a stats file, locking is now done by atomically creating a
symlink with lockfile_acquire() instead of locking with fcntl(). Updating
of the stats file while holding the lock is done using the
rename-into-place idiom since the lock may be intentionally broken by
another process, and if that happens, there should be no file corruption,
only lost information.

The major reason for the change is to be more robust against badly
implemented or configured network filesystems (e.g. NFS) where POSIX locks
may be broken in different ways.
2010-08-01 17:20:33 +02:00
Joel Rosdahl
852228dea5 Implement file locking primitives
Windows support is not yet done.
2010-08-01 17:20:33 +02:00
Joel Rosdahl
ff2a6f1b3a Add x_readlink() utility function 2010-08-01 17:20:33 +02:00
Joel Rosdahl
a98cbbc465 Introduce and use function-like macros str_eq() and str_startswith() 2010-08-01 17:20:15 +02:00
Joel Rosdahl
2538f20aab Introduce cc_reset(), enabling the test suite to reset global state 2010-08-01 17:20:15 +02:00
Joel Rosdahl
0ea9d9e0a3 Introduce x_rename(), which unlink()s destination if necessary before rename() 2010-07-21 15:15:42 +02:00
Joel Rosdahl
a9b2f164ff Add comments about which files declarations in ccache.h belong to 2010-07-18 14:10:29 +02:00
Joel Rosdahl
187817a707 Remove now unused x_asprintf() 2010-07-17 23:06:19 +02:00
Joel Rosdahl
8005f7a243 Add a function that formats a string in a handier way than x_asprintf 2010-07-17 22:51:29 +02:00
Joel Rosdahl
4e07d0ea7d Implement args_extend function 2010-07-17 18:49:12 +02:00
Joel Rosdahl
ca8330398f Get rid of the ARGS typedef; use struct args explicitly 2010-07-17 18:31:56 +02:00
Ramiro Polla
4d7b4810bd Win32 support 2010-07-16 16:56:43 -03:00
Ramiro Polla
3a442eb97b Implement is_full_path() helper function 2010-07-16 16:54:14 -03:00
Joel Rosdahl
8809f726ab Merge branch 'unittest'
* unittest:
  Regenerate test/suites.h on Makefile updates
  Add CHECK macros for ARGS
  Improve CHECK_{STR,UNS,INT}_EQ macros
  Let basedir("foo") return "."
  Add framework for tests written in C
  Split the main function into a separate compilation unit
  Simplify getopt_long() usage
  Add args_init_from_string function
  Add stats_get_pending() function
  Include all dependency files in .deps to make it work with sources in subdirs

Conflicts:
	configure.ac
2010-07-16 17:08:15 +02:00
Joel Rosdahl
2bacab3f92 Use semicolon as the CCACHE_EXTRAFILES path separator on Windows 2010-07-16 16:56:48 +02:00
Ramiro Polla
f38e9f397a Add a define for path delimiter 2010-07-16 16:19:54 +02:00
Ramiro Polla
6014657219 Implement compare_executable_name() helper function 2010-07-16 16:03:00 +02:00
Ramiro Polla
82b7876473 Implement is_absolute_path() helper function 2010-07-16 16:01:02 +02:00
Ramiro Polla
1fc590556f Introduce and use x_fmmap() and x_munmap()
x_fmmap() opens, stats, and mmap()s a file. x_munmap() is currently just a
wrapper around munmap().
2010-07-16 15:45:52 +02:00
Joel Rosdahl
033d21e329 Add CHECK macros for ARGS 2010-07-16 14:40:21 +02:00
Joel Rosdahl
d674630d24 Add args_init_from_string function 2010-07-15 19:20:33 +02:00
Joel Rosdahl
117e0c6e3a Add stats_get_pending() function 2010-07-15 19:20:33 +02:00
Joel Rosdahl
a417ea68b2 Add exit functions functionality 2010-07-14 18:59:06 +02:00
Joel Rosdahl
fdad44c641 Let stats_update() update counters in memory and stats_flush() write to disk 2010-07-14 15:57:57 +02:00
Joel Rosdahl
62511a1d5f Rename process_args to cc_process_args and let it return failure status 2010-07-14 14:12:00 +02:00
Joel Rosdahl
342dae0d59 Include git revision info in version number 2010-06-09 21:10:03 +02:00
Joel Rosdahl
7acf0db7ab Count actual cache size and number of files again 2010-06-08 23:12:24 +02:00
Joel Rosdahl
ba0be15954 Rename "not a C/C++ file" counter to "unsupported source language" 2010-06-03 22:07:39 +02:00
Joel Rosdahl
2d3de36d24 Add args_copy function 2010-06-02 23:28:36 +02:00
Joel Rosdahl
dd153c944a Fix handling of -finput-charset when CCACHE_CPP2 is in effect 2010-06-02 20:25:36 +02:00
Joel Rosdahl
eb5d9bd3be Add some opt-in sloppiness 2010-05-17 22:29:42 +02:00
Joel Rosdahl
1737ec889f Refactor log functions yet some 2010-05-10 21:37:19 +02:00
Joel Rosdahl
4795f6e3de Improve log initialization 2010-05-10 18:30:17 +02:00
Joel Rosdahl
247f619565 Dont' crash when logging is disabled 2010-05-09 23:23:43 +02:00
Joel Rosdahl
862e729f07 Log executed commands 2010-05-09 22:51:16 +02:00
Joel Rosdahl
2c0d4095ad Introduce cc_log_no_newline function 2010-05-09 22:43:04 +02:00
Joel Rosdahl
39f48df93b Extract print_command function from print_executed_command 2010-05-09 22:19:22 +02:00
Joel Rosdahl
c609b16cc0 Rename temporary object file to cached object file if possible
This avoids copying the object file unnecessarily in the common case when we
store object files uncompressed in the cache.
2010-05-09 17:50:20 +02:00
Wilson Snyder
45b4932efb Show hostname and CWD in logfile 2010-05-09 13:18:38 +02:00
Joel Rosdahl
11a8b1439a Add a type parameter to hash_delimiter to tag hashed information 2010-05-05 22:16:28 +02:00
Joel Rosdahl
609fb3417f Add CCACHE_EXTRAFILES feature 2010-04-28 22:30:55 +02:00
Joel Rosdahl
025e2a58a9 Hash a delimiter string between parts to separate them
Previously, "gcc -I-O2 -c file.c" and "gcc -I -O2 -c file.c" would hash to the
same sum.
2010-04-27 18:19:51 +02:00
Joel Rosdahl
6331376531 Let hash_buffer take a void* to avoid some casting 2010-04-27 08:18:16 +02:00
Joel Rosdahl
b6f5348a50 Merge branch 'cleanup' of git://github.com/krajaratnam/ccache 2010-03-28 17:46:11 +02:00
Joel Rosdahl
9a9f5b1736 Add CCACHE_VERBOSE option
This was suggested by William S Fulton, who implemented this feature in his
SWIG port of ccache.
2010-03-28 17:44:25 +02:00
Kovarththanan Rajaratnam
cfb3b58f5c Make format_file_hash public by moving it to util.c (as format_hash_as_string) 2010-03-18 12:59:24 +01:00
Joel Rosdahl
8dab83c28a Change next version to 3.0pre1 2010-02-28 21:54:21 +01:00
Joel Rosdahl
d36c70046a Add a get_extension utility function 2010-02-28 18:23:07 +01:00
Joel Rosdahl
cff73fff68 Rename str_basename() to basename() 2010-02-28 16:30:08 +01:00