Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory glob does not work for repositories without version control #9574

Open
1 task done
cjquines opened this issue Dec 5, 2024 · 4 comments
Open
1 task done
Labels
kind: bug Something isn't working

Comments

@cjquines
Copy link

cjquines commented Dec 5, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/cjquines/turborepo-manual-scm

Which canary version will you have in your reproduction?

turbo 2.3.4-canary.2

Enviroment information

turbo 2.3.4-canary.2

CLI:
   Version: 2.3.4-canary.2
   Path to executable: /dir/turborepo-manual-scm/node_modules/.pnpm/[email protected]/node_modules/turbo-darwin-arm64/bin/turbo
   Daemon status: Running
   Package manager: pnpm

Platform:
   Architecture: aarch64
   Operating system: macos
   WSL: false
   Available memory (MB): 10932
   Available CPU cores: 12

Environment:
   CI: None
   Terminal (TERM): xterm-kitty
   Terminal program (TERM_PROGRAM): unknown
   Terminal program version (TERM_PROGRAM_VERSION): unknown
   Shell (SHELL): /bin/zsh
   stdin: false

Expected behavior

The task app-a#build has the input src, and per file glob specification, should include all the files in its src as part of its input.

Actual behavior

With the manual SCM, the src is not part of the input.

To Reproduce

Clone the repo, then remove version control (via e.g. mv .git _git).

Run turbo build --summarize; observe that the task app-a#build does not have src in its inputs.

Additional context

No response

@cjquines cjquines added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Dec 5, 2024
@anthonyshew
Copy link
Contributor

Can you describe what you mean by "manual SCM"? I can't say I've ever heard of this, and searching the web for it didn't yield me anything that looked like mv .git _git. I'm interested to learn more.

Off-hand, this sounds like something that isn't supported per our Support Policy so it's possible that this ambiguous behavior is expected.

@anthonyshew anthonyshew added needs: author input and removed needs: triage New issues get this label. Remove it after triage labels Dec 7, 2024
@cjquines
Copy link
Author

cjquines commented Dec 7, 2024

ah sorry, "manual SCM" is what the verbose logs refer to the scenario without git.

the support policy mentions that it supports "repositories that don't have version control at all". the mv .git _git is simply to make the repository not have any version control; you'll get identical results if you simply copy the files out.

@cjquines cjquines changed the title Directory glob does not work with manual SCM Directory glob does not work for repositories without version control Dec 7, 2024
@chris-olszewski
Copy link
Member

I just saw that for some reason we're going through a different codepath that skips "fixing" globs when manual hashing is used. Right now if you pass src as an input glob and src is a directory then we'll change it to src/** as that's what most users want. This transformation isn't happening in git-less repos for some reason.

Current workaround is to change the input glob from src to src/** and you'll see the src/input.txt as an input in the summary:

 185   │       "taskId": "pkg-a#build",
 186   │       "task": "build",
 187   │       "package": "pkg-a",
 188   │       "hash": "21648956089cb500",
 189   │       "inputs": {
 190   │         "package.json": "1d60de1da4eee8f13adc8fe28bff8a69413c1eb3",
 191   │         "src/input.txt": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
 192   │       },

(In your reproduction repository app-a doesn't have a src folder) but pkg-a/pkg-b so I'm looking at those)

@cjquines
Copy link
Author

cjquines commented Dec 20, 2024

yeah, the workaround i went with was just doing a git init and making a commit. the src/** is probably marginally faster but we have a lot of globs that we'd have to fix lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants