diff --git a/scripts/campfire-oracle b/scripts/campfire-oracle index 52e8cfa37..d4fc3f37d 100755 --- a/scripts/campfire-oracle +++ b/scripts/campfire-oracle @@ -236,12 +236,15 @@ cmd_prepare() { [[ -d "$APP" ]] || die "no campfire checkout at $APP" command -v sqlite3 >/dev/null || die "sqlite3 not on PATH" - local sha - sha="$(git -C "$APP" rev-parse HEAD 2>/dev/null || echo unknown)" + local sha=unknown tracked= + # Not a bare rev-parse: a tarball checkout inside another repository (Bazel's execroot links .git) would archive that one. + if [[ "$(git -C "$APP" rev-parse --show-toplevel 2>/dev/null)" == "$(cd "$APP" && pwd -P)" ]]; then + tracked=1; sha="$(git -C "$APP" rev-parse HEAD)" + fi step "exporting $APP @ ${sha:0:12} -> $OUT" rm -rf "$OUT"; mkdir -p "$OUT" - if git -C "$APP" rev-parse HEAD >/dev/null 2>&1; then + if [[ -n "$tracked" ]]; then # git archive: tracked files only, no local litter. (cd "$APP" && git archive HEAD) | tar -x -C "$OUT" else diff --git a/tests/overlay_cable_dispatch.rb b/tests/overlay_cable_dispatch.rb index 9e6e1e713..bc05363f1 100644 --- a/tests/overlay_cable_dispatch.rb +++ b/tests/overlay_cable_dispatch.rb @@ -51,8 +51,10 @@ def self.application = @application ||= Struct.new(:global_id_app, :secret_key_b load "#{root}/runtime/ruby/action_controller/message_verifier.rb" # action_cable.rb's one require; the transport half is not under test. -$LOADED_FEATURES << File.expand_path( - "#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/broadcasts.rb" +# Not expand_path: require_relative resolves symlinks, so under a symlinked tree (Bazel's runfiles) the paths differ. +$LOADED_FEATURES << File.join( + File.dirname(File.realpath("#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/action_cable.rb")), + "broadcasts.rb" ) module Broadcasts LOG = [] @@ -69,7 +71,7 @@ module Broadcasts # Loading the spinel action_cable here would replace `Channel::Base` with # the sibling whose methods raise — a green run against the wrong file. %w[action_cable base64 broadcasts].each do |sibling| - $LOADED_FEATURES << File.expand_path("#{root}/runtime/spinel/#{sibling}.rb") + $LOADED_FEATURES << File.join(File.dirname(File.realpath("#{root}/runtime/spinel/turbo_streams.rb")), "#{sibling}.rb") end load "#{root}/runtime/spinel/turbo_streams.rb" load "#{root}/runtime/spinel/global_id_locator.rb" diff --git a/tests/overlay_cable_identity.rb b/tests/overlay_cable_identity.rb index 6378140cb..367cd1a50 100644 --- a/tests/overlay_cable_identity.rb +++ b/tests/overlay_cable_identity.rb @@ -29,8 +29,10 @@ def self.application = @app ||= Application.new("a" * 64) load "#{root}/runtime/spinel/cgi_io.rb" # action_cable.rb's one require; the transport half is not under test. -$LOADED_FEATURES << File.expand_path( - "#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/broadcasts.rb" +# Not expand_path: require_relative resolves symlinks, so under a symlinked tree (Bazel's runfiles) the paths differ. +$LOADED_FEATURES << File.join( + File.dirname(File.realpath("#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/action_cable.rb")), + "broadcasts.rb" ) module Broadcasts LOG = []