User's banner
Avatar

bahmanm

bahmanm@lemmy.ml
Joined
109 posts โ€ข 235 comments

Husband, father, kabab lover, history buff, chess fan and software engineer. Believes creating software must resemble art: intuitive creation and joyful discovery.

๐ŸŒŽ linktr.ee/bahmanm

Views are my own.

Direct message

Thanks for the pointer! Very interesting. I actually may end up doing a prototype and see how far I can get.

permalink
report
parent
reply

Thanks. Bookmarked the site. Also noted RE age.

permalink
report
parent
reply

Thanks. Iโ€™d go the online route if my kid was a few years older but given the age, I believe in-person lessons are the best for now.

permalink
report
parent
reply

Thanks. Bookmarked.

permalink
report
parent
reply

UPDATE: lemmy.ml is now on lemmy-meter ๐Ÿฅณ

permalink
report
reply

Good question!

IMO a good way to help a FOSS maintainer is to actually use the software (esp pre-release) and report bugs instead of working around them. Besides helping the project quality, Iโ€™d find it very heart-warming to receive feedback from users; it means people out there are actually not only using the software but care enough for it to take their time, report bugs and test patches.

permalink
report
reply

โ€œAnnouncmentโ€

It used to be quite common on mailing lists to categorise/tag threads by using subject prefixes such as โ€œANNโ€, โ€œHELPโ€, โ€œBUGโ€ and โ€œRESOLVEDโ€.

Itโ€™s just an old habit but I feel my messages/posts lack some clarity if I donโ€™t do it ๐Ÿ˜…

permalink
report
parent
reply

Whatโ€™s /s supposed to do in this context? ๐Ÿค” It looks like a Windoze/.NET command line option.

permalink
report
parent
reply

I usually capture all my development-time โ€œautomationโ€ in Make and Ansible files. I also use makefiles to provide a consisent set of commands for the CI/CD pipelines to work w/ in case different projects use different build tools. That way CI/CD only needs to know about make build, make test, make package, โ€ฆ instead of Gradle/Maven/โ€ฆ specific commands.

Most of the times, the makefiles are quite simple and donโ€™t need much comments. However, there are times thatโ€™s not the case and hence the need to write a line of comment on particular targets and variables.

permalink
report
parent
reply

Can you provide what you mean by check the environment, and why youโ€™d need to do that before anything else?

One recent example is a makefile (in a subproject), w/ a dozen of targets to provision machines and run Ansible playbooks. Almost all the targets need at least a few variables to be set. Additionally, I needed any fresh invocation to clean the โ€œbuildโ€ directory before starting the work.

At first, I tried capturing those variables w/ a bunch of ifeqs, shells and defines. However, I wasnโ€™t satisfied w/ the results for a couple of reasons:

  1. Subjectively speaking, it didnโ€™t turn out as nice and easy-to-read as I wanted it to.
  2. I had to replicate my (admittedly simple) clean target as a shell command at the top of the file.

Then I tried capturing that in a target using bmakelib.error-if-blank and bmakelib.default-if-blank as below.

##############

.PHONY : ensure-variables

ensure-variables : bmakelib.error-if-blank( VAR1 VAR2 )
ensure-variables : bmakelib.default-if-blank( VAR3,foo )

##############

.PHONY : ansible.run-playbook1

ansible.run-playbook1 : ensure-variables cleanup-residue | $(ansible.venv)
ansible.run-playbook1 : 
	...

##############

.PHONY : ansible.run-playbook2

ansible.run-playbook2 : ensure-variables cleanup-residue | $(ansible.venv)
ansible.run-playbook2 : 
	...

##############

But this was not DRY as I had to repeat myself.

Thatโ€™s why I thought there may be a better way of doing this which led me to the manual and then the method I describe in the post.


running specific targets or rules unconditionally can lead to trouble later as your Makefile grows up

That is true! My concern is that when the number of targets which donโ€™t need that initialisation grows I may have to rethink my approach.

Iโ€™ll keep this thread posted of how this pans out as the makefile scales.


Even though Iโ€™ve been writing GNU Makefiles for decades, I still am learning new stuff constantly, so if someone has better, different ways, Iโ€™m certainly up for studying them.

Love the attitude! Iโ€™m on the same boat. I could have just kept doing what I already knew but I thought a bit of manual reading is going to be well worth it.

permalink
report
parent
reply