diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/FunctionHermeticity.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/FunctionHermeticity.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/FunctionHermeticity.java b/src/main/java/com/google/devtools/build/skyframe/FunctionHermeticity.java new file mode 100644 index 0000000000..fd19b757b7 --- /dev/null +++ b/src/main/java/com/google/devtools/build/skyframe/FunctionHermeticity.java @@ -0,0 +1,31 @@ +// Copyright 2018 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.devtools.build.skyframe; + +/** + * Hermeticity of a {@link SkyFunction}, meaning whether it accesses external state untracked by + * Skyframe during its evaluation. A classic example is a {@link SkyFunction} that consumes a file + * on a filesystem: that state is untracked by Skyframe. Skyframe must be more conservative when + * using values generated by a non-hermetic function: for instance, a non-hermetic function may need + * to be re-run even if all its Skyframe dependencies are unchanged: such a node may be explicitly + * dirtied due to outside changes. + * + * <p>Note that Skyframe does <i>not</i> explicitly re-evaluate non-hermetic functions on every + * build: it just relaxes some of its graph-pruning logic to be more conservative with such nodes. + */ +public enum FunctionHermeticity { + HERMETIC, + NONHERMETIC +} |