Goland tip of the day: when Make run configurations don't find go

Submitted by Frederic Marand on Fri, 2018-10-12 13:31

The problem

In a Goland 2018.3 EAP run configuration, a Makefile run configuration finds the go binary on macOS, but not on Ubuntu, causing make targets like this one to fail:
client/test.wasm: client/main.go
# Building WASM
GOARCH=wasm GOOS=js go build -o client/test.wasm client/main.go

/usr/bin/make -f (some edited path)/Makefile client/test.wasm
/bin/sh: 1: go: not found
make: *** [client/test.wasm] Error 127

Simple enough to fix...

Tip of the day: how to compare Guitar Pro files

Submitted by Frederic Marand on Sun, 2018-10-07 11:21

The problem

When working on compositions in a multi-member band (currently 5 in AnotherDay, each member tends to create their own Guitar Pro files to avoid overwriting the previous versions created by other band members. And .gp files tend to accumulate for the same song. At which point I start to wonder: "I know there's this riff in one of the versions, but which one ?" or "Are these two files really different or could I just merge them by editing a few notes, or remove one altogether ?"

Munin plugins for Beanstalkd in PHP are now 1.0.0

Submitted by Frederic Marand on Sun, 2018-08-12 21:16

In 2014, I created a PHP version of the Munin plugins for Beanstalkd introduced by AirBnB, but originally created in Python.

Fast forward four years, and after being adapted for compliances with the PHP-FIG PSR1, PSR2 and PSR12 standards, as well as the Zend coding standards, and with extra documentation, I published the first "stable" version 1.0.0 of the package today under the Apache APL-2.0 license.

How to debug Drupal 8 Functional tests with XDebug

Submitted by Frederic Marand on Sun, 2018-07-29 21:12

The problem

While converting the old-style functional tests in the MongoDB project from WebTestBase to BrowserTestBase, I stumbled upon a problem: after following the drupal.org instructions to run PHPunit tests from PhpStorm, doing step-by-step debugging in the IDE worked nicely, but then stopped at the first $this->drupalLogin(); call, returning a 404 after a very long delay, although the same call running without debugging worked normally. What could be going on ?

Drupal tip of the day: PHPUnit 6 tests with composer-project/drupal-project

Submitted by Frederic Marand on Sat, 2018-07-21 09:31

The problem

When trying to run PHPUnit tests on the MongoDB contrib module for the soon-ready 8.2.0 version, I recently starting encountering this error:

PHPUnit testing framework version 6 or greater is required when running on PHP 7.0 or greater.
Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this.

OK, no big deal, let's just run that command.

# From $PROJECT/web/core directory
$ ../../vendor/bin/composer run-script drupal-phpunit-upgrade

In RunScriptCommand.php line 89:

Script "drupal-phpunit-upgrade" is not defined in this package
run-script [--timeout TIMEOUT] [--dev] [--no-dev] [-l|--list] [--] [] []...
$

Hmm, so I need that command but it is not defined in composer.json. So where is it ?

I'm going to Drupal Europe and so should you

Submitted by Frederic Marand on Wed, 2018-03-07 18:25

So DrupalCon Europe is out for 2018. But that does not mean a EU-level event does not exist, to bind the community beyond the specialization of DevDays, FrontEnd United, CxO, GovDays, and all the DrupalCamps. Drupal Europe is that event, and to support the community who wants to prove a large Drupal conference can reasonably happen after all the trouble the Drupal Association had with it, the best way it to register for the conference.

ASAP.

So join me there :-) Drupal Europe early supporter badge

Tip of the day: how to debug Composer scripts with XDebug and PhpStorm

Submitted by Frederic Marand on Sat, 2018-01-27 11:51

The problem: XDebug doesn't work for Composer scripts

PhpStorm is quite convenient to debug scripts with XDebug (do you support Derick for giving us XDebug ?): just add a "Run/Debug configuration", choosing the "PHP Script" type, give a few parameters, and you can start debugging your PHP CLI scripts, using breakpoints, evaluations, etc.

Wonderful. So now, let's define such a configuration to debug a Composer script, say a Behat configuration generator from site settings for some current Drupal 8 project. Apply the configuration, run it in debug mode, and ....

...PhpStorm doesn't stop, the script runs and ends, and all breakpoints were ignored. How to actually use breakpoints in the IDE ?