hitchdev / hitchstory

Type-safe YAML integration tests. Tests that write your docs. Tests that rewrite themselves.
https://hitchdev.com/hitchstory
Other
89 stars 3 forks source link

`hk regression` and `hk bdd dirty` fail on Arch Linux #1

Closed mensinda closed 1 year ago

mensinda commented 3 years ago

I have installed hitchkey with pip install -U hitchkey directly before trying to run tests and I am trying both commands on the current strictyaml master.

❯ pip show hitchkey       
Name: hitchkey
Version: 0.6.1
Summary: HitchKey bootstrapper - set up a development environment.
Home-page: https://hitchtest.readthedocs.org/
Author: Colm O'Connor
Author-email: colm.oconnor.github@gmail.com
License: AGPL
Location: /home/daniel/.local/lib/python3.9/site-packages
Requires: 
Required-by: 
❯ hk regression
CommandError

Can't create CommandPath object: /home/daniel/.hitch/0phcf6/py3.7.0/bin does not exist.
RUNNING A YAMLError will be raised if there are syntactic problems, violations of your schema or use of disallowed YAML features/For example, a schema violation in /home/daniel/projects/strictyaml/hitch/story/quickstart.story ... Downloading Python-2.7.14.tar.xz...
-> https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz
Installing Python-2.7.14...

BUILD FAILED (Arch rolling using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20210814125339.59626
Results logged to /tmp/python-build.20210814125339.59626.log

Last 10 log lines:
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':
/tmp/python-build.20210814125339.59626/Python-2.7.14/./Modules/posixmodule.c:7589: warning: the use of `tempnam' is dangerous, better use `mkstemp'
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
    echo "generate-posix-vars failed" ; \
    rm -f ./pybuilddir.txt ; \
    exit 1 ; \
fi
generate-posix-vars failed
make: *** [Makefile:514: pybuilddir.txt] Error 1
FAILED in 27.5 seconds.

[1]: function 'set_up'
  /home/daniel/projects/strictyaml/hitch/engine.py

        70 :             ).with_python_version(self.given["python version"])\
        71 :              .with_packages({"ruamel.yaml": self.given["ruamel version"]})
    --> 72 :             self.pylibrary.ensure_built()
        73 :             self.python = self.pylibrary.bin.python

[2]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[3]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchpylibrarytoolkit/build.py

        56 :     def build(self):
        57 :         pipinstalle = self.virtualenv.incomplete()
    --> 58 :         self.virtualenv.ensure_built()
        59 :         if pipinstalle:

[4]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[5]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/virtualenv.py

        39 :             self.build_path.rmtree(ignore_errors=True)
        40 :             self.build_path.mkdir()
    --> 41 :             self.base_python.build.ensure_built()
        42 :             self.base_python.build.bin.virtualenv(self.build_path).run()

[6]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[7]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/pyenv.py

        22 :             self.build_path.mkdir()
        23 : 
    --> 24 :             Command(
        25 :                 Path(__file__).dirname().abspath().joinpath("bin", "python-build")

[8]: function 'run'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/commandlib/command.py

        234 : 
        235 :         if returncode != 0 and not self._ignore_errors:
    --> 236 :             raise CommandError('"{0}" failed (err code {1})'.format(
        237 :                 self.__repr__(),

commandlib.exceptions.CommandError
  commandlib exception.
"/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/bin/python-build 2.7.14 /home/daniel/.hitch/share/python2.7.14" failed (err code 1)
RUNNING A YAMLError will be raised if there are syntactic problems, violations of your schema or use of disallowed YAML features/For example, a schema violation in /home/daniel/projects/strictyaml/hitch/story/quickstart.story ... Downloading Python-2.7.14.tar.xz...
-> https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz
Installing Python-2.7.14...

BUILD FAILED (Arch rolling using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20210814125407.66268
Results logged to /tmp/python-build.20210814125407.66268.log

Last 10 log lines:
/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':
/tmp/python-build.20210814125407.66268/Python-2.7.14/./Modules/posixmodule.c:7589: warning: the use of `tempnam' is dangerous, better use `mkstemp'
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
    echo "generate-posix-vars failed" ; \
    rm -f ./pybuilddir.txt ; \
    exit 1 ; \
fi
generate-posix-vars failed
make: *** [Makefile:514: pybuilddir.txt] Error 1
FAILED in 27.6 seconds.

[1]: function 'set_up'
  /home/daniel/projects/strictyaml/hitch/engine.py

        70 :             ).with_python_version(self.given["python version"])\
        71 :              .with_packages({"ruamel.yaml": self.given["ruamel version"]})
    --> 72 :             self.pylibrary.ensure_built()
        73 :             self.python = self.pylibrary.bin.python

[2]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[3]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchpylibrarytoolkit/build.py

        56 :     def build(self):
        57 :         pipinstalle = self.virtualenv.incomplete()
    --> 58 :         self.virtualenv.ensure_built()
        59 :         if pipinstalle:

[4]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[5]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/virtualenv.py

        39 :             self.build_path.rmtree(ignore_errors=True)
        40 :             self.build_path.mkdir()
    --> 41 :             self.base_python.build.ensure_built()
        42 :             self.base_python.build.bin.virtualenv(self.build_path).run()

[6]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[7]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/pyenv.py

        22 :             self.build_path.mkdir()
        23 : 
    --> 24 :             Command(
        25 :                 Path(__file__).dirname().abspath().joinpath("bin", "python-build")

[8]: function 'run'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/commandlib/command.py

        234 : 
        235 :         if returncode != 0 and not self._ignore_errors:
    --> 236 :             raise CommandError('"{0}" failed (err code {1})'.format(
        237 :                 self.__repr__(),

commandlib.exceptions.CommandError
  commandlib exception.
"/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/bin/python-build 2.7.14 /home/daniel/.hitch/share/python2.7.14" failed (err code 1)
❯ hk bdd dirty
RUNNING Dirty load/Flow style mapping in /home/daniel/projects/strictyaml/hitch/story/dirty-load.story ... Downloading Python-3.7.0.tar.xz...
-> https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
Installing Python-3.7.0...
Installed Python-3.7.0 to /home/daniel/.hitch/share/python3.7.0

FAILED in 108.9 seconds.

[1]: function 'set_up'
  /home/daniel/projects/strictyaml/hitch/engine.py

        70 :             ).with_python_version(self.given["python version"])\
        71 :              .with_packages({"ruamel.yaml": self.given["ruamel version"]})
    --> 72 :             self.pylibrary.ensure_built()
        73 :             self.python = self.pylibrary.bin.python

[2]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[3]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchpylibrarytoolkit/build.py

        56 :     def build(self):
        57 :         pipinstalle = self.virtualenv.incomplete()
    --> 58 :         self.virtualenv.ensure_built()
        59 :         if pipinstalle:

[4]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[5]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/virtualenv.py

        39 :             self.build_path.rmtree(ignore_errors=True)
        40 :             self.build_path.mkdir()
    --> 41 :             self.base_python.build.ensure_built()
        42 :             self.base_python.build.bin.virtualenv(self.build_path).run()

[6]: function 'ensure_built'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

        249 :     def ensure_built(self):
        250 :         with BuildContextManager(self):
    --> 251 :             self.build()
        252 : 

[7]: function 'build'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/pyenv.py

        30 :                 self.bin.easy_install("--upgrade", "pip").run()
        31 :             else:
    --> 32 :                 self.bin.pip("install", "pip", "--upgrade").run()
        33 :             self.bin.pip("install", "virtualenv", "--upgrade")\

[8]: function 'run'
  /home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/commandlib/command.py

        234 : 
        235 :         if returncode != 0 and not self._ignore_errors:
    --> 236 :             raise CommandError('"{0}" failed (err code {1})'.format(
        237 :                 self.__repr__(),

commandlib.exceptions.CommandError
  commandlib exception.
"/home/daniel/.hitch/share/python3.7.0/bin/pip install pip --upgrade" failed (err code -11)

It looks like it is trying to install a specific python version and is failing... Is there a way to tell it to use the system python version?

crdoconnor commented 3 years ago

Thanks for flagging this I will look into it tonight.

On Sat, 14 Aug 2021, 12:01 Daniel Mensinger, @.***> wrote:

I have installed hitchkey with pip install -U hitchkey directly before trying to run tests and I am trying both commands on the current strictyaml master.

❯ pip show hitchkey

Name: hitchkey

Version: 0.6.1

Summary: HitchKey bootstrapper - set up a development environment.

Home-page: https://hitchtest.readthedocs.org/

Author: Colm O'Connor

Author-email: @.***

License: AGPL

Location: /home/daniel/.local/lib/python3.9/site-packages

Requires:

Required-by:

❯ hk regression

CommandError

Can't create CommandPath object: /home/daniel/.hitch/0phcf6/py3.7.0/bin does not exist.

RUNNING A YAMLError will be raised if there are syntactic problems, violations of your schema or use of disallowed YAML features/For example, a schema violation in /home/daniel/projects/strictyaml/hitch/story/quickstart.story ... Downloading Python-2.7.14.tar.xz...

-> https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz

Installing Python-2.7.14...

BUILD FAILED (Arch rolling using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20210814125339.59626

Results logged to /tmp/python-build.20210814125339.59626.log

Last 10 log lines:

/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':

/tmp/python-build.20210814125339.59626/Python-2.7.14/./Modules/posixmodule.c:7589: warning: the use of tempnam' is dangerous, better usemkstemp'

./python -E -S -m sysconfig --generate-posix-vars ;\

if test $? -ne 0 ; then \

echo "generate-posix-vars failed" ; \

rm -f ./pybuilddir.txt ; \

exit 1 ; \

fi

generate-posix-vars failed

make: *** [Makefile:514: pybuilddir.txt] Error 1

FAILED in 27.5 seconds.

/home/daniel/projects/strictyaml/hitch/engine.py

    70 :             ).with_python_version(self.given["python version"])\

    71 :              .with_packages({"ruamel.yaml": self.given["ruamel version"]})

--> 72 :             self.pylibrary.ensure_built()

    73 :             self.python = self.pylibrary.bin.python

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchpylibrarytoolkit/build.py

    56 :     def build(self):

    57 :         pipinstalle = self.virtualenv.incomplete()

--> 58 :         self.virtualenv.ensure_built()

    59 :         if pipinstalle:

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/virtualenv.py

    39 :             self.build_path.rmtree(ignore_errors=True)

    40 :             self.build_path.mkdir()

--> 41 :             self.base_python.build.ensure_built()

    42 :             self.base_python.build.bin.virtualenv(self.build_path).run()

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/pyenv.py

    22 :             self.build_path.mkdir()

    23 :

--> 24 :             Command(

    25 :                 Path(__file__).dirname().abspath().joinpath("bin", "python-build")

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/commandlib/command.py

    234 :

    235 :         if returncode != 0 and not self._ignore_errors:

--> 236 :             raise CommandError('"{0}" failed (err code {1})'.format(

    237 :                 self.__repr__(),

commandlib.exceptions.CommandError

commandlib exception.

"/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/bin/python-build 2.7.14 /home/daniel/.hitch/share/python2.7.14" failed (err code 1)

RUNNING A YAMLError will be raised if there are syntactic problems, violations of your schema or use of disallowed YAML features/For example, a schema violation in /home/daniel/projects/strictyaml/hitch/story/quickstart.story ... Downloading Python-2.7.14.tar.xz...

-> https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz

Installing Python-2.7.14...

BUILD FAILED (Arch rolling using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20210814125407.66268

Results logged to /tmp/python-build.20210814125407.66268.log

Last 10 log lines:

/usr/bin/ld: libpython2.7.a(posixmodule.o): in function `posix_tempnam':

/tmp/python-build.20210814125407.66268/Python-2.7.14/./Modules/posixmodule.c:7589: warning: the use of tempnam' is dangerous, better usemkstemp'

./python -E -S -m sysconfig --generate-posix-vars ;\

if test $? -ne 0 ; then \

echo "generate-posix-vars failed" ; \

rm -f ./pybuilddir.txt ; \

exit 1 ; \

fi

generate-posix-vars failed

make: *** [Makefile:514: pybuilddir.txt] Error 1

FAILED in 27.6 seconds.

/home/daniel/projects/strictyaml/hitch/engine.py

    70 :             ).with_python_version(self.given["python version"])\

    71 :              .with_packages({"ruamel.yaml": self.given["ruamel version"]})

--> 72 :             self.pylibrary.ensure_built()

    73 :             self.python = self.pylibrary.bin.python

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchpylibrarytoolkit/build.py

    56 :     def build(self):

    57 :         pipinstalle = self.virtualenv.incomplete()

--> 58 :         self.virtualenv.ensure_built()

    59 :         if pipinstalle:

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/virtualenv.py

    39 :             self.build_path.rmtree(ignore_errors=True)

    40 :             self.build_path.mkdir()

--> 41 :             self.base_python.build.ensure_built()

    42 :             self.base_python.build.bin.virtualenv(self.build_path).run()

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/pyenv.py

    22 :             self.build_path.mkdir()

    23 :

--> 24 :             Command(

    25 :                 Path(__file__).dirname().abspath().joinpath("bin", "python-build")

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/commandlib/command.py

    234 :

    235 :         if returncode != 0 and not self._ignore_errors:

--> 236 :             raise CommandError('"{0}" failed (err code {1})'.format(

    237 :                 self.__repr__(),

commandlib.exceptions.CommandError

commandlib exception.

"/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/bin/python-build 2.7.14 /home/daniel/.hitch/share/python2.7.14" failed (err code 1)

❯ hk bdd dirty

RUNNING Dirty load/Flow style mapping in /home/daniel/projects/strictyaml/hitch/story/dirty-load.story ... Downloading Python-3.7.0.tar.xz...

-> https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz

Installing Python-3.7.0...

Installed Python-3.7.0 to /home/daniel/.hitch/share/python3.7.0

FAILED in 108.9 seconds.

/home/daniel/projects/strictyaml/hitch/engine.py

    70 :             ).with_python_version(self.given["python version"])\

    71 :              .with_packages({"ruamel.yaml": self.given["ruamel version"]})

--> 72 :             self.pylibrary.ensure_built()

    73 :             self.python = self.pylibrary.bin.python

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchpylibrarytoolkit/build.py

    56 :     def build(self):

    57 :         pipinstalle = self.virtualenv.incomplete()

--> 58 :         self.virtualenv.ensure_built()

    59 :         if pipinstalle:

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/virtualenv.py

    39 :             self.build_path.rmtree(ignore_errors=True)

    40 :             self.build_path.mkdir()

--> 41 :             self.base_python.build.ensure_built()

    42 :             self.base_python.build.bin.virtualenv(self.build_path).run()

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuild/build.py

    249 :     def ensure_built(self):

    250 :         with BuildContextManager(self):

--> 251 :             self.build()

    252 :

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/hitchbuildpy/pyenv.py

    30 :                 self.bin.easy_install("--upgrade", "pip").run()

    31 :             else:

--> 32 :                 self.bin.pip("install", "pip", "--upgrade").run()

    33 :             self.bin.pip("install", "virtualenv", "--upgrade")\

/home/daniel/.hitch/0phcf6/hvenv/lib/python3.9/site-packages/commandlib/command.py

    234 :

    235 :         if returncode != 0 and not self._ignore_errors:

--> 236 :             raise CommandError('"{0}" failed (err code {1})'.format(

    237 :                 self.__repr__(),

commandlib.exceptions.CommandError

commandlib exception.

"/home/daniel/.hitch/share/python3.7.0/bin/pip install pip --upgrade" failed (err code -11)

It looks like it is trying to install a specific python version and is failing... Is there a way to tell it to use the system python version?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hitchdev/hitchstory/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOJKNMTZMWTAW3UWWYWSRLT4ZEHDANCNFSM5CE7NMLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

crdoconnor commented 1 year ago

Hi,

I've deprecated hitchkey and everything is now run via scripts and containers so this type of thing shouldn't happen any more. Thanks for raising it though.