bacon icon indicating copy to clipboard operation
bacon copied to clipboard

Watch & Workspace: path error

Open vincentberthier opened this issue 1 year ago • 3 comments

Hey there, I’m trying out Bacon on a rather complex project organized in a Workspace. I’ve configured a number of jobs, which are all launched correctly, no problem.

However, the watch directories are borked. From what I see in the logs, the directories in the watch use the first crate as the root. For example let’s say ̇I have: Folder1 Folder2 If I put watch = ["Folder1", "Folder2"] then beacon will complain that it can’t find "/root/path/Folder1/Folder1" and "/root/path/Folder1/Folder2".

If I put watch = ["../Folder1", "../Folder2"] however it seems to be working just fine.

vincentberthier avatar Jul 02 '24 18:07 vincentberthier

Can you please build a project exhibiting this problem (it doesn't have to have many files) ?

Canop avatar Jul 02 '24 18:07 Canop

Uh, there are a lot of things, and it’s a work project, so not something I can share like that. I can give you the logs and the configuration though, and it’s…well, even weirder that I thought in fact.

With crates A, B and C, if I put watch = [A, B, C], it seems that it will

  • first look for A/A, A/B, A/C,
  • then look for B/A, B/B, B/C Might be for the different jobs though? It’s weird.

bacon.log bacon.txt

vincentberthier avatar Jul 02 '24 18:07 vincentberthier

I found the same issue. My repository is https://github.com/veryl-lang/veryl .

In this repo, I want to add testcases/veryl directory to watch list. So I wrote like below at first, but it didn't work fine.

watch = ["testcases/veryl"]

Instead of it, I wrote like below, it worked fine.

watch = ["../../testcases/veryl"]

This is because the root path of the watch list is the path of each crate in the workspace. In my workspace, there are the following crates:

crates/analyzer
crates/emitter
crates/formatter
crates/languageserver
crates/mdbook
crates/metadata
crates/parser
crates/path
crates/sourcemap
crates/std
crates/tests
crates/veryl

So the watch entry is expanded like below:

crates/analyzer/../../testcases/veryl
crates/emitter/../../testcases/veryl
crates/formatter/../../testcases/veryl
crates/languageserver/../../testcases/veryl
crates/mdbook/../../testcases/veryl
crates/metadata/../../testcases/veryl
crates/parser/../../testcases/veryl
crates/path/../../testcases/veryl
crates/sourcemap/../../testcases/veryl
crates/std/../../testcases/veryl
crates/tests/../../testcases/veryl
crates/veryl/../../testcases/veryl

It works fine, but I think bit confusable because the root path of watch entry is not documented. And I worry whether the same directory is added repeatedly is problem. In workspace, it may be better that the root path of watch entry is the workspace root.

dalance avatar Oct 04 '24 01:10 dalance