24 Commits

Author SHA1 Message Date
Clemens Lang dc9b17c26a tests: Fix trace test to run in source (and skip if root)
This also means we no longer need to reinplace the macports user's
username into the test file, so there's no longer a need to generate it
using configure.
2026-04-12 14:29:41 +02:00
Joshua Root 0c24646347 Update .gitignore 2026-04-12 13:44:40 +10:00
Herby Gillot 227a37b749 tests: run test suite fully in-tree without depending on prefix
Add a test-specific tclsh wrapper (`tests/test-tclsh`) that extends the
vendor tclsh wrapper with all `src/` package directories on `TCLLIBPATH`,
allowing the test suite to find in-tree packages without anything
installed at the configured prefix.

Switch all test Makefiles from `$(TCLSH)` to `$(TEST_TCLSH)` so unit and
integration tests use the in-tree interpreter. Replace all references
to `${bindir}/port` and `${bindir}/portindex` with direct invocations of
the in-tree `src/port/port.tcl` and `src/port/portindex.tcl` via the test
tclsh wrapper.

Add `init_tmp_prefix` to all test files that call `mportinit`, creating a
throwaway prefix with `macports.conf`, `sources.conf`, and `share/macports`
data populated from the source tree rather than the installed prefix.
Set `extra_env TCLLIBPATH` in test `macports.conf` files so that
`mportinit`'s environment scrub does not strip `TCLLIBPATH`, which threads
need to resolve packages.

Reorder CI workflows to run `make test` before `make install`, since the
test suite no longer requires an installed prefix.

See: https://trac.macports.org/ticket/56016

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 03:39:35 +02:00
Clemens Lang ddf08fb887 src/port: Replace port-tclsh symlink with script
Tcl attempts to determine the path of its standard library relative to
the path of its binary, but does not expand symlinks when doing that.
`port-tclsh` thus inadvertently uses libraries from a MacPorts-installed
Tcl rather than the copies shipped with MacPorts.

See: https://trac.macports.org/ticket/64507
Closes: https://trac.macports.org/ticket/72359
2025-04-18 09:00:47 +00:00
Joshua Root 3c92893dda Avoid repeatedly building tcllibc and critcl
These build as part of the install command and don't seem to have
checks to skip this if nothing has been updated. So create a file to
indicate that they have already been destrooted.

Note that this means that manual cleaning or removing the .stamp file
is needed after changing the source of these vendored packages, which
should however hopefully be infrequent.
2025-02-14 05:57:27 +11:00
Joshua Root ed5e19f248 Exclude critcl pkgIndex.tcl files from gitignore 2025-02-10 22:28:38 +11:00
Joshua Root 7bf1511f72 Build and install tcllibc
This requires critcl, which is now included in vendor/. It is built and
used to build tcllibc, but critcl itself is not installed.
2025-02-05 02:19:27 +11:00
Joshua Root 3da9cd2a0d Use clonefile(2) in more places
A lot of file copies that we create are not subsequently modified,
especially in the destroot phase. This makes cloning a more efficient
alternative.

* Modified xinstall and 'file copy' Tcl commands to try cloning.
* Created a vendored copy of install(1) that tries cloning.
* Created a thin wrapper around cp(1) that adds the -c flag.
* If the build directory is on a filesystem that supports cloning, the
  configure.install option defaults to our install(1), and the
  directory containing our install and cp commands is added to the
  front of PATH, currently only during the destroot phase.

The code for all of the above is not built on systems that lack
clonefile(2). If cloning fails, everything will fall back to creating
a copy as previously done.
2024-08-28 00:24:25 +10:00
Clemens Lang 943cc71a28 keys: Add signify(1) public key for base
Add a new public key for use with signify(1) to verify downloaded
MacPorts base relases. Adjust the Makefile to install this key in
$prefix/share/macports/keys/base, so that we have a designated space for
additional keys (enabling future key roll-over) and separate keys, for
example for a ports tree signature.
2024-07-03 12:21:26 +10:00
Clemens Lang d74a2d4a54 vendor: Bundle signify(1)
signify(1) is a tool originally developed for OpenBSD that uses modern
EdDSA signatures on the ed25519 elliptic curve. Bundling this tool gives
us a good way forward away from our single RSA 4096 public key that has
now been in use since 2011 for all packages, all base updates and all
ports trees.

Shipping signify allows us to use (a) modern cryptography, (b) avoid
using the same key for everything and (c) eventually phase out the
RSA-RIPEMD160 signatures.

The vendor/signify-osx directory is a clone of
https://github.com/jpouellet/signify-osx/, udpated with the latest
OpenBSD upstream signify source code from CVS using the 'make up' target
of the signify-osx Makefile.
2024-07-02 13:46:37 +10:00
Clemens Lang 8fd95d79c8 darwintrace: Add automated tests
Some of the corner cases (such as very long paths, for example) are hard
to test manually, or at least you don't know exactly whether a specific
code path was covered just from installing a port.

Improve this situation by adding automated tests to darwintrace.
2023-10-01 16:27:04 +02:00
Joshua Root 10b4b80fbc Update .gitignore 2022-11-29 08:31:28 +11:00
Clemens Lang da4a4abd38 .gitignore: Ignore generated Tcl configs in vendor/
These will contain paths specific to the user's local system and should
thus not be under version control.

Remove the previously committed copies of this file.
2022-09-07 19:24:00 +10:00
Rainer Müller d7aadf86ea .gitignore: Ignore debug symbols
These can appear when building with CFLAGS="-g".
Reorder ignore rules slightly.
2018-04-11 07:27:43 +02:00
Rainer Müller 384a492bd1 doc: Ignore generated HTML man pages 2017-06-27 15:45:59 +02:00
Joshua Root bf01b83491 Add .DS_Store to .gitignore 2017-02-26 23:24:11 +11:00
Joshua Root fec05f990a Restore pregenerated pkgIndex.tcl files in tcllib 2017-01-08 23:52:01 +11:00
Rainer Müller 055fe85275 Replace vendor tarballs with extracted source
Extract the vendor tarballs in order to avoid significant increases of
the repository size on updates. Rename the configure functionality from
MP_CONFIG_TARBALL to MP_CONFIG_SUBDIR.

Update vendor source versions: Tcl 8.5.19, tcllib 1.18
2017-01-08 15:14:16 +11:00
Rainer Müller b480d79b0f Use wrapper with library paths for $INTREE_TCLSH
The wrapper script at vendor/tclsh ensures we can run helper scripts
even before MacPorts is installed, by using libraries from the source
directory. Previously, tclsh would erroneously have used
`/usr/lib/libtcl8.5.dylib`.

Closes: https://trac.macports.org/ticket/46533
2016-11-25 19:00:46 +01:00
Rainer Müller 7ee948edf8 Makefile: create release tarballs with git archive 2016-11-12 15:52:07 +01:00
Clemens Lang 10cb65d8f2 Ignore autom4te.cache 2016-10-31 01:57:56 +01:00
Lawrence Velázquez 99c9eab552 base: Revise Git exclusions
- The build no longer produces *.dSYM directories.

- Re-anchor exclusions that I accidentally unmoored.

- Restrain broad exclusions to specific points in the directory tree.

- Replace exclusions of several individual files with more general
  exclude/include pairs.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@151568 d073be05-634f-4543-b044-5fe20cf6d1d6
2016-08-18 03:05:03 +00:00
Lawrence Velázquez 3d2762d738 base, dports, doc-new: Rearrange Git exclusions
No functional changes.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@151567 d073be05-634f-4543-b044-5fe20cf6d1d6
2016-08-18 03:05:01 +00:00
Lawrence Velázquez 05ece83df3 Split up .gitignore
git-svn-id: https://svn.macports.org/repository/macports/trunk/base@151566 d073be05-634f-4543-b044-5fe20cf6d1d6
2016-08-17 23:53:30 +00:00