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 get packer to use "dev" version of plugin #92

Open
deepankarsharma opened this issue Feb 20, 2023 · 2 comments
Open

How to get packer to use "dev" version of plugin #92

deepankarsharma opened this issue Feb 20, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@deepankarsharma
Copy link

The GNUmakefile supplied with this project helpfully provides a dev target that builds the plugin and copies it to ~/.packer.d/plugins. However I am currently unable to get packer to use that generated version.

Here is what "packer-plugin-lxdapi describe" returns for me
{"version":"0.0.4-dev","sdk_version":"0.3.1","api_version":"x5.0","builders":["builder"],"post_processors":[],"provisioners":[],"datasources":[]}

Here is the output from packer when I try to use my plugin. You can see that it finds the plugin under "/home/dman/.packer.d/plugins/packer-plugin-lxdapi". However I cant seem to find a packer invocation / version specification where I could coax packer into using this locally built packer plugin over the ones that are uploaded from github.

Could you please clarify what the local development workflow for plugins should look like?

2023/02/20 04:05:38 [INFO] Packer version: 1.8.5 [go1.18.9 linux amd64] 2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d 2023/02/20 04:05:38 [TRACE] discovering plugins in /usr/bin 2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d 2023/02/20 04:05:38 [TRACE] discovering plugins in /home/dman/.packer.d/plugins 2023/02/20 04:05:38 [DEBUG] Discovered plugin: lxdapi = /home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.2_x5.0_linux_amd64 2023/02/20 04:05:38 [DEBUG] Discovered plugin: lxdapi = /home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.4_x5.0_linux_amd64 2023/02/20 04:05:38 [INFO] found external [builder] builders from lxdapi plugin 2023/02/20 04:05:38 [DEBUG] Discovered plugin: lxdapi = /home/dman/.packer.d/plugins/packer-plugin-lxdapi 2023/02/20 04:05:38 [INFO] found external [builder] builders from lxdapi plugin 2023/02/20 04:05:38 [TRACE] discovering plugins in . 2023/02/20 04:05:38 [INFO] PACKER_CONFIG env var not set; checking the default config file path 2023/02/20 04:05:38 [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/dman/.packerconfig 2023/02/20 04:05:38 [WARN] Config file doesn't exist: /home/dman/.packerconfig 2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d 2023/02/20 04:05:38 [INFO] Setting cache directory: /home/dman/.cache/packer 2023/02/20 04:05:38 Old default config directory found: /home/dman/.packer.d 2023/02/20 04:05:38 [TRACE] listing potential installations for "github.com/deepankarsharma/lxdapi" that match "0.0.4-dev". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin/packer", ".", "/home/dman/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0001fab80)}}}} 2023/02/20 04:05:38 [TRACE] version "v0.0.2" of file "/home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.2_x5.0_linux_amd64" does not match constraint "0.0.4-dev" 2023/02/20 04:05:38 [TRACE] version "v0.0.4" of file "/home/dman/.packer.d/plugins/github.com/deepankarsharma/lxdapi/packer-plugin-lxdapi_v0.0.4_x5.0_linux_amd64" does not match constraint "0.0.4-dev"

@deepankarsharma
Copy link
Author

Commenting the "packer" block in the example causes the development plugin to be loaded. I am unblocked now, but leaving ticket open in case you want to use this to update the documentation.

@nywilken
Copy link
Contributor

nywilken commented Apr 7, 2023

Glad you were able to unblock yourself @deepankarsharma. This is a know limitation of using the required_plugins block with dev binaries, and one we need to document. I'll keep this open for visibility and close once we update our plugin developer documentation. Cheers.

@nywilken nywilken added the documentation Improvements or additions to documentation label Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants