Flatpak-builder cannot find git source files

Hi, my manifest file is as follows:

id: com.gitlab.adnan338.Nixwriter
runtime: org.gnome.Platform
runtime-version: "3.38"
sdk: org.gnome.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.rust-stable
command: nixwriter
finish-args:
  - --socket=fallback-x11
  - --share=ipc
  - --filesystem=host
  - --device=all
  - --system-talk-name=org.freedesktop.UDisks2
  - --talk-name=org.freedesktop.Notifications
build-options:
  append-path: /usr/lib/sdk/rust-stable/bin
  # This enables building downloaded crates offline
  env:
    CARGO_HOME: /run/build/nixwriter/cargo

modules:
  - name: nixwriter
    sources:
      - type: git
        url: https://gitlab.com/9898287/nixwriter
        tag: "3.0.0"
        commit: "88b28ceb8e0849a98df46d942e20311d862e1512"
      - deptree.json
      - type: file
        path: resources/com.gitlab.adnan338.Nixwriter.desktop
      - type: file
        path: resources/com.gitlab.adnan338.Nixwriter.svg
      - type: file
        path: resources/com.gitlab.adnan338.Nixwriter.64x64.svg
      - type: file
        path: resources/com.gitlab.adnan338.Nixwriter.128x128.svg
      - type: file
        path: resources/com.gitlab.adnan338.Nixwriter.metainfo.xml
    buildsystem: simple
    build-commands:
      - cargo --offline build --manifest-path=/run/build/nixwriter/Cargo.toml --release --verbose
      - install -Dm755 target/release/nixwriter --target-directory=/app/bin
      - install -Dm644 com.gitlab.adnan338.Nixwriter.desktop --target-directory=/app/share/applications
      - install -Dm644 com.gitlab.adnan338.Nixwriter.svg --target-directory=/app/share/icons/hicolor/scalable/apps
      - install -Dm644 com.gitlab.adnan338.Nixwriter.64x64.svg --target-directory=/app/share/icons/hicolor/64x64/apps/
      - install -Dm644 com.gitlab.adnan338.Nixwriter.128x128.svg --target-directory=/app/share/icons/hicolor/128x128/apps/
      - install -Dm644 com.gitlab.adnan338.Nixwriter.metainfo.xml --target-directory=/app/share/metainfo

In the git source I mentioned, there is a Cargo.toml, deptree.json and a resources folder. I want flatpak-builder to build my project with the content of these folders and files.

However I realized flatpak builder can’t recognize my deptree.json file and can’t access anything fetched from the upstream git repo.

Where is the git-fetched repos downloaded. I tried /run/build/$module but it didn’t work.

I fixed it by hard-cloning my original repo.


Edit: Turns out, I needed to manually add the generated dependency file in the flathub repo.