Discussion
Loading...

#Tag

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
halcy​ :icosahedron:
@halcy@icosahedron.website  ·  activity timestamp 2 weeks ago

@jk i‘m using it and i love it actually

you can embed two files in a row by leaving the suffix directive off the first one and putting a comma! this rules!

halcy​ :icosahedron:
@halcy@icosahedron.website replied  ·  activity timestamp 2 weeks ago

@jk Like you can #embed a lil file with some #defines and then #embed a shader right afterwards, to share those defines between two shaders! Or to statically create shader variants! It‘s almost like having an include mechanism without having to bother with having an include mechanism!

  • Copy link
  • Flag this comment
  • Block
d@nny disc@ mc²
@hipsterelectron@circumstances.run  ·  activity timestamp 2 months ago

the musl script gets worse the longer i look https://github.com/rust-lang/compiler-builtins/blob/82a32c6bd1b82b55de5aea0cddb707732b54855f/crates/musl-math-sys/build.rs#L82-L92

 let target_features = env::var("CARGO_CFG_TARGET_FEATURE")
.map(|feats| feats.split(',').map(ToOwned::to_owned).collect())
.unwrap_or_default();
let musl_dir = manifest_dir.join("musl");


let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let musl_arch = if target_arch == "x86" {
"i386".to_owned()
} else {
target_arch.clone()
};

this is a standard env var set from the standard configuration and it's splitting by string? matching against hardcoded literal strings? i could add a zero-width space and break the build. i could ruin everyone's week

d@nny disc@ mc²
@hipsterelectron@circumstances.run replied  ·  activity timestamp 2 months ago

honestly feeling super nihilistic https://github.com/rust-lang/compiler-builtins/blob/82a32c6bd1b82b55de5aea0cddb707732b54855f/compiler-builtins/build.rs#L652-L660

 // The original compiler-rt build system compiles the same
// source file multiple times with different compiler
// options. Here we do something slightly different: we
// create multiple .S files with the proper #defines and
// then include the original file.
//
// This is needed because the cc crate doesn't allow us to
// override the name of object files and libtool requires
// all objects in an archive to have unique names.

let's work around how the crate we depend on to compile our shit is broken and instead do a ridiculously complex workaround within a build script which provides no record of what we've just done

but then! the top of the file has this incredible bit https://github.com/rust-lang/compiler-builtins/blob/82a32c6bd1b82b55de5aea0cddb707732b54855f/compiler-builtins/build.rs#L29

 // OpenBSD provides compiler_rt by default, use it instead of rebuilding it from source
if target.os == "openbsd" {
println!("cargo:rustc-link-search=native=/usr/lib");
println!("cargo:rustc-link-lib=compiler_rt");
return;
}
  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.8 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login