-
Notifications
You must be signed in to change notification settings - Fork 2k
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
helper package seems to be missing functions from 1.3.4 onwards #15074
Comments
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 🤔, 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. |
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/[email protected]/helper <- the helpers are present
https://pkg.go.dev/github.com/hashicorp/[email protected]/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
The text was updated successfully, but these errors were encountered: