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

How to add andare in a custom build for planck? #957

Open
abhi18av opened this issue Jun 5, 2019 · 10 comments
Open

How to add andare in a custom build for planck? #957

abhi18av opened this issue Jun 5, 2019 · 10 comments

Comments

@abhi18av
Copy link

abhi18av commented Jun 5, 2019

Hi @mfikes, I was wondering whether it's possible to add other ClojureScript libraries like andare within a build and then have a version of planck with which all of these other libs could be used easily?

At a glance, I think that the project.clj and the bundle.cljs files would need to be updated for the adding andare - would this be correct?

@mfikes
Copy link
Member

mfikes commented Jun 5, 2019

@abhi18av Instead of project.clj, you'd need to update the deps.edn file at https://github.com/planck-repl/planck/blob/master/planck-cljs/deps.edn.

You'd need to update bundle.cljs for runtime namespaces, and also add lines to copy any macros files as in this https://github.com/planck-repl/planck/blob/master/planck-cljs/script/build.clj#L69

This would ultimately result in Andare being bundled in the Planck binary.

You could go further by AOT compiling the macros files and including the generated JavaScript, etc. See here https://github.com/planck-repl/planck/blob/master/script/build#L110 and the subsequent lines.

@mfikes
Copy link
Member

mfikes commented Jun 5, 2019

@abhi18av Another idea is to take a look at how Replete is built. It does bundle Andare.

@abhi18av
Copy link
Author

abhi18av commented Jun 5, 2019

Thanks @mfikes , let me try this out on a normal x86_64 machine first and then I'd move on to the ARM64 builds..

@abhi18av
Copy link
Author

abhi18av commented Jun 5, 2019

Just for the paper trail, here seems to be the relevant link in the replete repo
https://github.com/replete-repl/replete-android/blob/d27d54ef7854227582b0a416aa75c2fd6d8e6d7a/ClojureScript/replete/script/build#L48

@abhi18av
Copy link
Author

abhi18av commented Jun 7, 2019

Here's the fork/branch which I'm working on
https://github.com/abhi18av/planck/tree/abhi18av-with-andare

And here are the files which I've updated so far
abhi18av@37562e9

Next, I'll try and build this on the x86_64 machine.

@abhi18av
Copy link
Author

abhi18av commented Jun 7, 2019

I have built this previously and it worked fine but now, it seems there has been an error with the CMake config somewhere
Here's the log

Fetching Google Closure Compiler...
Cleaning up Google Closure Compiler archive...
Fetching Google Closure Library...
Cleaning up Google Closure Library archive...
### Building planck-cljs
### Building planck-c
### Bundling ClojureScript artifacts for 1st stage
Because this is a fast build, setting Closure Optimizations to NONE
Because this is a fast build, disabling AOT decoding of source maps
### Building 1st stage Planck binary
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  CMakeLists.txt:85 (pkg_check_modules)


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CURL
    linked by target "planck" in directory /projects/planck/planck-c

Build Failed. 

@mfikes
Copy link
Member

mfikes commented Jun 7, 2019

@abhi18av it looks like your build can't find libcurl

@abhi18av
Copy link
Author

abhi18av commented Jun 7, 2019

Yes @mfikes , you're right and I resolved that by using apt install libcurl4-openssl-dev still there seems to be an error here

root@vaani /projects/planck abhi18av-with-andare # ./script/build --fast
Fetching Google Closure Compiler...
Cleaning up Google Closure Compiler archive...
Fetching Google Closure Library...
Cleaning up Google Closure Library archive...
### Building planck-cljs
### Building planck-c
### Bundling ClojureScript artifacts for 1st stage
Because this is a fast build, setting Closure Optimizations to NONE
Because this is a fast build, disabling AOT decoding of source maps
### Building 1st stage Planck binary
Build Failed.
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  CMakeLists.txt:85 (pkg_check_modules)

I've made sure to run the ./script/clean before restarting the build. However, no worries for now I'll just build it locally as it does build fine on my laptop.

@mfikes , could you please confirm the changed files #957 (comment), whenever your have the opportunity?

@mfikes
Copy link
Member

mfikes commented Jun 7, 2019

@abhi18av I suspect you don't have pkg-config. See https://github.com/planck-repl/planck/wiki/Building

With respect to your changes, you typically want to make sure that all *.cljs files end up being included as a result of files in bundle.cljs and the copy-file operations only need to include files that won't be included this way (things like .clj macros files).

@abhi18av
Copy link
Author

abhi18av commented Jun 7, 2019

I understand @mfikes , thanks 👍

Let me try this out and get back to you.

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