Build libtool application with static linking to local components - libtool

I am working with an open-source application that uses libtool in its build process. I would like to statically link the local components of the application with the following intended benefits:
doesn't require libtool wrapper to launch
function calls aren't indirected by dynamic linking during debugging
avoid unintended dynamic linking to existing system-installed library
Is there a standard option to the build process that does this?
Due to dependencies on non-static system libraries I can't just use:
./configure LDFLAGS='-static'

Yes, it can be done! Use the --disable-shared option.
For example:
./configure --enable-debug --disable-shared
Now the generated executable is a directly executable binary rather than a libtool script.
This has the added benefit of roughly halving the build time.

Related

How to separate development and production environments in shadow-cljs?

I want to separate development and production environment variables for my shadow-cljs which is running in conjunction with a lein app through the Luminus template. My production environment is a docker container running on heroku.
It should work in a way that I can import a map, say config, and so that I can access the keys using (:some-key config), or something similar to this.
There is built-in support for separating release and dev configuration.
https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration
The "import a map and access by key" you are asking for is not supported by shadow-cljs and would be something a library would provide instead.
I also do not recommend using environment variables to configure a build.
Also note that shadow-cljs configuration is about build time. If you want to access the "environment" at runtime you do not make it part of the build at all. Say you create a :node-script build running in node. You can just access js/process.env.SOME_ENV at runtime via normal code.

Services and env in manifest file?

I have a web (online calculator for an example) which developed by my fellow tem members. Now they want to deploy in PCF using manifests.
Languages used : python, php and javascipt.
I gone through the docs about pcf with manifest.yml
In that I don't have any idea about services and env.
What is that services and how can I find the services for the above project and also how can I find the environment variables?
And tell whether these fields are mandatory to run the project in PCF.
To your original question:
What is that services and how can I find the services for the above project and also how can I find the environment variables? And tell whether these fields are mandatory to run the project in pcf.
Does your app require any services to run? Services would be things like a database or message queue. If it does not, then you do not need to specify any services in your manifest. They are optional.
Similarly, for environment variables, you would only need to set them if they are required to configure your application. Otherwise, just omit that section of your manifest.
At the end of the day, you should talk with whomever developed the application or read the documentation they produce as that's the only way to know what services or environment variables are required.
In regards to your additional questions:
1)And also I have one more query...like in our application we used python ok! In that we use lots of pacakages say pandas,numpy,scipy and so on...how can I import all the libraries into the PCF ??? Buildpacks will contain version only right?
Correct. The buildpack only includes Python itself. Your dependencies either need to be installed or vendored. To do this for Python, you need to include a requirements.txt file. The buildpack will see this and use pip to install your dependencies.
See the docs for the Python buildpack which explains this in more detail: https://docs.cloudfoundry.org/buildpacks/python/index.html#pushing_apps
2)And also tell me what will be the path for my app name if Java I can enclose jar files
For Java apps, you need to push compiled code. That means, you need to run something like mvn package or gradle assemble to build your executable JAR or WAR file. This should be a self contained file that has everything necessary to run your app, compile class files, config, and all dependent JARs.
You then run cf push -p path/to/my-app.jar (or WAR, whatever you build). The cf cli will take everything in the app and push it up to Cloud Foundry where the Java buildpack will install things like the JVM and possibly Tomcat so you app can run.
what should I do for application devloped using pyhton , JavaScript and php....
You can use multiple buildpacks. See the instructions here.
https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html
In short, you can have as many buildpacks as you want. The last buildpack in the list is special because that is the buildpack which will set the start command for your application (although you can override this with cf push -c if necessary). The non-final buildpacks will run and simply install dependencies.
3) we were using postgresql how can I use this in pcf with my app
Run cf marketplace and see if there are any Postgres providers in your Marketplace. If there is one, you can just do a cf create-service <provider> <plan> <service name> and the foundation will create a database for you to use. You would then run a cf bind-service <app> <service name> to bind the service you create to your app. This will generate credentials and pass them along to your app when it starts. You app can then read the credentials out of VCAP_SERVICES and use them to make connections to the database.
See here for more details:
https://docs.cloudfoundry.org/devguide/services/application-binding.html
https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES

Compile production assets from clojurescript with figwheel

We currently use cljsbuild to compile our clojurescript source into the assets used in production, but during development, we use lein-figwheel. Both cljsbuild and figwheel are constantly watching for changes of the source and recompile when necessary.
I was wondering, whether it's possible to use just one tool for both, preferably in the same process.
We're fine with switching tools, especially Figwheel Main. Each file change should just compile:
a js with advanced optimizations to be used in production
live reload the code in the browser as figwheel & figwheel main do it
I found this in the figwheel documentation, but it requires manual work like cleaning targets and running the build on demand with special options.
I recently switched from lein-figwheel to figwheel-main (using Clojure Deps in place of lein). Figwheel-Main is much simpler, easier & better (basically it is "Figwheel 2.0").
Figwheel-Main can be used for both the auto-reloading during development and for compiling a single my-app.js output file for deployment or testing. You can use either :whitespace or :advanced compiler optimization level to get a single static *.js output file. I use :whitespace to generate an output file for standalone testing purposes (in Docker with chrome --headless) or :advanced for the final production build.
As a side benefit, Clojure Deps is better than lein for managing conflicting dependency versions.

Setting mem configure option in TCL build script

I need to build Activestate TCL for Ubuntu 18.04 with memory option enabled, "--enable-symbols=mem flag to the configure script" but there is no configure script in my download, only these, which don't have a "configure" line in them.
license-at8.6-thread.
update_check
komodo_download
payload
README-8.6-thread.txt
pdemos
install_welcome.txt
install.tcl
install.sh
install_lib.tcl
install_images
MANIFEST_at8.6.txt
install_data.tcl
Can someone describe how to add the switch described above for Ubuntu?
.
In order to set the mem option, you'll need to compile Tcl from source. To do that you'll need to get a C build chain (especially a C compiler such as gcc or clang, and make to act as a build orchestrator) and the Tcl (and Tk) source code for the version you want to build. The official location for releases of Tcl sources is on SourceForge:
https://sourceforge.net/projects/tcl/files/Tcl/
Pick the version you need and the download package you prefer (ZIP or compressed Tar archive).
Once you've downloaded and unpacked the Tcl code, change into the appropriate directory within the distribution (e.g., unix for Linux builds) and run the configure script inside; it's that script that you pass the --enable-symbols=mem option to.
ActiveTcl is essentially built the same way (except without symbols at all; it's a production distribution after all). It's main distinguishing feature is that it is set up with access to lots of extra packages to go with it. The same goes for most Linux distributions' own tcl packages. They're all production distributions and aren't configured for memory debugging precisely because that adds a lot of overhead to the code (both time and space).

Gulp.js - Deploying MYSQL database

For my current project I use Grunt as a full-deploy system. Checking/compiling all assets, cleaning cache, and deploying database. Now I am looking at Gulp.js. Everyone says, it has much more readable configuration file and it executes a bit faster. The only thing is missing for me - database deployment. With Grunt, I am using grunt-deployments package. Is there something like that for Gulp? Or should I write my own package?
Gulp is a build system. Build and Deploy are separate sets of activities. Steaming is good for building lots of smallish files like in an assembly line in manufacturing. For deployment, synchronous code (nodejs is not good at synchronous, atleast until v0.12) is good.
I use powershell(windows) or shell/chef/ansible(linux) for deployment/setup/etc, which call gulp for building assets pipeline.
Gulp is mostly targeted towards assets pipeline in other tech-stacks, and full build system for node-js techstack.
However, If you have only trivial deploy tasks, then consider using async.series() from async package and use regular node-js code to do the deployments. Accept and call the done callback when you are done in the gulp task.