Skip to content

Commit

Permalink
bump pd
Browse files Browse the repository at this point in the history
  • Loading branch information
boozook committed Jul 13, 2024
1 parent 2e09b39 commit dd7e47c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 58 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,6 @@ jobs:
with:
ref: ${{ inputs.ref || github.ref }}

- name: Update rustfmt
run: rustup update

- name: Check
id: check
run: cargo fmt --all -- --check
Expand Down Expand Up @@ -505,9 +502,6 @@ jobs:
with:
ref: ${{ inputs.ref || github.ref }}

- name: Update components
run: rustup update

- name: Install Clippy
run: rustup component add clippy

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/playdate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "playdate"
version = "0.2.1"
version = "0.2.2"
readme = "README.md"
description = "High-level Playdate API"
keywords = ["playdate", "sdk", "api", "gamedev"]
Expand Down
96 changes: 48 additions & 48 deletions cargo/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,54 +209,54 @@ pub fn build(cfg: &Config, tree: &MetaDeps) -> CargoResult<Vec<BuildProduct>> {

let mut crate_types_cache = BTreeMap::new();

let removed =
roots.extract_if(|root| {
let tk = root.node().target().kind();
let ck = root.node().unit().platform;

log::trace!(" check {} {}", tk.description(), match ck {
CompileKind::Host => "host",
CompileKind::Target(ref kind) => kind.short_name(),
});

if reserved_roots.contains(root) {
log::trace!(" excluding, reserved root");
return true;
}

{
use cargo::core::TargetKind as Tk;
if executable && !matches!(tk, Tk::Bin | Tk::ExampleBin) {
log::trace!(" excluding, is not executable");
return true;
}
}

let target = targets_cache.entry(*root)
.or_insert_with(|| target_for_root(root));

let ct = determine_crate_types(cfg, art, target, tk.clone(), ck).collect::<Vec<_>>();

let is_good =
art.filenames.len() == ct.len() && !ct.iter().any(|(_, ct)| ct.is_none());
if is_good {
// save resolved crate-types:
let ct = ct.into_iter()
.filter_map(|(p, ct)| ct.map(|ct| (p.to_owned(), ct)));
crate_types_cache.extend(ct);
}

need_remove_roots && !is_good
})
.inspect(|r| {
let p = r.package_id().name();
let t = r.node().target().name.as_str();
log::trace!(" excluded: {p}::{t} {:?}", match r.node().unit().platform {
CompileKind::Host => "host",
CompileKind::Target(ref kind) => kind.short_name(),
})
})
.count();
let removed = roots.extract_if(|root| {
let tk = root.node().target().kind();
let ck = root.node().unit().platform;

log::trace!(" check {} {}", tk.description(), match ck {
CompileKind::Host => "host",
CompileKind::Target(ref kind) => kind.short_name(),
});

if reserved_roots.contains(root) {
log::trace!(" excluding, reserved root");
return true;
}

{
use cargo::core::TargetKind as Tk;
if executable && !matches!(tk, Tk::Bin | Tk::ExampleBin) {
log::trace!(" excluding, is not executable");
return true;
}
}

let target = targets_cache.entry(*root)
.or_insert_with(|| target_for_root(root));

let ct =
determine_crate_types(cfg, art, target, tk.clone(), ck).collect::<Vec<_>>();

let is_good =
art.filenames.len() == ct.len() && !ct.iter().any(|(_, ct)| ct.is_none());
if is_good {
// save resolved crate-types:
let ct = ct.into_iter()
.filter_map(|(p, ct)| ct.map(|ct| (p.to_owned(), ct)));
crate_types_cache.extend(ct);
}

need_remove_roots && !is_good
})
.inspect(|r| {
let p = r.package_id().name();
let t = r.node().target().name.as_str();
log::trace!(" excluded: {p}::{t} {:?}", match r.node().unit().platform {
CompileKind::Host => "host",
CompileKind::Target(ref kind) => kind.short_name(),
})
})
.count();

if removed > 0 {
log::trace!(" excluded: {removed}, now roots: {}", roots.len());
Expand Down

0 comments on commit dd7e47c

Please sign in to comment.