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

failed to build on Ubuntu 18.04 with GDC #534

Closed
biocyberman opened this issue Sep 22, 2018 · 16 comments
Closed

failed to build on Ubuntu 18.04 with GDC #534

biocyberman opened this issue Sep 22, 2018 · 16 comments

Comments

@biocyberman
Copy link

Installed gdc:

 gdc --version
gdc (Ubuntu 8-20180414-1ubuntu2) 8.0.1 20180414 (experimental) [trunk revision 259383]
...

Current commit:

git rev-parse HEAD   
baddc0a3fe97521e0b7fdbc1a45bde18afed4314

And then make failed on

make gdc  
git describe --tags > bin/githash.txt                                                                                                                                                                                                       
mkdir -p bin                                                                                                                                                                                                                                
gdc src/dcd/common/socket.d src/dcd/common/dcd_version.d src/dcd/common/constants.d src/dcd/common/messages.d src/dcd/common/constants2.d src/dcd/server/autocomplete/util.d src/dcd/server/autocomplete/symbols.d src/dcd/server/autocomplet
e/localuse.d src/dcd/server/autocomplete/doc.d src/dcd/server/autocomplete/package.d src/dcd/server/autocomplete/complete.d src/dcd/server/main.d src/dcd/server/server.d dsymbol/src/dsymbol/symbol.d dsymbol/src/dsymbol/type_lookup.d dsym
bol/src/dsymbol/conversion/second.d dsymbol/src/dsymbol/conversion/first.d dsymbol/src/dsymbol/conversion/package.d dsymbol/src/dsymbol/modulecache.d dsymbol/src/dsymbol/semantic.d dsymbol/src/dsymbol/import_.d dsymbol/src/dsymbol/deferr
ed.d dsymbol/src/dsymbol/scope_.d dsymbol/src/dsymbol/string_interning.d dsymbol/src/dsymbol/cache_entry.d dsymbol/src/dsymbol/builtin/symbols.d dsymbol/src/dsymbol/builtin/names.d dsymbol/src/dsymbol/tests.d stdx-allocator/source/stdx/a
llocator/gc_allocator.d stdx-allocator/source/stdx/allocator/building_blocks/bitmapped_block.d stdx-allocator/source/stdx/allocator/building_blocks/affix_allocator.d stdx-allocator/source/stdx/allocator/building_blocks/free_tree.d stdx-a
llocator/source/stdx/allocator/building_blocks/allocator_list.d stdx-allocator/source/stdx/allocator/building_blocks/region.d stdx-allocator/source/stdx/allocator/building_blocks/kernighan_ritchie.d stdx-allocator/source/stdx/allocator/b
uilding_blocks/fallback_allocator.d stdx-allocator/source/stdx/allocator/building_blocks/scoped_allocator.d stdx-allocator/source/stdx/allocator/building_blocks/stats_collector.d stdx-allocator/source/stdx/allocator/building_blocks/null_
allocator.d stdx-allocator/source/stdx/allocator/building_blocks/quantizer.d stdx-allocator/source/stdx/allocator/building_blocks/free_list.d stdx-allocator/source/stdx/allocator/building_blocks/package.d stdx-allocator/source/stdx/alloc
ator/building_blocks/segregator.d stdx-allocator/source/stdx/allocator/building_blocks/bucketizer.d stdx-allocator/source/stdx/allocator/internal.d stdx-allocator/source/stdx/allocator/showcase.d stdx-allocator/source/stdx/allocator/mmap
_allocator.d stdx-allocator/source/stdx/allocator/typed.d stdx-allocator/source/stdx/allocator/mallocator.d stdx-allocator/source/stdx/allocator/common.d stdx-allocator/source/stdx/allocator/package.d libdparse/src/dparse/ast.d libdparse
/src/dparse/entities.d libdparse/src/dparse/lexer.d libdparse/src/dparse/parser.d libdparse/src/dparse/formatter.d libdparse/src/dparse/rollback_allocator.d libdparse/src/dparse/stack_buffer.d libdparse/src/std/experimental/lexer.d conta
iners/src/containers/dynamicarray.d containers/src/containers/ttree.d containers/src/containers/unrolledlist.d containers/src/containers/openhashset.d containers/src/containers/hashset.d containers/src/containers/internal/hash.d containe
rs/src/containers/internal/node.d containers/src/containers/internal/storage_type.d containers/src/containers/internal/element_type.d containers/src/containers/internal/backwards.d containers/src/containers/slist.d msgpack-d/src/msgpack/
buffer.d msgpack-d/src/msgpack/streaming_unpacker.d msgpack-d/src/msgpack/value.d msgpack-d/src/msgpack/register.d msgpack-d/src/msgpack/packer.d msgpack-d/src/msgpack/unpacker.d msgpack-d/src/msgpack/attribute.d msgpack-d/src/msgpack/co
mmon.d msgpack-d/src/msgpack/package.d msgpack-d/src/msgpack/exception.d -Icontainers/src -Imsgpack-d/src -Ilibdparse/src -Idsymbol/src -Jbin -O3 -frelease -obin/dcd-server                                                                
stdx-allocator/source/stdx/allocator/internal.d:1315:19: error: module std.experimental.allocator.common import 'Ternary' not found                                                                                                         
     public import std.experimental.allocator.common : Ternary;                                                                                                                                                                             
                   ^
makefile:142: recipe for target 'gdcserver' failed                                                                                                                                                                                          
make: *** [gdcserver] Error 1   
@ghost
Copy link

ghost commented Sep 22, 2018

Looks like there's an error here:

static if (__VERSION__ >= 2072)
{
    public import std.typecons : Ternary;
}
else
{
    public import std.experimental.allocator.common : Ternary;
}

What does __VERSION__ expand to with the GDC you use (and which DMDFE does it use) ?
It's probably too old i think.

@wilzbach
Copy link
Member

Ternary isn't part of the latest gdc in Ubuntu. It's supposedly uses the 2.076 frontend, but I think Ian just forgot to cherry-pick a few things.
TL; DR: use gdc master or LDC or DMD.

@ghost
Copy link

ghost commented Sep 22, 2018

Sorry but we cant do anything here if there's been an omission in GDC version of libphobos.

@ghost ghost closed this as completed Sep 22, 2018
@ghost ghost added bug invalid labels Sep 22, 2018
@biocyberman
Copy link
Author

So it's rather a GDC bug, @ibuclaw ?

@ibuclaw
Copy link

ibuclaw commented Sep 24, 2018

It's not a compiler bug.

@ghost
Copy link

ghost commented Sep 24, 2018

see #534 (comment). Maybe you forgot some change in phobos.

@ibuclaw
Copy link

ibuclaw commented Sep 24, 2018

Keeping the version string at 2068 was deliberate, as the compiler does not implement 2.076 - its only a fork that covers most features and bug fixes in 2.076 backported to C++. Though eventually a concession was made (D-Programming-GDC/gdc#740) - lets hope no one uses static foreach for version >= 2076.

@ibuclaw
Copy link

ibuclaw commented Sep 24, 2018

You could use __traits(compiles) here instead of checking the version.

@ghost
Copy link

ghost commented Sep 24, 2018

Okay so this is clear now, no issue here. It's probably not worth changing the version check since the problem will disappear with newer GDC releases.

@biocyberman
Copy link
Author

Okay so this is clear now, no issue here. It's probably not worth changing the version check since the problem will disappear with newer GDC releases.

That means "nofix", in this case I should try to get the new GDC release compile DCD with it if I want to use GDC (I could compile successfully with DMD and LDC)?

@ghost
Copy link

ghost commented Sep 24, 2018

If you really want i can add the code to make the selection of the import more clever.

@ghost ghost reopened this Sep 24, 2018
@biocyberman
Copy link
Author

👍 Yes, please do it if you can manage.

@ghost
Copy link

ghost commented Sep 24, 2018

Can you try this code ?

void main(){}

static if (is(typeof({ import std.typecons : Ternary; })))
{
    public import std.typecons : Ternary;
}
else static if (is(typeof({ import std.experimental.allocator.common : Ternary;})))
{
    public import std.experimental.allocator.common : Ternary;
}
else static assert(0, "Oops, dont know how to find Ternary");     

since it's in a deps it will be faster to make the final PR in DCD if it's verified to be ok.
It it compiles it means that we can fix this issue.

@ghost
Copy link

ghost commented Sep 24, 2018

@biocyberman you can approve there : dlang-community/stdx-allocator#10, if the above code works

@biocyberman
Copy link
Author

I do not have access to the PC at the moment. Will test and get back to you later. Thanks.

@biocyberman
Copy link
Author

@bbasile The code works. Thanks.

dlang-bot added a commit that referenced this issue Sep 25, 2018
fix #534 - failed to build on Ubuntu 18.04 with GDC
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants