Skip to content

Commit

Permalink
fix: add build tag when libpostal is linked / available
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Dec 19, 2024
1 parent bbfba4d commit a975289
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN go mod download
# Now copy the rest of the source code (frequently changes)
COPY . /src/
WORKDIR /src
RUN VERSION=${VERSION} make build-server
RUN VERSION=${VERSION} GOTAGS="-tags libpostal" make build-server

# Frontend build stage
FROM node:22-bookworm as frontend
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-openshift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RUN mkdir -p bin && \
chmod -R g=u .

USER 1001
RUN VERSION=${VERSION} make build-server
RUN VERSION=${VERSION} GOTAGS="-tags libpostal" make build-server

# Stage 3: Frontend build
FROM node:21-bookworm as frontend
Expand Down
8 changes: 3 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ install-libpostal:
./configure $(CONFIGURE_FLAGS) && \
make -j$(shell nproc || echo 4) && \
if [ "$(detected_OS)" = "Windows" ]; then \
make install && \
make download-models; \
make install; \
else \
$(SUDO) make install && \
$(SUDO) make download-models; \
$(SUDO) make install; \
fi

.PHONY: install install-linux install-macos install-windows install-libpostal
Expand All @@ -94,7 +92,7 @@ else
endif

build-server:
go build -buildvcs=false -ldflags "-X github.com/moov-io/watchman.Version=${VERSION}" -o ./bin/server github.com/moov-io/watchman/cmd/server
go build -buildvcs=false ${GOTAGS} -ldflags "-X github.com/moov-io/watchman.Version=${VERSION}" -o ./bin/server github.com/moov-io/watchman/cmd/server

.PHONY: check
check:
Expand Down
12 changes: 12 additions & 0 deletions pkg/address/address.go
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
//go:build !libpostal

package address

import (
"github.com/moov-io/watchman/pkg/search"
)

func ParseAddress(input string) search.Address {
var out search.Address

return out
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build libpostal

package address

import (
Expand Down

0 comments on commit a975289

Please sign in to comment.