Skip to content

Commit bfb9de2

Browse files
authored
fix(just): properly handle multiple tags (#13734)
* fix(just): properly handle multiple tags * chore(just): rename just/ -> justfiles/ The current behavior is confusing for people who don't have `just` installed: instead of a recognizable "command not found", they could see a "Permission denied" (if . is in the PATH I suppose).
1 parent 0d705b1 commit bfb9de2

File tree

29 files changed

+28
-28
lines changed

29 files changed

+28
-28
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# provide JUSTFLAGS for just-backed targets
2-
include ./just/flags.mk
2+
include ./justfiles/flags.mk
33

44
BEDROCK_TAGS_REMOTE?=origin
55
OP_STACK_GO_BUILDER?=us-docker.pkg.dev/oplabs-tools-artifacts/images/op-stack-go:latest
File renamed without changes.
File renamed without changes.

just/flags.mk justfiles/flags.mk

File renamed without changes.

just/git.just justfiles/git.just

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ GITDATE := env('GITDATE', `git show -s --format='%ct' 2> /dev/null|| true`)
66

77
_PROJECT := shell("basename $1", justfile_directory())
88

9-
_ALL_TAGS := shell("git tag --points-at $1 2> /dev/null || true", GITCOMMIT)
9+
_ALL_TAGS := shell("git tag --sort=creatordate --points-at $1 2> /dev/null || true", GITCOMMIT)
1010

11-
_PROJECT_TAGS := shell("echo $1 | grep ^$2/ | sed s:$2/:: | sort -V", _ALL_TAGS, _PROJECT)
11+
_PROJECT_TAGS := shell("echo $1 | grep ^$2/ | tr ' ' '\n' | sed s:$2/:: | sort -V", _ALL_TAGS, _PROJECT)
1212

13-
_PREFERRED_TAG := shell("echo $1 | grep -v -- '-rc' | tail -n 1", _PROJECT_TAGS)
13+
_PREFERRED_TAG := shell("echo $1 | tr ' ' '\n' | grep -v -- '-rc' | tail -n 1", _PROJECT_TAGS)
1414

15-
_LAST_TAG := shell("echo $1 | tail -n 1", _PROJECT_TAGS)
15+
_LAST_TAG := shell("echo $1 | tr ' ' '\n' | tail -n 1", _PROJECT_TAGS)
1616

1717
# Find version tag, prioritizing non-rc release tags
1818
VERSION := shell('if [ -z "$1" ]; then

just/go.just justfiles/go.just

File renamed without changes.

op-alt-da/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := da-server clean test
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-alt-da/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

op-batcher/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-batcher clean test fuzz
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-batcher/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

op-chain-ops/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := ecotone-scalar receipt-reference-builder test op-deployer fuzz sync-standard-version
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-chain-ops/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_VERSION_META_STR := if VERSION_META != "" { "+" + VERSION_META } else { "" }

op-challenger/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-challenger clean test fuzz visualize
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-challenger/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_VERSION_META_STR := if VERSION_META != "" { "+" + VERSION_META } else { "" }

op-conductor/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-conductor clean test generate-mocks
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-conductor/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

op-dispute-mon/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-dispute-mon clean test
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-dispute-mon/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

op-node/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-node clean test fuzz generate-mocks readme
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-node/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

op-proposer/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-proposer clean test
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-proposer/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

op-service/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := test generate-mocks fuzz
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-service/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Run tests
44
test: (go_test "./...")

op-supervisor/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-supervisor clean test
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-supervisor/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

op-wheel/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
DEPRECATED_TARGETS := op-wheel
22

3-
include ../just/deprecated.mk
3+
include ../justfiles/deprecated.mk

op-wheel/justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../just/go.just'
1+
import '../justfiles/go.just'
22

33
# Build ldflags string
44
_LDFLAGSSTRING := "'" + trim(

ops/docker/op-stack-go/Dockerfile.dockerignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
!/op-alt-da
2121
!/go.mod
2222
!/go.sum
23-
!/just
23+
!/justfiles
2424
!/mise.toml

0 commit comments

Comments
 (0)