Skip to content

Commit

Permalink
prometheus: update to 3.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanasdev000 authored and TinfoilSubmarine committed Dec 6, 2024
1 parent ecf0127 commit 9dd04db
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
34 changes: 34 additions & 0 deletions srcpkgs/prometheus/patches/atomic-alignment.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/tsdb/chunks/head_chunks.go b/tsdb/chunks/head_chunks.go
index 876b42c..3835c48 100644
--- a/tsdb/chunks/head_chunks.go
+++ b/tsdb/chunks/head_chunks.go
@@ -191,13 +191,14 @@ func (f *chunkPos) bytesToWriteForChunk(chkLen uint64) uint64 {
// ChunkDiskMapper is for writing the Head block chunks to disk
// and access chunks via mmapped files.
type ChunkDiskMapper struct {
+ // moved to beginning of struct to avoid 32-bit atomic alignment issues
+ curFileOffset atomic.Uint64 // Bytes written in current open file.
// Writer.
dir *os.File
writeBufferSize int

curFile *os.File // File being written to.
curFileSequence int // Index of current open file being appended to. 0 if no file is active.
- curFileOffset atomic.Uint64 // Bytes written in current open file.
curFileMaxt int64 // Used for the size retention.

// The values in evtlPos represent the file position which will eventually be
diff --git a/util/testutil/context.go b/util/testutil/context.go
index 0c9e0f6..02a06e3 100644
--- a/util/testutil/context.go
+++ b/util/testutil/context.go
@@ -49,8 +49,8 @@ func (c *MockContext) Value(interface{}) interface{} {
// MockContextErrAfter is a MockContext that will return an error after a certain
// number of calls to Err().
type MockContextErrAfter struct {
- MockContext
count atomic.Uint64
+ MockContext
FailAfter uint64
}

18 changes: 13 additions & 5 deletions srcpkgs/prometheus/template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Template file for 'prometheus'
pkgname=prometheus
version=2.53.1
revision=2
version=3.0.1
revision=1
build_style=go
go_import_path="github.com/prometheus/prometheus"
go_package="github.com/prometheus/prometheus/cmd/prometheus github.com/prometheus/prometheus/cmd/promtool"
Expand All @@ -19,18 +19,28 @@ license="Apache-2.0, MIT"
homepage="https://prometheus.io/"
changelog="https://raw.githubusercontent.com/prometheus/prometheus/master/CHANGELOG.md"
distfiles="https://github.com/prometheus/prometheus/archive/v${version}.tar.gz"
checksum=6a36ad9fd6ce2813c78aab1da98d7725143bcb73e4fe1e2597c873537f7072af
checksum=bd40fd54d5a8f63cbbf5355ee056d23efce29c4af3fbf3fd754238c5d2a27425

system_accounts="_prometheus"

make_dirs="/var/lib/prometheus 700 _prometheus _prometheus"

if [ "${XBPS_BUILD_ENVIRONMENT}" != "void-packages-ci" ]; then
make_check_args+="-skip (TestQueryLog|TestDelayedCompaction)"
fi

pre_build() {
# Need to patch node fs to avoid using too many file descriptors
(cd web/ui && yarn add --dev -W [email protected])
echo "require('graceful-fs').gracefulify(require('fs'));" \
> "${wrksrc}/web/ui/use-graceful-fs.js"
export NODE_OPTIONS="--require ${wrksrc}/web/ui/use-graceful-fs.js"

# rollup doesn't support native i686, use wasm instead
if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
(cd web/ui && npm install --override rollup@npm:@rollup/wasm-node@latest)
fi

CGO_ENABLED=0 GOARCH= make assets assets-compress
}

Expand All @@ -39,8 +49,6 @@ post_install() {
vmkdir etc/prometheus
vmkdir usr/share/doc/prometheus
vmkdir usr/share/examples/prometheus
vcopy consoles etc/prometheus
vcopy console_libraries etc/prometheus
vcopy documentation/examples/* usr/share/examples/prometheus/
vcopy documentation/examples/prometheus.yml etc/prometheus/
vcopy documentation/images usr/share/doc/prometheus/
Expand Down

0 comments on commit 9dd04db

Please sign in to comment.