mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 15:31:28 +00:00
remove hardly used TimeMachine feature
This commit is contained in:
@@ -31,7 +31,6 @@ import
|
||||
|
||||
# but some have deps to imported modules. Yay.
|
||||
bootSwitch(usedTinyC, hasTinyCBackend, "-d:tinyc")
|
||||
bootSwitch(usedAvoidTimeMachine, noTimeMachine, "-d:avoidTimeMachine")
|
||||
bootSwitch(usedNativeStacktrace,
|
||||
defined(nativeStackTrace) and nativeStackTraceSupported,
|
||||
"-d:nativeStackTrace")
|
||||
@@ -106,7 +105,7 @@ proc writeVersionInfo(pass: TCmdLinePass) =
|
||||
when gitHash.len == 40:
|
||||
msgWriteln("git hash: " & gitHash, {msgStdout})
|
||||
|
||||
msgWriteln("active boot switches:" & usedRelease & usedAvoidTimeMachine &
|
||||
msgWriteln("active boot switches:" & usedRelease &
|
||||
usedTinyC & usedGnuReadline & usedNativeStacktrace & usedNoCaas &
|
||||
usedFFI & usedBoehm & usedMarkAndSweep & usedGenerational & usedGoGC & usedNoGC,
|
||||
{msgStdout})
|
||||
|
||||
@@ -17,7 +17,6 @@ const
|
||||
hasFFI* = defined(useFFI)
|
||||
newScopeForIf* = true
|
||||
useCaas* = not defined(noCaas)
|
||||
noTimeMachine* = defined(avoidTimeMachine) and defined(macosx)
|
||||
copyrightYear* = "2018"
|
||||
|
||||
type # please make sure we have under 32 options
|
||||
@@ -329,28 +328,6 @@ proc toGeneratedFile*(path, ext: string): string =
|
||||
result = joinPath([getNimcacheDir(), changeFileExt(tail, ext)])
|
||||
#echo "toGeneratedFile(", path, ", ", ext, ") = ", result
|
||||
|
||||
when noTimeMachine:
|
||||
var alreadyExcludedDirs = initSet[string]()
|
||||
proc excludeDirFromTimeMachine(dir: string) {.raises: [].} =
|
||||
## Calls a macosx command on the directory to exclude it from backups.
|
||||
##
|
||||
## The macosx tmutil command is invoked to mark the specified path as an
|
||||
## item to be excluded from time machine backups. If a path already exists
|
||||
## with files before excluding it, newer files won't be added to the
|
||||
## directory, but previous files won't be removed from the backup until the
|
||||
## user deletes that directory.
|
||||
##
|
||||
## The whole proc is optional and will ignore all kinds of errors. The only
|
||||
## way to be sure that it works is to call ``tmutil isexcluded path``.
|
||||
if alreadyExcludedDirs.contains(dir): return
|
||||
alreadyExcludedDirs.incl(dir)
|
||||
try:
|
||||
var p = startProcess("/usr/bin/tmutil", args = ["addexclusion", dir])
|
||||
discard p.waitForExit
|
||||
p.close
|
||||
except Exception:
|
||||
discard
|
||||
|
||||
proc completeGeneratedFilePath*(f: string, createSubDir: bool = true): string =
|
||||
var (head, tail) = splitPath(f)
|
||||
#if len(head) > 0: head = removeTrailingDirSep(shortenDir(head & dirSep))
|
||||
@@ -358,8 +335,6 @@ proc completeGeneratedFilePath*(f: string, createSubDir: bool = true): string =
|
||||
if createSubDir:
|
||||
try:
|
||||
createDir(subdir)
|
||||
when noTimeMachine:
|
||||
excludeDirFromTimeMachine(subdir)
|
||||
except OSError:
|
||||
writeLine(stdout, "cannot create directory: " & subdir)
|
||||
quit(1)
|
||||
|
||||
33
doc/koch.rst
33
doc/koch.rst
@@ -35,32 +35,8 @@ options:
|
||||
By default a debug version is created, passing this option will
|
||||
force a release build, which is much faster and should be preferred
|
||||
unless you are debugging the compiler.
|
||||
-d:useGnuReadline
|
||||
Includes the `rdstdin module <rdstdin.html>`_ for `interactive
|
||||
mode <nimc.html#nim-interactive-mode>`_ (aka ``nim i``).
|
||||
This is not needed on Windows. On other platforms this may
|
||||
incorporate the GNU readline library.
|
||||
-d:nativeStacktrace
|
||||
Use native stack traces (only for Mac OS X or Linux).
|
||||
-d:avoidTimeMachine
|
||||
Only for Mac OS X, activating this switch will force excluding
|
||||
the generated ``nimcache`` directories from Time Machine backups.
|
||||
By default ``nimcache`` directories will be included in backups,
|
||||
and just for the Nim compiler itself it means backing up 20MB
|
||||
of generated files each time you update the compiler. Using this
|
||||
option will make the compiler invoke the `tmutil
|
||||
<https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/tmutil.8.html>`_
|
||||
command on all ``nimcache`` directories, setting their backup
|
||||
exclusion bit.
|
||||
|
||||
You can use the following command to locate all ``nimcache``
|
||||
directories and check their backup exclusion bit::
|
||||
|
||||
$ find . -type d -name nimcache -exec tmutil isexcluded \{\} \;
|
||||
--gc:refc|v2|markAndSweep|boehm|go|none
|
||||
Selects which garbage collection strategy to use for the compiler
|
||||
and generated code. See the `Nim's Garbage Collector <gc.html>`_
|
||||
documentation for more information.
|
||||
-d:useLinenoise
|
||||
Use the linenoise library for interactive mode (not needed on Windows).
|
||||
|
||||
After compilation is finished you will hopefully end up with the nim
|
||||
compiler in the ``bin`` directory. You can add Nim's ``bin`` directory to
|
||||
@@ -104,8 +80,3 @@ be rerun in serial fashion so that meaninful error output can be gathered for
|
||||
inspection. The ``--parallelBuild:n`` switch or configuration option can be
|
||||
used to force a specific number of parallel jobs or run everything serially
|
||||
from the start (``n == 1``).
|
||||
|
||||
zip command
|
||||
-----------
|
||||
|
||||
The `zip`:idx: command builds the installation ZIP package.
|
||||
|
||||
1
koch.nim
1
koch.nim
@@ -47,7 +47,6 @@ Boot options:
|
||||
-d:release produce a release version of the compiler
|
||||
-d:useLinenoise use the linenoise library for interactive mode
|
||||
(not needed on Windows)
|
||||
-d:avoidTimeMachine only for Mac OS X, excludes nimcache dir from backups
|
||||
|
||||
Commands for core developers:
|
||||
web [options] generates the website and the full documentation
|
||||
|
||||
Reference in New Issue
Block a user