Skip to content
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

build_references.sh: Check for Windows-style MSYS2 root path. #19

Merged
merged 1 commit into from
Oct 10, 2015

Conversation

DavidEGrayson
Copy link
Contributor

This helps address issue #16 by printing a warning if $(cygpath -m /) or $(cygpath -m \) is found in the package. The warning looks like this:

image

I generated that warning by trying to build the following test PKGBUILD:

_realname=testpkg
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.0
pkgrel=1
pkgdesc='Test package'
arch=('any')
url='http://www.example.com/'
license=('custom')
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-gcc"
)
depends=()
options=()
source=()

sha256sums=()

prepare() {
  mkdir -p "${srcdir}/${_realname}-${pkgver}"
}

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"

  {
    echo "#!/usr/bin/bash"
    echo "cd \"$(cygpath -m /)\""
    echo "pwd"
    echo "cd \"$(cygpath -w /)\""
    echo "pwd"
  } > testpkg
}

check() {
  cd "${srcdir}/build-${MINGW_CHOST}"
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"

  install -Dm644 testpkg "${pkgdir}${MINGW_PREFIX}/bin/testpkg"
}

@DavidEGrayson DavidEGrayson force-pushed the msys2dir_pull_request_1 branch from 3bbd2d8 to b4be2fd Compare October 10, 2015 18:19
mingwandroid added a commit that referenced this pull request Oct 10, 2015
build_references.sh: Check for Windows-style MSYS2 root path.
@mingwandroid mingwandroid merged commit c467ed6 into Alexpux:master Oct 10, 2015
@mingwandroid
Copy link
Collaborator

Thanks!

@DavidEGrayson
Copy link
Contributor Author

Thank you for merging it, @mingwandroid!

@DavidEGrayson
Copy link
Contributor Author

Note: I used the -I option to grep in this pull request, so it never finds paths that were embedded in binary files. I can't really remember why I did that, but maybe it's because the other checks in the same file were using -I, and I was concerned about DLLs and executables that have debug info in them. Maybe that was a mistake, because it allows bugs like this one to slip through: https://github.com/Alexpux/MINGW-packages/issues/1309

@DavidEGrayson
Copy link
Contributor Author

DavidEGrayson commented Oct 15, 2019

Four years have passed and we still have broken packages causing problems for some people:

https://stackoverflow.com/q/58380995/28128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants