Skip to content

[build] Disable cleaning sourcekit-lsp by default, rather than having the flag do nothing #75053

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

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

finagolfin
Copy link
Member

@finagolfin finagolfin commented Jul 8, 2024

Rather than make this change, swiftlang/sourcekit-lsp@37d003eb7 had the --no-clean flag do nothing, which means the flag can't be used at all.

@ahoppen, I'm building sourcekit-lsp locally on my Android phone right now and I'd like to be able to disenable the --no-clean--clean flag and have the build cleaned sometimes, so I will nexthave submitted a pull to revert the above sourcekit-lsp commit.

This pull changes no behavior, since the flag currently does nothing, but let me know if you'd also like me to change the build action here to clean on repeated sourcekit-lsp builds, as it once did.

finagolfin added a commit to finagolfin/sourcekit-lsp that referenced this pull request Jul 8, 2024
…g, ie clean by default

Instead, swiftlang/swift#75053 makes sure `build-script` passes in the flag by
default, so you can explicitly override it when needed.
@@ -85,7 +85,7 @@ def get_dependencies(cls):


def run_build_script_helper(action, host_target, product, args,
sanitize_all=False, clean=True):
sanitize_all=False, clean=False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won’t this break the indexstore-db build, which would now pass --no-clean, which isn’t accepted by the build-script-helper.py?

My proposal would be to just remove the cleaning step from SourceKit-LSP’s build-script-helper.py, never pass --no-clean and remove the clean parameter here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won’t this break the indexstore-db build, which would now pass --no-clean, which isn’t accepted by the build-script-helper.py?

It might, haven't tried that recently.

My proposal would be to just remove the cleaning step from SourceKit-LSP’s build-script-helper.py, never pass --no-clean and remove the clean parameter here.

That would defeat my purpose of optionally being able to clean sourcekit-lsp by manually overriding these flags when wanted.

Do you not want that cleaning step at all in the sourcekit-lsp build-script-helper.py? I would prefer to resurrect it in some way, but disabled in these scripts by default.

Let me know which approach you want and I will change these two pulls to do that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to not have the clean step as it prevents us from re-using build artifacts from eg. the build phase in the test phase, which increases build time. If cleaning is required between builds, I think it should be done on a higher level.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was asking a different question, I think. I see two options here:

  1. Remove all code related to cleaning sourcekit-lsp builds.
  2. Bring back the cleaning code in the sourcekit-lsp repo, but disable using it for all build actions by default.

I have now implemented 2. here and in swiftlang/sourcekit-lsp#1558, as it's the route I prefer. Let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer option (1). Other build scripts (eg. indexstore-db, swift-syntax) also don’t have a clean option.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most have a way to clean the build as part of the build-script and they're usually enabled by default, whether in their build-script-helper script or the bash portion of the overall build-script. I know because I added a lot of the flags to disable them when wanted. 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don’t think we should need it but I don’t feel super strongly about it. If you have strong opinions on it being useful, feel free to add it.

But still, is anything ever passing True to indexstoredb.run_build_script_helper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don’t think we should need it but I don’t feel super strongly about it. If you have strong opinions on it being useful, feel free to add it.

I'd like to have it, in case I need to turn on cleaning for my local builds at some point, as I did recently.

But still, is anything ever passing True to indexstoredb.run_build_script_helper?

No this cleaning flag is set to false in this pull. The idea is just to have the flag available and working, so I can set it to true manually when I need it for my local builds.

If you're okay with that, please review and we can get these two pulls in.

finagolfin added a commit to finagolfin/sourcekit-lsp that referenced this pull request Jul 19, 2024
…ave it actually do something

Instead, swiftlang/swift#75053 makes sure `build-script` doesn't pass in the flag by
default, so you can explicitly invoke it only when needed.
… the flag do nothing

Rather than make this change, swiftlang/sourcekit-lsp@37d003eb7 had the
`--no-clean` flag do nothing, which means the flag can't be used at all.
Instead, switch the flag to `--clean` in swiftlang/sourcekit-lsp#1558 and don't
invoke it by default.
@ahoppen
Copy link
Member

ahoppen commented Jul 22, 2024

@swift-ci Please smoke test

@ahoppen
Copy link
Member

ahoppen commented Jul 22, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit 111bc46 into swiftlang:main Jul 23, 2024
5 checks passed
@finagolfin finagolfin deleted the clean branch July 23, 2024 10:16
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.

2 participants