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

Reflect scripts as bb tasks #63

Merged
merged 4 commits into from
Oct 12, 2022
Merged

Conversation

ikappaki
Copy link
Contributor

@ikappaki ikappaki commented Oct 10, 2022

Hi,

could you please review patch to reflect all script/s as bb tasks. This is part of #61.

I've noticed there were a couple of graalvm options missing from the windows compile script (-H:IncludeResources=DEPS_CLJ_VERSION and --no-server), I used the bash compile script as a reference. I've also removed the command to install graalvm's native image program, because I feel this is more of a workstation setup rather than the responsibility of the compile task ...

If this is approved, I would like to update the CI jobs next to reference the bb tasks and remove the old scripts from the codebase. I could either do this as part of this PR or raise a new one.

Thanks,

@borkdude
Copy link
Owner

@ikappaki I prefer to put tasks that are longer than say 3 lines, as functions in a bb/tasks.clj file since it's more convenient to edit code a Clojure file (since clj-kondo and clojure-lsp, etc work better there). Can we do that?

The --no-server argument is deprecated now I think, but I could be wrong.

@borkdude
Copy link
Owner

A small example of that here:

https://github.com/squint-cljs/squint/blob/main/bb.edn

bb/tasks.clj Show resolved Hide resolved
bb/tasks.clj Show resolved Hide resolved
@ikappaki
Copy link
Contributor Author

ikappaki commented Oct 10, 2022

@ikappaki I prefer to put tasks that are longer than say 3 lines, as functions in a bb/tasks.clj file since it's more convenient to edit code a Clojure file (since clj-kondo and clojure-lsp, etc work better there). Can we do that?

Sure, I've just move the biggest offender to bb/tasks.cljs (I've kept a 4 line tasks in bb.edn just to be alongside the other peers).

The --no-server argument is deprecated now I think, but I could be wrong.

I plan to upgrade to the latest graalvm version with your blessing after the CI move to bb, so if you agree to it I'll make sure I'll look out for dead options.

@borkdude
Copy link
Owner

Sounds good

@borkdude
Copy link
Owner

borkdude commented Oct 11, 2022

Can you activate this script in CI, so it can be tested before merging?

@ikappaki
Copy link
Contributor Author

ikappaki commented Oct 11, 2022

Can you activate this script in CI, so it can be tested before merging?

Hi @borkdude,

I've replaced the test/compile scripts with bb tasks in the CI scripts, and removed them from the codebase (since they are tested to work). May I leave the script/bump_version.clj and script\changelog.clj for you to test, since I'm not sure why to do it?

The next step after this PR is to consolidate the builds under one CI system. Given there could be different argument quoting behavior between the supported java version, I'm thinking of building a matrix of [macos, ubuntu, windows]x[jdk 1.8, 11, 15, 17] to test all possible outcomes. I can do this in a separate PR. Do you have a particular preference on the CI system to use? appveyor is very hard for me to work (it's just that you make a change to test and it is more likely to wait for several minutes before it is started). circleci is good, but not sure how to do matrices efficiently, I have to repeat the job definitions. github actions I am more proficient with and it has high grid availability, but I don't know until this will be the case. What do you think?

(I've also sneaked in an update to .gitignore for Emacs temp files)

Thanks,

appveyor.yml Outdated
@@ -16,9 +16,12 @@ cache:

build_script:
- cmd: >-
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat', 'lein.bat')"
choco install lein
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not a fan of making changes to CI builds if they are not necessary. The powershell command worked before. Switching to choco may slow down stuff or additional stuff may be installed which causes new unforeseen issues. The reason I'm saying this is that I've used brew on macOS CI and this was very very slow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I forgot to mention that I did that because the compile script only looks in PATH to locate lein, and not in the CWD as per the above installation does. I had a few futile attempts trying to add it in the appveyor PATH and in the end settled at using choco (courtesy of grep.app).

Understood. I've reverted the change and updated the compile task to look at CWD for lein. There is an inherent difficulty trying to locate windows executable programs/scripts outside of PATH without mentioning the extension. I might open a babashka.fs to discuss the problem.

Thanks

Copy link
Owner

Choose a reason for hiding this comment

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

Thank you for explaining!

@borkdude
Copy link
Owner

I'm only using script/bump_version.clj and script\changelog.clj locally, so it's ok to not touch those.

@borkdude
Copy link
Owner

The next step after this PR is to consolidate the builds under one CI system.

I'm fine with adding Github actions for the test matrix. If the native build is sufficiently fast, compared to appveyor, we could switch, but let's leave it in for now.

`bb compile` should also search for lein in the CWD for compatibility
with the appveyor job.
@borkdude borkdude merged commit 959477b into borkdude:master Oct 12, 2022
@borkdude
Copy link
Owner

Thanks!

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