Skip to content

Conversation

@hughbe
Copy link
Contributor

@hughbe hughbe commented Dec 22, 2016

Windows has an 8000 character limit for
commands executed from the shell. We exceed this limit when compiling the standard library.

This means that we need to work around this:

  • Write a list of the files to compile to a file
  • Read that file in a the new line-directive-file script into a list of files.
  • Invoke the original line-directive-file via Python.

Extracted from #5904

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the @ sigil, it should be possible to merge the tool into the existing line-directive tool, shouldnt it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That , probably is not desired.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it would be nicer to follow the traditional response file naming convention of @name to indicate that the file should be read and expanded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an unused variable (dead code). Removed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if these 4 lines are used elsewhere in the build system. It really seems ripe for moving into ListUtils.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved it into SwiftList.cmake. I think we can add uses of the new list_join function as we find them

@hughbe
Copy link
Contributor Author

hughbe commented Dec 26, 2016

Thanks for the review. For the @name comment, I'm not sure I understand. Could you clarify this? I will update the PR accordingly

@slavapestov
Copy link
Contributor

There's a merge conflict here

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change that you split out into a wrapper tool can be condensed enough to place into the original tool and simplify things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I like this. Just feels like the could be a collision of there are parallel builds. Can we use a generated name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that I would rather that we keep the old behavior in tact. Can you use "@${file_path}" here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that I would rather we keep the old behavior. Can you use "@${file_path}" here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that I would rather keep the tool compatible with the previous invocation. Can you use the @ sigil to indicate that the contents of the file should be read as options?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the change needed is small enough that we can collapse of into the tool itself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a:

if sys.argv[0][0] == '@':

means that we can integrate this into the original tool and makes it behave more like other tools.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this flip the order? We want the previously read options to precede the subsequent options.

@hughbe
Copy link
Contributor Author

hughbe commented Jan 15, 2017

Thanks Saleem for your review. I've updated the PR to your comments.

This PR now depends on #6824 being merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think that this is right. Why are you dropping the use of ${PYTHON_EXECUTABLE}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, mad merge conflict resolution

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be written as if command_args[-1][0] == '@'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that we want the response file to be the last entry always? I think that we should expand any and in place.

@hughbe
Copy link
Contributor Author

hughbe commented Jan 15, 2017

I've updated the PR to fix the bad merge, and consolidate response file expansion

@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - f443fff5e8c8b1412c9a0b7e3010e7187168657a
Test requested by - @compnerd

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - f443fff5e8c8b1412c9a0b7e3010e7187168657a
Test requested by - @compnerd

@hughbe
Copy link
Contributor Author

hughbe commented Jan 17, 2017

@compnerd any more comments or is this good to go?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are joining the list with ; (which does make it easier to deal with paths which may have spaces, although it is less like traditional response files), then the list_join is equivalent to "${source_files}" as CMake will implicitly ; the list when converting it to a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I found that things glitched out and broken in a path with spaces, so replaced with ';'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I just discovered ";" is a legal character in a Windows file path. I've replaced uses of ';' with '|' which is illegal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What am I misunderstanding? The separator is still ; on the diff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; is legal on Unix too. I'm pretty sure cmake is hopelessly doomed if any file path actually uses ; so we don't need to work around that threat here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Derp, I didn't push the commit changing ';' to '|'

Fair enough actually - I'll keep ';' and follow your suggestion

@hughbe
Copy link
Contributor Author

hughbe commented Jan 18, 2017

@swift-ci please smoke test

@hughbe hughbe dismissed compnerd’s stale review January 19, 2017 16:36

Please re-review

@hughbe
Copy link
Contributor Author

hughbe commented Jan 25, 2017

@swift-ci please smoke test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

@hughbe hughbe closed this Jan 26, 2017
@hughbe hughbe reopened this Jan 26, 2017
@hughbe
Copy link
Contributor Author

hughbe commented Jan 26, 2017

@swift-ci please smoke test

@compnerd compnerd merged commit 466ab59 into swiftlang:master Jan 26, 2017
@hughbe hughbe deleted the line-directive-windows branch January 26, 2017 15:49
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.

6 participants