Skip to content

Skip hidden directory trees during source and import discovery - #3170

Open
atilaneves wants to merge 3 commits into
dlang:masterfrom
atilaneves:fix/prune-hidden-source-trees
Open

atilaneves wants to merge 3 commits into
dlang:masterfrom
atilaneves:fix/prune-hidden-source-trees

Conversation

@atilaneves

Copy link
Copy Markdown
Contributor

DUB currently descends into hidden directory trees during source/import discovery and filters their files afterwards. With an import root of . this scans .git, .dub, generated files and nested worktrees even though none of those descendants can enter the result.

Prune hidden entries before recursion. Explicitly listed hidden roots still work, and visible symlinks, glob matching, depth-first traversal and errors from visible directories retain their behavior.

In five alternating runs of otherwise identical LDC release builds of Reggae with DUB 1.42.0 (the production change backported for comparison), fresh metadata queries for Snakebite's six configurations fell from a median 2.825 s to 0.698 s. Ranges were 2.789–3.617 s and 0.689–1.200 s. Every run succeeded; complete metadata, Ninja files and compilation databases were byte-identical. A separate trace confirmed zero directory reads inside .worktrees. Concurrent local builds contributed timing noise.

All 59 library unittest modules pass. Regression coverage includes an unreadable excluded hidden tree (which failed before this change), explicit hidden roots and nested hidden descendants, visible symlinks and permission errors, D/C/header patterns, and string imports. The inherited DIP1000 build check is blocked by existing dependency/configy scope errors.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ PR OK, no changes in deprecations or warnings

Total deprecations: 0

Total warnings: 0

Build statistics:

 statistics (-before, +after)
-executable size=5688664 bin/dub
+executable size=5684568 bin/dub
 rough build time=43s
Full build output
DUB version 1.42.0, built on Aug 30 2026
LDC - the LLVM D compiler (1.43.0):
  based on DMD v2.113.0 and LLVM 22.1.8
  built with LDC - the LLVM D compiler (1.43.0)
  Default target: x86_64-unknown-linux-gnu
  Host CPU: znver5
  https://dlang.org - https://wiki.dlang.org/LDC


  Registered Targets:
    aarch64     - AArch64 (little endian)
    aarch64_32  - AArch64 (little endian ILP32)
    aarch64_be  - AArch64 (big endian)
    amdgcn      - AMD GCN GPUs
    arm         - ARM
    arm64       - ARM64 (little endian)
    arm64_32    - ARM64 (little endian ILP32)
    armeb       - ARM (big endian)
    avr         - Atmel AVR Microcontroller
    bpf         - BPF (host endian)
    bpfeb       - BPF (big endian)
    bpfel       - BPF (little endian)
    hexagon     - Hexagon
    lanai       - Lanai
    loongarch32 - 32-bit LoongArch
    loongarch64 - 64-bit LoongArch
    mips        - MIPS (32-bit big endian)
    mips64      - MIPS (64-bit big endian)
    mips64el    - MIPS (64-bit little endian)
    mipsel      - MIPS (32-bit little endian)
    msp430      - MSP430 [experimental]
    nvptx       - NVIDIA PTX 32-bit
    nvptx64     - NVIDIA PTX 64-bit
    ppc32       - PowerPC 32
    ppc32le     - PowerPC 32 LE
    ppc64       - PowerPC 64
    ppc64le     - PowerPC 64 LE
    r600        - AMD GPUs HD2XXX-HD6XXX
    riscv32     - 32-bit RISC-V
    riscv32be   - 32-bit big endian RISC-V
    riscv64     - 64-bit RISC-V
    riscv64be   - 64-bit big endian RISC-V
    sparc       - Sparc
    sparcel     - Sparc LE
    sparcv9     - Sparc V9
    spirv       - SPIR-V Logical
    spirv32     - SPIR-V 32-bit
    spirv64     - SPIR-V 64-bit
    systemz     - SystemZ
    thumb       - Thumb
    thumbeb     - Thumb (big endian)
    ve          - VE
    wasm32      - WebAssembly 32-bit
    wasm64      - WebAssembly 64-bit
    x86         - 32-bit X86: Pentium-Pro and above
    x86-64      - 64-bit X86: EM64T and AMD64
    xcore       - XCore
    xtensa      - Xtensa 32
   Upgrading project in /home/runner/work/dub/dub/
    Starting Performing "release" build using /opt/hostedtoolcache/ldc2/1.43.0/x64/ldc2-1.43.0-linux-x86_64/bin/ldc2 for x86_64.
    Building dub 1.42.0-beta.1+commit.36.g981b018c: building configuration [application]
     Linking dub
STAT:statistics (-before, +after)
STAT:executable size=5684568 bin/dub
STAT:rough build time=43s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant