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

plz clean doesn't remove LinkGeneratedSources'ed links #3132

Open
sean- opened this issue Apr 18, 2024 · 3 comments
Open

plz clean doesn't remove LinkGeneratedSources'ed links #3132

sean- opened this issue Apr 18, 2024 · 3 comments

Comments

@sean-
Copy link
Contributor

sean- commented Apr 18, 2024

When using LinkGeneratedSources, the linked files aren't cleaned up when executing a plz clean.

[Build]
LinkGeneratedSources = soft
UpdateGitignore = true
$ ls -lA
total 40
-rw-r--r--  1 seanc  staff   171 Apr 18 09:10 .gitignore
-rw-r--r--  1 seanc  staff  1617 Apr 18 09:11 BUILD.plz
drwxr-xr-x  5 seanc  staff   160 Apr 18 09:10 loglevel
$ plz build
Build finished; total time 3.2s, incrementality 91.6%. Outputs:
//resources/pkl/mycmd:gen-go:
  /Users/seanc/src/example/mycmd/plz-out/gen/resources/pkl/mycmd/Config.pkl.go
  /Users/seanc/src/example/mycmd/plz-out/gen/resources/pkl/mycmd/init.pkl.go
//resources/pkl/mycmd:mycmd:
  /Users/seanc/src/example/mycmd/plz-out/gen/resources/pkl/mycmd/mycmd.a
//resources/pkl/mycmd/loglevel:loglevel:
  /Users/seanc/src/example/mycmd/plz-out/gen/resources/pkl/mycmd/loglevel/loglevel.a
$ plz clean
$ ls -lA
total 40
-rw-r--r--  1 seanc  staff   171 Apr 18 09:10 .gitignore
-rw-r--r--  1 seanc  staff  1617 Apr 18 09:11 BUILD.plz
lrwxr-xr-x  1 seanc  staff    80 Apr 18 09:35 Config.pkl.go -> /Users/seanc/src/example/mycmd/plz-out/gen/resources/pkl/mycmd/Config.pkl.go
lrwxr-xr-x  1 seanc  staff    78 Apr 18 09:35 init.pkl.go -> /Users/seanc/src/example/mycmd/plz-out/gen/resources/pkl/mycmd/init.pkl.go
drwxr-xr-x  5 seanc  staff   160 Apr 18 09:10 loglevel
-rw-r--r--  1 seanc  staff  1972 Apr 17 22:29 mycmd.pkl

Maybe this is just a call to git clean?

@goddenrich
Copy link
Contributor

Thanks for pointing this out. I don't think a git clean will work if you have UpdateGitignore true. I'll take a look and see if there's anything we can do. Does it cause you other issues other than the links just cluttering up the directory?

@sean-
Copy link
Contributor Author

sean- commented Apr 18, 2024

No actual issues, I intended to just point this out. I just discovered LinkGeneratedSources and was looking closely at my local dev environment and noticed I had a few dead symlinks from old .pkl.go files as I was iterating. With git clean -f -X . that would work:

$ cd resources/pkl/mycmd && git clean -f  -X .
Removing Config.pkl.go
Removing init.pkl.go

@goddenrich
Copy link
Contributor

Ah nice -X. I wasn't aware of that flag thanks for that

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

No branches or pull requests

2 participants