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

In order to protect users of prebid-server that don't use CGO, add build flag #4058

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions modules/builder.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package modules

import (
fiftyonedegreesDevicedetection "github.com/prebid/prebid-server/v3/modules/fiftyonedegrees/devicedetection"
prebidOrtb2blocking "github.com/prebid/prebid-server/v3/modules/prebid/ortb2blocking"
)

// builders returns mapping between module name and its builder
// vendor and module names are chosen based on the module directory name
func builders() ModuleBuilders {
return ModuleBuilders{
"fiftyonedegrees": {
"devicedetection": fiftyonedegreesDevicedetection.Builder,
},
ret := ModuleBuilders{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is autogenerated by

go generate modules/modules.go

"prebid": {
"ortb2blocking": prebidOrtb2blocking.Builder,
},
}
addFiftyonedegreesDevicedetection(ret)
return ret
}
14 changes: 14 additions & 0 deletions modules/cgo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//go:build cgo

package modules

import (
fiftyonedegreesDevicedetection "github.com/prebid/prebid-server/v3/modules/fiftyonedegrees/devicedetection"
)

func addFiftyonedegreesDevicedetection(b ModuleBuilders) {
if b["fiftyonedegrees"] == nil {
b["fiftyonedegrees"] = make(map[string]ModuleBuilderFn)
}
b["fiftyonedegrees"]["devicedetection"] = fiftyonedegreesDevicedetection.Builder
}
13 changes: 0 additions & 13 deletions modules/fiftyonedegrees/devicedetection/no_cgo.go

This file was deleted.

7 changes: 7 additions & 0 deletions modules/no-cgo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build !cgo

package modules

func addFiftyonedegreesDevicedetection(b ModuleBuilders) {
// Do nothing - fiftyonedegrees module is not supported without cgo
}
Loading