unit icon indicating copy to clipboard operation
unit copied to clipboard

Docker: Add a new target for generic language versions

Open ac000 opened this issue 1 year ago • 3 comments

You can use the Docker Makefile to create dockerfiles for specific language environments, e.g

$ make build-python3.12 VERSIONS_python=3.12

However this breaks when trying to do something like

$ make build-php8.3.0RC6 VERSIONS_php=8.3.0RC6 VARIANT_php=cli

This breaks due to the RC in the version, due to how we're trying to parse out the module name from the version string, we strip out anything that is a 0-9 or a . or -.

That works for 'python3.12' leaving 'python'. However for 'php8.3.0RC6' that leaves 'phpRC'.

After spending some time on this, the best (and simplest) solution I could come up with, that doesn't break existing usage, is to create a new make target for this.

So the above now becomes

$ make gen-php8.3.0RC6 MODULE=php VERSIONS_php=8.3.0RC6 VARIANT_php=cli

The new target is gen- and you need to specify the language module.

ac000 avatar Jan 19 '24 21:01 ac000

It does seem to work fine - however I'm reluctant to that change since it's a mess from users' POV: why would I choose to use make gen- targets instead of make build- ones?

thresheek avatar Feb 09 '24 23:02 thresheek

It does seem to work fine - however I'm reluctant to that change since it's a mess from users' POV: why would I choose to use make gen- targets instead of make build- ones?

Because of the problem it addresses...

You can use the Docker Makefile to create dockerfiles for specific language environments, e.g

$ make build-python3.12 VERSIONS_python=3.12

However this breaks when trying to do something like

$ make build-php8.3.0RC6 VERSIONS_php=8.3.0RC6 VARIANT_php=cli

This breaks due to the RC in the version, due to how we're trying to parse out the module name from the version string, we strip out anything that is a 0-9 or a . or -.

That works for 'python3.12' leaving 'python'. However for 'php8.3.0RC6' that leaves 'phpRC'.

After spending some time on this, the best (and simplest) solution I could come up with, that doesn't break existing usage, is to create a new make target for this.

So the above now becomes

$ make gen-php8.3.0RC6 MODULE=php VERSIONS_php=8.3.0RC6 VARIANT_php=cli

The new target is gen- and you need to specify the language module.

ac000 avatar Feb 10 '24 01:02 ac000

Sure, but I mean it would be a mess to document and from user POV it's kinda weird to have two ways of doing the same thing.

(I don't have a good solution in hand though)

thresheek avatar Feb 10 '24 01:02 thresheek