Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ jobs:
lfs: false
sparse-checkout: |
tools/release-check.sh
tools/release/win-bundle.files
tools/release/lavapipe.sh
sparse-checkout-cone-mode: false
path: check
Expand All @@ -437,7 +438,8 @@ jobs:
run: |
set -e
v=${TAG#v}
cp check/tools/release-check.sh "$RUNNER_TEMP/"
# and the list of what bin\ must carry, where release-check.sh looks for it (release/ beside it)
cp check/tools/release-check.sh "$RUNNER_TEMP/" && mkdir -p "$RUNNER_TEMP/release" && cp check/tools/release/win-bundle.files "$RUNNER_TEMP/release/"
rm -rf check
cd "$RUNNER_TEMP/zip"
sha256sum -c "raea-$v-windows-x86_64.zip.sha256"
Expand Down
2 changes: 1 addition & 1 deletion apps/capcut/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn export(args: &[String]) -> R<String> {
let tsx = args.first().filter(|a| !a.starts_with('-')).ok_or(USAGE)?;
let tsx = dunce::canonicalize(&PathBuf::from(tsx)).map_err(|e| format!("{tsx}: {e}"))?;
let dir = tsx.parent().unwrap().to_path_buf();
let codec = flag(args, "--alpha-codec").map_or(Ok(raea_io_alpha::Codec::default_here()), |c| raea_io_alpha::Codec::parse(&c))?;
let codec = raea_io_alpha::Codec::chosen(flag(args, "--alpha-codec").as_deref())?;
let (root, in_store) = match flag(args, "-o") {
Some(o) => (PathBuf::from(o), false),
None => {
Expand Down
2 changes: 1 addition & 1 deletion apps/layers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub fn export(args: &[String]) -> R<(Layers, String)> {
let tsx = args.first().filter(|a| !a.starts_with('-')).ok_or(USAGE)?;
let tsx = dunce::canonicalize(PathBuf::from(tsx)).map_err(|e| format!("{tsx}: {e}"))?;
let edit_dir = tsx.parent().unwrap().to_path_buf();
let codec = flag(args, "--alpha-codec").map_or(Ok(raea_io_alpha::Codec::default_here()), |c| raea_io_alpha::Codec::parse(&c))?;
let codec = raea_io_alpha::Codec::chosen(flag(args, "--alpha-codec").as_deref())?;
let name = named(args, &tsx);
let dir = flag(args, "-o").map_or_else(|| edit_dir.join("out/layers").join(&name), PathBuf::from);
std::fs::create_dir_all(&dir).map_err(|e| format!("{}: {e}", dir.display()))?;
Expand Down
16 changes: 16 additions & 0 deletions apps/layers/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,19 @@ fn a_pan_inside_its_box_is_keyed() {
let dw = 3840.0 * 1920.0 / 2160.0;
assert!(near(centre(&from), (dw / 2.0 - 540.0) / 1080.0) && near(centre(&to), -(dw / 2.0 - 540.0) / 1080.0));
}

#[test]
fn a_windows_path_is_a_file_url_an_editor_opens() {
// #195: 0.1.8-rc8 wrote file://localhostD%3A%5CWork%5C... for D:\Work\...; Resolve imported the same XML at once with
// file:///D:/Work/...
use crate::xml::pathurl;
use std::path::Path;
assert_eq!(pathurl(Path::new(r"D:\Work\_research\raea\xmltest\public\clip.mp4")), "file:///D:/Work/_research/raea/xmltest/public/clip.mp4");
assert_eq!(pathurl(Path::new(r"\\?\C:\Users\Jürgen\my clip.mp4")), "file:///C:/Users/J%C3%BCrgen/my%20clip.mp4");
assert_eq!(pathurl(Path::new("C:/Users/me/out/xml/edit/graphics.rle.mov")), "file:///C:/Users/me/out/xml/edit/graphics.rle.mov");
assert_eq!(pathurl(Path::new(r"\\nas\clips\a.mp4")), "file://nas/clips/a.mp4");
assert_eq!(pathurl(Path::new(r"\\?\UNC\nas\clips\a.mp4")), "file://nas/clips/a.mp4");
// a Mac's or Linux's as before, a backslash there being part of a name
assert_eq!(pathurl(Path::new("/Users/me/my clip.mp4")), "file://localhost/Users/me/my%20clip.mp4");
assert_eq!(pathurl(Path::new(r"/tmp/a\b.mp4")), "file://localhost/tmp/a%5Cb.mp4");
}
32 changes: 25 additions & 7 deletions apps/layers/src/xml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,32 @@ fn esc(s: &str) -> String {
}

/// A file's path as xmeml's pathurl: file://localhost and the absolute path, each byte outside the unreserved set
/// percent-encoded.
fn pathurl(p: &Path) -> String {
let mut out = String::from("file://localhost");
for b in p.to_string_lossy().bytes() {
if b.is_ascii_alphanumeric() || b"/-_.~".contains(&b) {
out.push(b as char);
/// percent-encoded. A Windows path is made a URL as a path, not as text (#195: 0.1.8-rc8 wrote
/// file://localhostD%3A%5CWork%5C..., which Resolve refused): a drive's is file:///D:/Work/clip.mp4, the form Resolve
/// opened, and a share's file://nas/clips/clip.mp4, each with its separators as slashes and Windows' \\?\ prefix off.
pub(crate) fn pathurl(p: &Path) -> String {
let s = p.to_string_lossy();
let s = match (s.strip_prefix(r"\\?\UNC\"), s.strip_prefix(r"\\?\")) {
(Some(share), _) => format!(r"\\{share}"),
(None, Some(local)) => local.to_string(),
_ => s.into_owned(),
};
let b = s.as_bytes();
let drive = b.len() >= 3 && b[0].is_ascii_alphabetic() && b[1] == b':' && matches!(b[2], b'\\' | b'/');
let (mut out, rest, windows) = if drive {
(format!("file:///{}:", b[0] as char), &b[2..], true)
} else if let Some(share) = s.strip_prefix(r"\\") {
(String::from("file://"), share.as_bytes(), true)
} else {
(String::from("file://localhost"), b, false)
};
for &c in rest {
if windows && c == b'\\' {
out.push('/');
} else if c.is_ascii_alphanumeric() || b"/-_.~".contains(&c) {
out.push(c as char);
} else {
let _ = write!(out, "%{b:02X}");
let _ = write!(out, "%{c:02X}");
}
}
out
Expand Down
16 changes: 13 additions & 3 deletions io/alpha/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ impl Codec {
pub fn here(self) -> bool {
cfg!(target_vendor = "apple") || matches!(self, Codec::Rle | Codec::Png)
}

/// It, or what to use instead where this build can't write it.
pub fn usable(self) -> R<Codec> {
if self.here() { Ok(self) } else { Err(format!("{} is written through VideoToolbox, on a Mac: --alpha-codec rle (QuickTime Animation) or png here", self.name())) }
}

/// The codec `--alpha-codec` names (this machine's own when it names none), refused when it can't be written here:
/// what an export asks for before it renders anything, so a Windows PC told prores hears so before the reference
/// render, not after it (#196).
pub fn chosen(flag: Option<&str>) -> R<Codec> {
flag.map_or(Ok(Codec::default_here()), Codec::parse)?.usable()
}
}

/// A transparent movie being written: frames in, `finish` makes the file.
Expand All @@ -79,9 +91,7 @@ enum Inner {
impl Writer {
/// A movie of `codec` at `out`; `quality` (0..1) is HEVC's, which the others don't take.
pub fn create(out: &Path, codec: Codec, width: u32, height: u32, fps: f64, quality: f32) -> R<Writer> {
if !codec.here() {
return Err(format!("{} is written through VideoToolbox, on a Mac: use --alpha-codec rle or png here", codec.name()));
}
codec.usable()?;
if width == 0 || height == 0 || width > 0xFFFF || height > 0xFFFF {
return Err(format!("a {width}x{height} movie can't be written"));
}
Expand Down
5 changes: 1 addition & 4 deletions io/alpha/src/movie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ use crate::{Codec, R, encode_dir};
/// --manifest, HEVC's quality 0..1), from the frames `render` writes when given the same arguments with -o FOLDER/ and
/// --manifest in place of -o OUT.mov; what it said, APPLIED as the movie.
pub fn render_movie(args: &[String], out: &Path, codec: Option<&str>, manifest: Option<PathBuf>, quality: f32, render: impl Fn(&[String]) -> R<String>) -> R<String> {
let codec = codec.map_or(Ok(Codec::default_here()), Codec::parse)?;
if !codec.here() {
return Err(format!("{} is written through VideoToolbox, on a Mac: --alpha-codec rle (QuickTime Animation) or png here", codec.name()));
}
let codec = Codec::chosen(codec)?;
if let Some(d) = out.parent().filter(|d| !d.as_os_str().is_empty()) {
std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/release-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ keys=$(grep -rlE 'sk-or-v1-[0-9a-f]{20}|sk-ant-[A-Za-z0-9_-]{20}|(^|[^A-Za-z0-9+
# Windows: our binaries, and Microsoft's only where raea ships them on purpose, with their licences: ONNX Runtime's
# onnxruntime.dll (MIT, #110) and the VC++ runtime's four DLLs (tools/release/win-bundle.sh). Any other DLL, or a file
# named like the CRT, the SDK or DirectX's redistributables, isn't ours to ship.
bundle=$(cat "$(dirname "$0")/release/win-bundle.files")
bundle=$(tr -d '\r' < "$(dirname "$0")/release/win-bundle.files")
allowed=$(printf './bin/%s\n' raea_bundle.dll onnxruntime.dll $bundle)
ms=$(cd "$check/raea" && find . -type f \( -iname '*.dll' -o -iname 'vcruntime*' -o -iname 'msvcp*' -o -iname 'ucrtbase*' -o -iname 'api-ms-win*' -o -iname 'concrt*' -o -iname 'vccorlib*' -o -iname '*.lib' -o -iname '*.pdb' -o -iname 'd3dcompiler*' -o -iname 'dxcompiler*' -o -iname 'dxil*' \) | grep -ivxF "$allowed" | head -5 || true)
[ -z "$ms" ] || fail "files that aren't ours: $ms"
Expand Down
5 changes: 3 additions & 2 deletions tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 lib
cp "$bin/$f" "$stage/bin/"
done
# and what a PC with nothing installed and no downloads needs (tools/release/win-bundle.sh): the VC++ runtime
# raea.exe and onnxruntime.dll import, FFmpeg (raea's LGPL build) and uv, each with its licence
for f in $(cat "$root/tools/release/win-bundle.files"); do
# raea.exe and onnxruntime.dll import, FFmpeg (raea's LGPL build) and uv, each with its licence; the list read without
# its \r, as GitHub's Windows runner checks it out with CRLF (0.1.8-rc9 looked for "vcruntime140.dll\r")
for f in $(tr -d '\r' < "$root/tools/release/win-bundle.files"); do
[ -f "$bin/$f" ] || { echo "release.sh: $bin has no $f (tools/release/win-bundle.sh $bin)" >&2; exit 1; }
cp "$bin/$f" "$stage/bin/"
done
Expand Down
4 changes: 3 additions & 1 deletion vendor/bevy_hanabi/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1710,8 +1710,10 @@ impl FromWorld for UtilsPipeline {
debug!("Create utils shader module:\n{}", shader_code);
#[allow(unsafe_code)]
let shader_module = unsafe {
// no colon in a shader module's label: DX12's DXC takes it as the source's file name, and on Windows
// "hanabi:shader:utils" names no file, so every Bevy app failed there wherever DXC loads (raea #196)
render_device.create_shader_module(ShaderModuleDescriptor {
label: Some("hanabi:shader:utils"),
label: Some("hanabi_shader_utils"),
source: shader_source,
})
};
Expand Down
8 changes: 4 additions & 4 deletions vendor/bevy_hanabi/src/render/shader_contract_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ fn create_sort_pipeline(
crate::test_utils::compile_wesl(VFX_SORT_WESL.as_ref(), &["HAS_DUAL_KEY", "TEST"], &[])
.unwrap();
let shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("hanabi:test:vfx_sort"),
label: Some("hanabi_test_vfx_sort"),
source: wgpu::ShaderSource::Wgsl(source.into()),
});
let pipeline = wgpu_device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
Expand Down Expand Up @@ -724,7 +724,7 @@ fn location_mapping_contracts() {
let wgpu_device = device.wgpu_device();

let shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("hanabi:test:location:shader"),
label: Some("hanabi_test_location_shader"),
source: wgpu::ShaderSource::Wgsl(
r#"
struct BatchInfo {
Expand Down Expand Up @@ -926,7 +926,7 @@ fn indirect_plus_update_routing_contracts() {
let wgpu_device = device.wgpu_device();

let indirect_shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("hanabi:test:indirect-lite"),
label: Some("hanabi_test_indirect-lite"),
source: wgpu::ShaderSource::Wgsl(
r#"
struct Spawner {
Expand Down Expand Up @@ -964,7 +964,7 @@ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
),
});
let update_route_shader = wgpu_device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("hanabi:test:update-route"),
label: Some("hanabi_test_update-route"),
source: wgpu::ShaderSource::Wgsl(
r#"
struct BatchInfo {
Expand Down
2 changes: 1 addition & 1 deletion vendor/vendor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ exit = "a Rune release whose rune-taffy handles taffy's flexbox_balance"
path = "vendor/bevy_hanabi"
upstream = "git:github.com/djeedai/bevy_hanabi@77630ff1eed8b104f34e91d23e9440428dc5ab01:."
kind = "patch"
reason = "frame-pure particles (raea #52): a new particle seeded by its spawn index, not the dead slot it recycles (vfx_init.wesl), and blended effects sorted by view depth from the main camera, far first as Bevy sorts its transparent phase, through the ribbons' sort pass (mod.rs, sort.rs, vfx_sort_fill.wesl); examples and GPU tests dropped"
reason = "frame-pure particles (raea #52): a new particle seeded by its spawn index, not the dead slot it recycles (vfx_init.wesl), and blended effects sorted by view depth from the main camera, far first as Bevy sorts its transparent phase, through the ribbons' sort pass (mod.rs, sort.rs, vfx_sort_fill.wesl); examples and GPU tests dropped; and no colon in a shader module's label (mod.rs's utils, the contract tests'), which DX12's DXC takes as a file name that names no file on Windows (raea #196)"
exit = "a hanabi with a deterministic mode (both changes offered upstream); then back to the git dependency and drop the copy"

[usvg]
Expand Down
Loading