diff --git a/Cargo.lock b/Cargo.lock index c95ed8d1..4a7f4071 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -233,7 +233,7 @@ dependencies = [ "fs_extra", "glob", "lazy_static", - "libcnb 0.11.5", + "libcnb", "libherokubuildpack", "regex", "serde", @@ -384,6 +384,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "filetime" version = "0.2.21" @@ -396,6 +402,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.26" @@ -456,7 +468,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn", ] [[package]] @@ -563,7 +575,7 @@ dependencies = [ "flate2", "fs-err", "indoc", - "libcnb 0.11.5", + "libcnb", "libcnb-test", "libherokubuildpack", "rand", @@ -779,40 +791,14 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" -[[package]] -name = "libcnb" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4fd7573558173267930e31446da65a0275770bde88847cad4b4cf9a6ff8375" -dependencies = [ - "libcnb-data 0.11.5", - "libcnb-proc-macros 0.11.5", - "serde", - "thiserror", - "toml", -] - [[package]] name = "libcnb" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39d5e0e5f0ea6fe91d867457289d88c4f56631e37fac072d11676ff970715012" dependencies = [ - "libcnb-data 0.13.0", - "libcnb-proc-macros 0.13.0", - "serde", - "thiserror", - "toml", -] - -[[package]] -name = "libcnb-data" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c0112478d479c8900929894426818bea8e769ce923536a58baac719d3ca4dcb" -dependencies = [ - "fancy-regex", - "libcnb-proc-macros 0.11.5", + "libcnb-data", + "libcnb-proc-macros", "serde", "thiserror", "toml", @@ -825,7 +811,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "631bda3e80115baf38894609cde58b796d3b3fc0f47cca369321c230df53d563" dependencies = [ "fancy-regex", - "libcnb-proc-macros 0.13.0", + "libcnb-proc-macros", "serde", "thiserror", "toml", @@ -834,28 +820,17 @@ dependencies = [ [[package]] name = "libcnb-package" -version = "0.11.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aacd18d358a1078cf48f518ef8398c504f8d4fc691ba2e8773bafa1a71d66b59" +checksum = "17f8f85f26a1cacea4c3e3fd01484e2c86ca0d9c252a1e81adb22ab7e5ee0451" dependencies = [ "cargo_metadata", - "libcnb-data 0.11.5", + "libcnb-data", + "petgraph", "toml", "which", ] -[[package]] -name = "libcnb-proc-macros" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5930cea22615255081c0c44b902e6e8b37a824ebe1374a7c7d52724d5b7d6e4e" -dependencies = [ - "cargo_metadata", - "fancy-regex", - "quote", - "syn 1.0.109", -] - [[package]] name = "libcnb-proc-macros" version = "0.13.0" @@ -865,20 +840,20 @@ dependencies = [ "cargo_metadata", "fancy-regex", "quote", - "syn 2.0.23", + "syn", ] [[package]] name = "libcnb-test" -version = "0.11.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86e8c1847c8ba3c37e30841ee241887203110f4373731e7967706ab77c42b7d" +checksum = "0b41b862dfd56b90b266cc5eeb7387bbe1d7912f713af70d988bc9a52d7fe935" dependencies = [ "bollard", "cargo_metadata", - "fastrand", + "fastrand 2.0.0", "fs_extra", - "libcnb-data 0.11.5", + "libcnb-data", "libcnb-package", "serde", "tempfile", @@ -894,7 +869,7 @@ checksum = "9580036bf74433923229f3669b3eee4031f771272f6e419754bc49698f320851" dependencies = [ "crossbeam-utils", "flate2", - "libcnb 0.13.0", + "libcnb", "pathdiff", "sha2", "tar", @@ -1006,6 +981,16 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap 1.9.3", +] + [[package]] name = "pin-project" version = "1.1.2" @@ -1023,7 +1008,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn", ] [[package]] @@ -1134,9 +1119,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" dependencies = [ "aho-corasick", "memchr", @@ -1145,9 +1142,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" [[package]] name = "ring" @@ -1172,9 +1169,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.37.22" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8818fa822adcc98b18fedbb3632a6a33213c070556b5aa7c4c8cc21cff565c4c" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags", "errno", @@ -1186,13 +1183,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" dependencies = [ "log", "ring", - "rustls-webpki", + "rustls-webpki 0.101.1", "sct", ] @@ -1206,6 +1203,16 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.101.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "ryu" version = "1.0.14" @@ -1263,7 +1270,7 @@ checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn", ] [[package]] @@ -1279,13 +1286,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0a21fba416426ac927b1691996e82079f8b6156e920c85345f135b2e9ba2de" +checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn", ] [[package]] @@ -1366,17 +1373,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.23" @@ -1407,7 +1403,7 @@ checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ "autocfg", "cfg-if", - "fastrand", + "fastrand 1.9.0", "redox_syscall 0.3.5", "rustix", "windows-sys", @@ -1439,7 +1435,7 @@ checksum = "d14928354b01c4d6a4f0e549069adef399a284e7995c7ccca94e8a07a5346c59" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn", ] [[package]] @@ -1528,9 +1524,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -1549,9 +1545,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.19.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" dependencies = [ "indexmap 2.0.0", "serde", @@ -1636,7 +1632,7 @@ dependencies = [ "log", "once_cell", "rustls", - "rustls-webpki", + "rustls-webpki 0.100.1", "url", "webpki-roots", ] @@ -1720,7 +1716,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn", "wasm-bindgen-shared", ] @@ -1742,7 +1738,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1769,7 +1765,7 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" dependencies = [ - "rustls-webpki", + "rustls-webpki 0.100.1", ] [[package]] @@ -1904,9 +1900,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "a9482fe6ceabdf32f3966bfdd350ba69256a97c30253dc616fe0005af24f164e" dependencies = [ "memchr", ] diff --git a/buildpacks/ruby/Cargo.toml b/buildpacks/ruby/Cargo.toml index de902d5d..23bfefd4 100644 --- a/buildpacks/ruby/Cargo.toml +++ b/buildpacks/ruby/Cargo.toml @@ -11,7 +11,7 @@ commons = { path = "../../commons" } flate2 = "1" fs-err = "2" indoc = "2" -libcnb = "0.11" +libcnb = "0.13" libherokubuildpack = "0.13" rand = "0.8" regex = "1" @@ -23,5 +23,5 @@ ureq = "2" url = "2" [dev-dependencies] -libcnb-test = "0.11" +libcnb-test = "0.13" toml = "0.7" diff --git a/buildpacks/ruby/buildpack.toml b/buildpacks/ruby/buildpack.toml index 1b526276..8efd3606 100644 --- a/buildpacks/ruby/buildpack.toml +++ b/buildpacks/ruby/buildpack.toml @@ -1,4 +1,4 @@ -api = "0.8" +api = "0.9" [buildpack] id = "heroku/ruby" diff --git a/buildpacks/ruby/src/layers/bundle_download_layer.rs b/buildpacks/ruby/src/layers/bundle_download_layer.rs index 101bf04b..23596406 100644 --- a/buildpacks/ruby/src/layers/bundle_download_layer.rs +++ b/buildpacks/ruby/src/layers/bundle_download_layer.rs @@ -73,7 +73,7 @@ impl Layer for BundleDownloadLayer { cmd.output_and_write_streams(std::io::stdout(), std::io::stderr()) .map_err(|error| { - fun_run::annotate_which_problem(error, cmd, self.env.get("PATH")) + fun_run::annotate_which_problem(error, cmd, self.env.get("PATH").cloned()) }) .map_err(|error| fun_run::on_system_error(name.clone(), error)) .and_then(|output| fun_run::nonzero_streamed(name.clone(), output)) diff --git a/buildpacks/ruby/src/layers/bundle_install_layer.rs b/buildpacks/ruby/src/layers/bundle_install_layer.rs index 53d5d914..d4d9c104 100644 --- a/buildpacks/ruby/src/layers/bundle_install_layer.rs +++ b/buildpacks/ruby/src/layers/bundle_install_layer.rs @@ -365,7 +365,7 @@ fn bundle_install(env: &Env) -> Result<(), CmdError> { user::log_info(format!("Running $ {name}")); cmd.output_and_write_streams(std::io::stdout(), std::io::stderr()) - .map_err(|error| fun_run::annotate_which_problem(error, cmd, path_env)) + .map_err(|error| fun_run::annotate_which_problem(error, cmd, path_env.cloned())) .map_err(|error| fun_run::on_system_error(name.clone(), error)) .and_then(|output| fun_run::nonzero_streamed(name.clone(), output)) })?; diff --git a/buildpacks/ruby/src/steps/get_default_process.rs b/buildpacks/ruby/src/steps/get_default_process.rs index ef307505..1561021e 100644 --- a/buildpacks/ruby/src/steps/get_default_process.rs +++ b/buildpacks/ruby/src/steps/get_default_process.rs @@ -1,11 +1,10 @@ -use std::path::Path; - use commons::gem_list::GemList; use libcnb::build::BuildContext; use libcnb::data::launch::Process; use libcnb::data::launch::ProcessBuilder; use libcnb::data::process_type; use libherokubuildpack::log as user; +use std::path::Path; use crate::RubyBuildpack; @@ -65,15 +64,31 @@ fn detect_web(gem_list: &GemList, app_path: &Path) -> WebProcess { } fn default_rack() -> Process { - ProcessBuilder::new(process_type!("web"), "bundle") - .args(["exec", "rackup", "--port", "$PORT", "--host", "0.0.0.0"]) + ProcessBuilder::new(process_type!("web"), ["bash"]) + .args([ + "-c", + &[ + "bundle exec rackup", + "--port \"$PORT\"", + "--host \"0.0.0.0\"", + ] + .join(" "), + ]) .default(true) .build() } fn default_rails() -> Process { - ProcessBuilder::new(process_type!("web"), "bin/rails") - .args(["server", "--port", "$PORT", "--environment", "$RAILS_ENV"]) + ProcessBuilder::new(process_type!("web"), ["bash"]) + .args([ + "-c", + &[ + "bin/rails server", + "--port \"$PORT\"", + "--environment \"$RAILS_ENV\"", + ] + .join(" "), + ]) .default(true) .build() } diff --git a/buildpacks/ruby/src/steps/rake_assets_install.rs b/buildpacks/ruby/src/steps/rake_assets_install.rs index 11194668..d89d5592 100644 --- a/buildpacks/ruby/src/steps/rake_assets_install.rs +++ b/buildpacks/ruby/src/steps/rake_assets_install.rs @@ -71,7 +71,9 @@ fn run_rake_assets_precompile(env: &Env) -> Result<(), CmdError> { user::log_info(format!("Running $ {name}")); cmd.output_and_write_streams(std::io::stdout(), std::io::stderr()) - .map_err(|error| fun_run::annotate_which_problem(error, cmd, env.get("PATH"))) + .map_err(|error| { + fun_run::annotate_which_problem(error, cmd, env.get("PATH").cloned()) + }) .map_err(|error| fun_run::on_system_error(name.clone(), error)) .and_then(|output| fun_run::nonzero_streamed(name.clone(), output)) })?; @@ -95,7 +97,9 @@ fn run_rake_assets_precompile_with_clean(env: &Env) -> Result<(), CmdError> { user::log_info(format!("Running $ {name}")); cmd.output_and_write_streams(std::io::stdout(), std::io::stderr()) - .map_err(|error| fun_run::annotate_which_problem(error, cmd, env.get("PATH"))) + .map_err(|error| { + fun_run::annotate_which_problem(error, cmd, env.get("PATH").cloned()) + }) .map_err(|error| fun_run::on_system_error(name.clone(), error)) .and_then(|output| fun_run::nonzero_streamed(name.clone(), output)) })?; diff --git a/commons/Cargo.toml b/commons/Cargo.toml index bde71306..a685c7e1 100644 --- a/commons/Cargo.toml +++ b/commons/Cargo.toml @@ -11,7 +11,7 @@ fs_extra = "1" fs-err = "2" glob = "0.3" lazy_static = "1" -libcnb = "0.11" +libcnb = "0.13" regex = "1" serde = "1" sha2 = "0.10"