Open calvinit opened 3 weeks ago
https://formulae.brew.sh/formula/embulk
It’s necessary to distinguish between different architectures here.
In theory, it should not need multiple bottles as the Java path replacement is done at install time. The bottle should be using a placeholder, e.g. @@HOMEBREW_JAVA@@
.
The issue appears to be combining dependencies into its variations isn't handled correctly for API.
When using a local tap, it seems okay, e.g.
❯ brew info embulk --json=v2 --variations | jq '.formulae[].dependencies'
[
"openjdk@21"
]
❯ arch -x86_64 brew info embulk --json=v2 --variations | jq '.formulae[].dependencies'
[
"openjdk@8"
]
❯ brew info embulk --json=v2 --variations | jq '.formulae[].variations.arm64_sequoia'
null
❯ brew info embulk --json=v2 --variations | jq '.formulae[].variations.sequoia'
{
"dependencies": [
"openjdk@8"
]
}
❯ arch -x86_64 brew info embulk --json=v2 --variations | jq '.formulae[].variations.arm64_sequoia'
{
"dependencies": [
"openjdk@21"
]
}
❯ arch -x86_64 brew info embulk --json=v2 --variations | jq '.formulae[].variations.sequoia'
null
However, the API data is generated based on single platform:
❯ curl -sL "https://formulae.brew.sh/api/formula/embulk.json" | jq '.dependencies'
[
"openjdk@21"
]
However, the API data is generated based on single platform:
That's a bug, but I wonder why it affects is in CI when we set HOMEBREW_NO_INSTALL_FROM_API
.
As workaround, can just use same OpenJDK on embulk
. I split dependency based on upstream status, but probably doesn't matter if we just use newer one.
For issue, could also be a general keg relocation problem. Would need to check on that code. The bottle itself has:
export JAVA_HOME="${JAVA_HOME:-@@HOMEBREW_JAVA@@}"
exec "${JAVA_HOME}/bin/java" -jar "@@HOMEBREW_CELLAR@@/embulk/0.11.5/libexec/embulk-0.11.5.jar" "$@"
So as long as bottle pour substitutes right path then it should have worked.
EDIT: Another possibility is if it is reading tab from manifest.
It is the manifest rather than JSON API. Sadly no idea how to handle this for accurate tab in all
bottle. May need something similar to Perl's preferred option.
Another idea is skipping manifest's tab if OS/arch doesn't match, though this may not work if we remove info based on https://github.com/Homebrew/brew/issues/17395
Tab from https://github.com/Homebrew/homebrew-core/pkgs/container/core%2Fembulk/290843166
"sh.brew.tab": "{ ... {\"full_name\":\"openjdk@21\",\"version\":\"21.0.5\",\"revision\":0,\"pkg_version\":\"21.0.5\",\"declared_directly\":true}],
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew doctor
Verification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Submit a PR to upgrade
openjdk@8
to version 1.8.0-432.What happened (include all command output)?
brew test --retry --verbose embulk
failed because it selected the incorrect version ofopenjdk@21
(it should actually selectopenjdk@8
on the Intel architecture):What did you expect to happen?
Select
openjdk@8
correctly (@@HOMEBREW_JAVA@@
).Or
Step-by-step reproduction instructions (by running
brew
commands)For more detailed logs, see here.