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

gbc cannot handle import with mixed/other slashes #869

Closed
chwarr opened this issue May 4, 2018 · 4 comments
Closed

gbc cannot handle import with mixed/other slashes #869

chwarr opened this issue May 4, 2018 · 4 comments
Labels

Comments

@chwarr
Copy link
Member

chwarr commented May 4, 2018

On Linux, gbc cannot handle import statements with mixed or backslashes.

Given ./inc/one/two/a.bond:

namespace a;
struct foo { }

And ./b.bond:

import "one/two\a.bond"
namespace b;
struct bar {
    0: a.foo myFoo;
}

Run codegen as:

gbc c# -i ./inc/ b.bond

Expected results:

b_types.cs is created with references to a.foo

Actual results:

gbc: user error (Can't find import file one\two/a.bond)

Import statements with mixed or backslashes are going to be common if the .bond files were originally authored on Windows. (gbc on Windows can handle mixed slashes just fine.)

@chwarr chwarr added the bug label May 4, 2018
chwarr added a commit to chwarr/bond that referenced this issue May 5, 2018
Since .bond files can be authored on platforms with different directory
separator characters, the paths in build scripts and Bond `import`
statements may use a forwardslash when a backslash is expected or vice
versa.

In order to handle this, gbc now normalizes anything that is a
path (file paths, response file items, import directories, import
statement paths, output directories, &c.) to use the platform's
preferred directory separator character.

Tests for C++, C#, and Java have been updated to use some imports with
mixed slashes.

gbc doesn't use a dedicate type for file paths. `FilePath` is just a
type synonym for `String`, so some places may have been inadvertently
missed.

This does now mean that gbc cannot process files, on, say, Linux, with
backslashes in their names. This is expected to be rare, and is deemed
an acceptable compromise for a cross-platform tool.

Fixes microsoft#869
chwarr added a commit that referenced this issue May 5, 2018
Since .bond files can be authored on platforms with different directory
separator characters, the paths in build scripts and Bond `import`
statements may use a forwardslash when a backslash is expected or vice
versa.

In order to handle this, gbc now normalizes anything that is a
path (file paths, response file items, import directories, import
statement paths, output directories, &c.) to use the platform's
preferred directory separator character.

Tests for C++, C#, and Java have been updated to use some imports with
mixed slashes.

gbc doesn't use a dedicate type for file paths. `FilePath` is just a
type synonym for `String`, so some places may have been inadvertently
missed.

This does now mean that gbc cannot process files, on, say, Linux, with
backslashes in their names. This is expected to be rare, and is deemed
an acceptable compromise for a cross-platform tool.

Fixes #869
chwarr added a commit to chwarr/bond that referenced this issue May 5, 2018
Since .bond files can be authored on platforms with different directory
separator characters, the paths in build scripts and Bond `import`
statements may use a forwardslash when a backslash is expected or vice
versa.

In order to handle this, gbc now normalizes anything that is a
path (file paths, response file items, import directories, import
statement paths, output directories, &c.) to use the platform's
preferred directory separator character.

Tests for C++, C#, and Java have been updated to use some imports with
mixed slashes.

gbc doesn't use a dedicate type for file paths. `FilePath` is just a
type synonym for `String`, so some places may have been inadvertently
missed.

This does now mean that gbc cannot process files, on, say, Linux, with
backslashes in their names. This is expected to be rare, and is deemed
an acceptable compromise for a cross-platform tool.

Fixes microsoft#869
@amrmahdi
Copy link
Member

amrmahdi commented May 8, 2018

@chwarr when will the change be merged ? Also, are you going to create a release for this change ?

@chwarr
Copy link
Member Author

chwarr commented May 9, 2018

Should be merged by end-of-day, Pacific time, on Wednesday, May 9, 2018.
We're planning the Bond 8.0 release some time around May 15, 2018.

chwarr added a commit to chwarr/bond that referenced this issue May 10, 2018
Since .bond files can be authored on platforms with different directory
separator characters, the paths in build scripts and Bond `import`
statements may use a forwardslash when a backslash is expected or vice
versa.

In order to handle this, gbc now normalizes anything that is a
path (file paths, response file items, import directories, import
statement paths, output directories, &c.) to use the platform's
preferred directory separator character.

Tests for C++, C#, and Java have been updated to use some imports with
mixed slashes.

gbc doesn't use a dedicate type for file paths. `FilePath` is just a
type synonym for `String`, so some places may have been inadvertently
missed.

This does now mean that gbc cannot process files, on, say, Linux, with
backslashes in their names. This is expected to be rare, and is deemed
an acceptable compromise for a cross-platform tool.

Fixes microsoft#869
@lalo lalo closed this as completed in #870 May 11, 2018
lalo pushed a commit that referenced this issue May 11, 2018
Since .bond files can be authored on platforms with different directory
separator characters, the paths in build scripts and Bond `import`
statements may use a forwardslash when a backslash is expected or vice
versa.

In order to handle this, gbc now normalizes anything that is a
path (file paths, response file items, import directories, import
statement paths, output directories, &c.) to use the platform's
preferred directory separator character.

Tests for C++, C#, and Java have been updated to use some imports with
mixed slashes.

gbc doesn't use a dedicate type for file paths. `FilePath` is just a
type synonym for `String`, so some places may have been inadvertently
missed.

This does now mean that gbc cannot process files, on, say, Linux, with
backslashes in their names. This is expected to be rare, and is deemed
an acceptable compromise for a cross-platform tool.

Fixes #869
@amrmahdi
Copy link
Member

@chwarr what is the current target date for 8.0 release ?

@chwarr
Copy link
Member Author

chwarr commented May 24, 2018

@chwarr what is the current target date for 8.0 release ?

Tuesday, May 29, 2018

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

No branches or pull requests

2 participants