-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
sqitch 1.3.1 (new formula) #129128
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
sqitch 1.3.1 (new formula) #129128
Conversation
Hrm. Sqitch installs templates in the etc directory. Maybe it needs to keep them in its own cellar directory? Not sure why it's only an issue on macOS 11 ARM64 tho. Suggestions? |
It builds with
Is the installer not allowed to write files to the path specified by the |
depends_on "libpq" | ||
depends_on "mysql-client" | ||
depends_on "perl" | ||
uses_from_macos "sqlite" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this from depends_on
at the recommendation of brew audit --new
, but as there is an sqlite formula that will install a newer version than on the OS, ISM it might be better kept depends_on
.
Based on the sqitchers/sqitch tap, it supports PostgreSQL, MySQL, and SQLite out of the box, and Snowflake, Exasol, and Vertica with ODBC via the installation of additional client libraries. Snowflake support could use the `snowflake-snowsql` formula, but it's Cask only. The caveat output points to a URL that describes how to install these additional dependencies, which will be updated appropriately by sqitchers/sqitch.org#13. The install method installs all Perl modules in the Cellar directory, which is useful for keeping everything together and avoiding conflicts with other Perl applications, but means that they must all be re-installed when upgrading to a new version. Not supported: Oracle and Firebase, since there are no formulas for Instant Client or the Firebase server (or clients). The URL emitted by the Caveat points users who need to manage Oracle or Firebase databases to the Sqitch tap.
# Download Module::Build and Menlo::CLI::Compat. | ||
cpm_args = %w[install --local-lib-contained instutil --no-test] | ||
cpm_args.push("--verbose") if verbose? | ||
system "cpm", *cpm_args, "Menlo::CLI::Compat", "Module::Build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be resources instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise it could be installing anything and we want versioned dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I'm working on something to generate it from that cpan file. I presume I can put additional dependencies required to build --HEAD
inside a if build.head?
block and they'll only be downloaded for head builds, yes?
def caveats | ||
<<~EOS | ||
This Sqitch install includes clients to manage Postgres, MySQL, and SQLite. | ||
See https://sqitch.org/download/macos/ to install the client libraries | ||
required to manage Snowflake, Exasol, and Vertica. Use the sqitchers/sqitch | ||
tap to manage Oracle or Firebird. | ||
EOS | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want external references here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm. Should I instead throw in a file and tell the user to read it for more details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of users skip the caveats, might be easier to just put something to this extend in your documentation.
end | ||
|
||
test do | ||
system bin/"sqitch", "--version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a test that exercises the some of the functionality of the app. Version checks or usage checks (foo --version or foo --help) are not sufficient, as explained in the formula cookbook.
In most cases, a good test would involve running a simple test case: run #{bin}/foo input.txt.
- Then you can check that the output is as expected (with assert_equal or assert_match on the output of shell_output)
- You can also check that an output file was created, if that is expected: assert_predicate testpath/"output.txt", :exist?
Some advice for specific cases:
- If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples.
- If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc.
- If the software cannot function without credentials, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected.
- Same if the software requires a virtual machine, docker instance, etc. to be running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could run ./Build test
there if you don't mind the overhead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it should be something a user would run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is more like an install test; no source here I presume. Will think about it.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Based on the sqitchers/sqitch tap, it supports PostgreSQL, MySQL, and SQLite out of the box, and Snowflake, Exasol, and Vertica with the installation of additional client libraries. Snowflake support could use the
snowflake-snowsql
formula, but it's Cask only. The caveat output points to a URL that describes how to install these additional dependencies, which will be updated appropriately by sqitchers/sqitch.org#13.The install method installs all Perl modules in the Cellar directory, which is useful for keeping everything together and avoiding conflicts with other Perl applications, but means that they must all be re-installed when upgrading to a new version.
Not supported: Oracle and Firebase, since there are no formulas for Instant Client or the Firebase server (or clients). The URL emitted by the Caveat points users who need to manage Oracle or Firebase databases to the Sqitch tap.
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?