Closed CarbonCollins closed 1 year ago
Hi @CarbonCollins; Nomad v1.3.4 updated the version of Go used for building to v1.19. Among a number of features and fixes, this gave Nomad the ability to use generics which allowed us to remove the per-type pointer functions for a generic function.
I think you can either upgrade the tooling used to build the plugin to Go 1.19 and update the function calls to use the new generic function, or create your own helper functions to handle to pointer creation for each type needed. Apologies for causing a little extra work here. While are careful of all code modification, the helper package is not intended to be a general purpose SDK outside the Nomad codebase.
Hi @jrasell Thats good to know! ill update the plugin to use the Go 1.19 toolchain as a resolution to this issue there :)
Just as a followup question, I'm mainly using the helper package as from memory the driver skeleton used it :thinking:, my question being should I fully remove any dependency on the helper package to prevent things like this happening again?
I think the pointer function within the helper package will be very stable and therefore safe to use.
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Nomad version
1.3.4 to 1.4.2
Operating system and Environment details
Go build environment for plugin building
Issue
From 1.3.4 onwards the
github.com/hashicorp/nomad/helper
go package seems to be missing several helper functions including:helper.StringToPtr helper.Int64ToPtr
among a few others and I didn't see a change log entry detailing this change? have these been accidentally removed or did I just miss a deprecation message?
This also seems to be the case in the go helper package docs here: https://pkg.go.dev/github.com/hashicorp/nomad@v1.3.3/helper <- the helpers are present https://pkg.go.dev/github.com/hashicorp/nomad@v1.3.4/helper <- the helpers are no longer present
As some extra info I found this while attempting to debug an issue raised with the USB plugin here: https://gitlab.com/CarbonCollins/nomad-usb-device-plugin/-/issues/29
Reproduction steps
Within the USB plugin:
github.com/hashicorp/nomad
tov1.4.2
in the USB plugin dependenciesmake build
undefined: helper.StringToPtr
errorsExpected Result
When building the USB plugin using
make build
with the latest version of nomad I should get a working build with no other code changes.Actual Result
When building the USB plugin using
make build
with the latest version of nomad as a dependnency I get:Job file (if appropriate)
n/a
Nomad Server logs (if appropriate)
n/a
Nomad Client logs (if appropriate)
n/a