Repository navigation
Conversation
Various files are found by referencing the srcdir environment variable in that case.
dfandrich
force-pushed
the
dfandrich/opensshtests
branch
from
February 22, 2023 23:16
8df0e8a to
c31f924
Compare
Two warnings (in tests & examples) in particular would cause problems: bad format causing invalid data output or a bad chdir due to out of scope buffer use.
dfandrich
force-pushed
the
dfandrich/opensshtests
branch
from
February 22, 2023 23:46
c31f924 to
4302a28
Compare
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
May 5, 2023
This should be unnecessary after 4c9ed51 libssh2#801, that fixes up all referenced source filenames with the `srcdir` envvar. The `srcdir` envvar was exported by autotools, and now we're also setting it from CMake.
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
May 5, 2023
This should be unnecessary after 4c9ed51 libssh2#801, that fixes up all referenced source filenames with the `srcdir` envvar. The `srcdir` envvar was exported by autotools, and now we're also setting it from CMake.
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
May 5, 2023
This should be unnecessary after 4c9ed51 libssh2#801, that fixes up all referenced source filenames with the `srcdir` envvar. The `srcdir` envvar was exported by autotools, and now we're also setting it from CMake.
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
May 5, 2023
This should be unnecessary after 4c9ed51 libssh2#801, that prefixes referenced input filenames with the `srcdir` envvar. The `srcdir` envvar was already exported by autotools, and now we're also setting it from CMake.
vszakats
added a commit
that referenced
this pull request
May 5, 2023
Before this patch libssh2 used a variety of solutions to pass the source directory to tests: `FIXTURE_WORKDIR` build-time macro (cmake), `FIXTURE_WORKDIR` envvar (unused), setting `srcdir` manually (autotools), setting current directory (cmake), and also `builddir` envvar (autotools) for passing current working dir to `mansyntax.sh`. This patch reduces this to using existing `srcdir` with autotools and setting it ourselves in CMake. This was mostly enabled by this recent patch: 4c9ed51 Details: - cmake: replace baked-in `FIXTURE_WORKDIR` macro with env. Added in 54bef4c #198 (2018-03-21) - rename `FIXTURE_WORKDIR` to `srcdir`, to match autotools. - cmake: add missing `srcdir` for algo and sshd tests. - session_fixture: stop `chdir()`-ing, rely on prefixing with `srcdir`. Changing current directory should be unnecessary after 4c9ed51 #801 (2023-02-24), that prefixes referenced input filenames with the `srcdir` envvar. The `srcdir` envvar was already exported by autotools, and now we're also setting it from CMake. - cmake: stop setting `WORKING_DIRECTORY`, rely on `srcdir` env. `WORKING_DIRECTORY` is no longer necessary, after passing `srcdir` to all tests, so they can find our source tree and keys/etc in it regardless of the current directory. Also this past commit hints that `WORKING_DIRECTORY` wasn't always working for this purpose as expected: "tests: Xcode doesn't obey CMake's test working directory" Ref: 10a5cbf - autotools: delete explicit `srcdir` for test env. Added in 13f8add (2015-07-02) automake documents `srcdir` as exported to the test environment: https://github.com/autotools-mirror/automake/blob/c04c4e8856e3c933239959ce18e16599fcc04a8b/doc/automake.texi#L9302-L9304 https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html It's mentioned in the docs back in 1997 and got a regression test in 2012. We can safely assume it to be available without setting it ourselves. - autotools: delete explicit `builddir`. Added in 13f8add (2015-07-02) It seems this wasn't necessary to make the above fix work, and `mansyntax.sh` is able to figure out the build workdir by reading `$PWD`. Our out-of-tree and `make distcheck` CI builds also work without it. Let us know if there is a scenario we're missing and needs this. Closes #1032
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
Various files are found by referencing the srcdir environment variable in that case. Closes libssh2#801
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
Before this patch libssh2 used a variety of solutions to pass the source directory to tests: `FIXTURE_WORKDIR` build-time macro (cmake), `FIXTURE_WORKDIR` envvar (unused), setting `srcdir` manually (autotools), setting current directory (cmake), and also `builddir` envvar (autotools) for passing current working dir to `mansyntax.sh`. This patch reduces this to using existing `srcdir` with autotools and setting it ourselves in CMake. This was mostly enabled by this recent patch: 4c9ed51 Details: - cmake: replace baked-in `FIXTURE_WORKDIR` macro with env. Added in 54bef4c libssh2#198 (2018-03-21) - rename `FIXTURE_WORKDIR` to `srcdir`, to match autotools. - cmake: add missing `srcdir` for algo and sshd tests. - session_fixture: stop `chdir()`-ing, rely on prefixing with `srcdir`. Changing current directory should be unnecessary after 4c9ed51 libssh2#801 (2023-02-24), that prefixes referenced input filenames with the `srcdir` envvar. The `srcdir` envvar was already exported by autotools, and now we're also setting it from CMake. - cmake: stop setting `WORKING_DIRECTORY`, rely on `srcdir` env. `WORKING_DIRECTORY` is no longer necessary, after passing `srcdir` to all tests, so they can find our source tree and keys/etc in it regardless of the current directory. Also this past commit hints that `WORKING_DIRECTORY` wasn't always working for this purpose as expected: "tests: Xcode doesn't obey CMake's test working directory" Ref: libssh2@10a5cbf - autotools: delete explicit `srcdir` for test env. Added in 13f8add (2015-07-02) automake documents `srcdir` as exported to the test environment: https://github.com/autotools-mirror/automake/blob/c04c4e8856e3c933239959ce18e16599fcc04a8b/doc/automake.texi#L9302-L9304 https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html It's mentioned in the docs back in 1997 and got a regression test in 2012. We can safely assume it to be available without setting it ourselves. - autotools: delete explicit `builddir`. Added in 13f8add (2015-07-02) It seems this wasn't necessary to make the above fix work, and `mansyntax.sh` is able to figure out the build workdir by reading `$PWD`. Our out-of-tree and `make distcheck` CI builds also work without it. Let us know if there is a scenario we're missing and needs this. Closes libssh2#1032
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.