Skip to content

Conversation

@JornVernee
Copy link
Contributor

@JornVernee JornVernee commented Nov 13, 2018

A recent change uses a hardcoded unix path separator in a path. This is throwing the following error on windows when running mx ideinit in the mx suite:

Traceback (most recent call last):
  File "J:\Projects\mx2\mx.py", line 18858, in <module>
    main()
  File "J:\Projects\mx2\mx.py", line 18839, in main
    retcode = c(command_args)
  File "J:\Projects\mx2\mx_commands.py", line 146, in __call__
    return self.command_function(*args, **kwargs)
  File "J:\Projects\mx2\mx.py", line 16228, in ideinit
    netbeansinit(args.remainder, refreshOnly=refreshOnly, buildProcessorJars=buildProcessorJars, doFsckProjects=False)
  File "J:\Projects\mx2\mx.py", line 14882, in netbeansinit
    _netbeansinit_suite(args, suite, refreshOnly, buildProcessorJars)
  File "J:\Projects\mx2\mx.py", line 15351, in _netbeansinit_suite
    if _check_ide_timestamp(suite, configZip, 'netbeans'):
  File "J:\Projects\mx2\mx.py", line 14090, in _check_ide_timestamp
    if not proj.netbeans_config_up_to_date(configZip):
  File "J:\Projects\mx2\mx.py", line 3062, in netbeans_config_up_to_date
    if configZip.isOlderThan(join(self.dir, 'nbproject/project.xml')):
  File "J:\Projects\mx2\mx.py", line 13406, in isOlderThan
    if getmtime(f) > self.timestamp:
  File "J:\Projects\mx2\mx.py", line 13600, in getmtime
    return os.path.getmtime(name)
  File "J:\Python27\lib\genericpath.py", line 62, in getmtime
    return os.stat(filename).st_mtime
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: '\\\\?\\J:\\Projects\\mx2\\java\\com.oracle.mxtool.checkcopy\\nbproject/project.xml'

This PR switches to relying on join to use the right path separator, which fixes the problem.

@JornVernee
Copy link
Contributor Author

JornVernee commented Nov 13, 2018

Maybe we could enable Windows CI in travis as well to catch these things in the future?

It seems that this is as simple to do as adding:

os:
  - windows
  - linux

To the top of the travis file. [1]

[1] : https://docs.travis-ci.com/user/multi-os/


P.S. actually I think it's a little more complicated than that since it currently uses linux shell commands as well.

P.P.S. actually the windows support in travis doesn't seem to be quite ready, as they don't support python yet: https://docs.travis-ci.com/user/reference/windows/#supported-languages

P.P.P.S OK, I think we could just install the python 2 package instead of using the travis builtin language: thing. I have a version of the updated script [2], but not sure how I should test it.

[2] : https://github.com/JornVernee/mx/blob/travis_windows/.travis.yml

@gilles-duboscq
Copy link
Member

Thanks for looking at this @JornVernee.

Regarding testing for the travis changes, I guess if you create a PR with those changes that would automatically test it.

@JornVernee
Copy link
Contributor Author

@gilles-duboscq Heh - that's surprisingly simple. I just assumed it would still use the old yml from master to run the test.

@JornVernee
Copy link
Contributor Author

Superseded by #184

@JornVernee JornVernee closed this Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants