text:
Harmonize with crate-1.0.0: ModuleNotFoundError: No module named 'crate.client'

Problem
After upgrading to crate-1.0.0 (dev), running the testsuite using python -m unittest -vvv trips, not able to find crate.client any longer.
Traceback (most recent call last):
  File "/path/to/lib/python3.12/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/lib/python3.12/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
  File "/path/to/crash/tests/test_sysinfo.py", line 29, in <module>
    from crate.crash.command import CrateShell
  File "/path/to/crash/crate/crash/command.py", line 43, in <module>
    from crate.client import connect
ModuleNotFoundError: No module named 'crate.client'

https://github.com/crate/crash/pull/446

This is probably coming from the transition to "implicit namespace packages".

https://github.com/crate/crate-python/pull/666

Observations
The problem does not happen at runtime, so we are safe on this side at least.
uv pip install --upgrade "crate>=1.0.0.dev2" crash
$ crash --version
0.31.5

Solution
The crash repository currently manages its fragment of the crate namespace package within a top-level folder. It should probably use the "src layout", like crate-python is also doing it, storing the actual module's source under src/crate/.

The “src layout” deviates from the flat layout by moving the code that is intended to be importable into a subdirectory. This subdirectory is typically named src/, hence “src layout”.

The src layout helps prevent accidental usage of the in-development copy of the code.

-- https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
Evaluation
In previous times of Python packaging, and when using the previous variants of implementing namespace packages, this detail probably didn't play a relevant role. Now, apparently, it does, and needs a minor refactoring of the directory layout.
/cc @surister, @simonprickett, @kneth

Resolved with GH-448.

repo: crate/crash


text:
Enable CI-testing on macOS and Windows

This is just a WIP based on #386. Let's see how it goes.

CrateDB nightlies are not available for macOS and Windows, see [1]. Bummer.
[1] https://github.com/crate/crate-python/pull/388/checks?check_run_id=1347098559#step:4:124

We are seeing this again [1].
Error: Error downloading extends for URL https://cdn.crate.io/downloads/releases/cratedb/x64_windows/crate-4.3.0.zip: [WinError 10054] An existing connection was forcibly closed by the remote host
Error: Process completed with exit code 1.

[1] https://github.com/crate/crate-python/pull/388/checks?check_run_id=1347231174#step:4:115

While making some progress on this, the last command bin/coverage run $test_program -vv1 errors out on Windows like
No file to run: 'bin/test-quick'

or
No file to run: 'bin\test-quick'

See also [1].
This is somehow related to

how the system path and python path are handled on various operating systems Windows [2].

[1] https://github.com/crate/crate-python/pull/388/checks?check_run_id=1347349770#step:5:16
[2] https://stackoverflow.com/questions/3312451/how-can-you-get-unittest2-and-coverage-py-working-together

The reason that bin/coverage has not been able to find bin/test-quick is that it gets installed as bin/test-quick.exe on Windows. However, addressing that file obviously will not work as intended [1]:
Couldn't run 'bin/test-quick.exe' as Python code: SyntaxError: invalid or missing encoding declaration

[1] https://github.com/crate/crate-python/pull/388/checks?check_run_id=1347537748#step:5:17

After some more adjustments, the test suite also starts on Windows. Now, it croaks with AttributeError: module 'time' has no attribute 'clock' from sqlalchemy.util.compat [1], at least with sqlalchemy-1.1.18.
Traceback (most recent call last):
  File "D:\a\crate-python\crate-python\src\crate\client\tests.py", line 39, in <module>
    from crate.client.sqlalchemy.dialect import CrateDialect
  File "D:\a\crate-python\crate-python\src\crate\client\sqlalchemy\__init__.py", line 22, in <module>
    from .dialect import CrateDialect
  File "D:\a\crate-python\crate-python\src\crate\client\sqlalchemy\dialect.py", line 25, in <module>
    from sqlalchemy import types as sqltypes
  File "D:\a\crate-python\crate-python\eggs\sqlalchemy-1.1.18-py3.8-win-amd64.egg\sqlalchemy\__init__.py", line 9, in <module>
    from .sql import (
  File "D:\a\crate-python\crate-python\eggs\sqlalchemy-1.1.18-py3.8-win-amd64.egg\sqlalchemy\sql\__init__.py", line 8, in <module>
    from .expression import (
  File "D:\a\crate-python\crate-python\eggs\sqlalchemy-1.1.18-py3.8-win-amd64.egg\sqlalchemy\sql\expression.py", line 33, in <module>
    from .visitors import Visitable
  File "D:\a\crate-python\crate-python\eggs\sqlalchemy-1.1.18-py3.8-win-amd64.egg\sqlalchemy\sql\visitors.py", line 28, in <module>
    from .. import util
  File "D:\a\crate-python\crate-python\eggs\sqlalchemy-1.1.18-py3.8-win-amd64.egg\sqlalchemy\util\__init__.py", line 8, in <module>
    from .compat import callable, cmp, reduce,  \
  File "D:\a\crate-python\crate-python\eggs\sqlalchemy-1.1.18-py3.8-win-amd64.egg\sqlalchemy\util\compat.py", line 172, in <module>
    time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'

[1] https://github.com/crate/crate-python/pull/388/checks?check_run_id=1347946253#step:5:42

Now, there's an error when trying to bootstrap CrateDB on Windows [1]. It goes like
b'[2020-11-03T15:11:44,184][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [crate] uncaught exception in thread [main]'
b'org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to create a child event loop'
[...]
b'Caused by: java.net.SocketException: Unrecognized Windows Sockets error: 10106: socket'
[...]

[1] https://github.com/crate/crate-python/pull/388/checks?check_run_id=1348166824#step:5:212

java.net.SocketException: Unrecognized Windows Sockets error: 10106: socket
All of these didn't bring any improvements:
# Disable firewall.
netsh advfirewall set allprofiles state off

# Reset IP stack.
netsh winsock reset

# Disable IPv6.
netsh interface teredo set state disabled
netsh interface ipv6 6to4 set state state=disabled undoonstop=disabled
netsh interface ipv6 isatap set state state=disabled

set _JAVA_OPTIONS="-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true"

java.net.SocketException: Unrecognized Windows Sockets error: 10106: socket
Some resources suggest to set the SystemRoot environment variable to C:\Windows:

https://bz.apache.org/netbeans/show_bug.cgi?id=91532
https://stackoverflow.com/questions/3947555/java-net-socketexception-unrecognized-windows-sockets-error-0-jvm-bind-jboss/60072492#60072492
https://community.microfocus.com/t5/StarTeam-Knowledge-Base/Network-problem-Unrecognized-Windows-Sockets-error-10106-create/ta-p/1755101

Indeed: With 4c05db6, CrateDB seems to be able to spin up successfully.

Now, we are seeing this:
Error in test D:\a\crate-python\crate-python\src\crate\client\sqlalchemy\doctests\itests.txt
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.6.8\x64\lib\unittest\case.py", line 59, in testPartExecutor
    yield
  File "C:\hostedtoolcache\windows\Python\3.6.8\x64\lib\unittest\case.py", line 601, in run
    self.setUp()
  File "C:\hostedtoolcache\windows\Python\3.6.8\x64\lib\doctest.py", line 2167, in setUp
    self._dt_setUp(test)
  File "D:\a\crate-python\crate-python\src\crate\client\tests.py", line 160, in setUpCrateLayerAndSqlAlchemy
    setUpWithCrateLayer(test)
  File "D:\a\crate-python\crate-python\src\crate\client\tests.py", line 148, in setUpWithCrateLayer
    cursor.execute("copy locations from ?", (data_path,))
  File "D:\a\crate-python\crate-python\src\crate\client\cursor.py", line 54, in execute
    bulk_parameters)
  File "D:\a\crate-python\crate-python\src\crate\client\http.py", line 396, in sql
    content = self._json_request('POST', self.path, data=data)
  File "D:\a\crate-python\crate-python\src\crate\client\http.py", line 523, in _json_request
    _raise_for_status(response)
  File "D:\a\crate-python\crate-python\src\crate\client\http.py", line 207, in _raise_for_status
    error_trace=error_trace)
crate.client.exceptions.ProgrammingError: SQLParseException[Illegal character in opaque part at index 2: D:\a\crate-python\crate-python\src\crate\testing\testdata\data\test_a.json]

Regarding this, we are lucky @seut already suggested at https://github.com/crate/crate/issues/7781 to

Use a valid file URI on windows see e.g.: https://blogs.msdn.microsoft.com/ie/2006/12/06/file-uris-in-windows/.

source: gharchive/pull-request

repo: crate/crate-python

license_type: permissive

license_source: bigquery


text:
class_cast_exception when selecting from pg_catalog.pg_stats table

CrateDB version: 4.1.7
Problem description:
I upgraded cluster to version 4.1.7 and execute ANALYZE statement.
Statement executed successfully and table pg_catalog.pg_stats was filled.
But when I trying to read it - I receive error ERROR: SQLParseException: Cannot cast [330мл] to type TEXT (exception raised on StringType.java:96)
I found row and columns, produces this error:
select most_common_vals from pg_catalog.pg_stats limit 1 offset 61
>> ERROR: SQLParseException: Cannot cast [] to type TEXT
select histogram_bounds from pg_catalog.pg_stats limit 1 offset 61
>> ERROR: SQLParseException: Cannot cast [330мл] to type TEXT
Table, produces this error:
CREATE TABLE IF NOT EXISTS "dedup"."catalog_duplication" (
   "id" TEXT,
   "name" TEXT,
   "duplication" ARRAY(OBJECT(DYNAMIC) AS (
      "id" TEXT,
      "kwminus" TEXT,
      "kwplus" TEXT,
      "name" TEXT
   )),
   PRIMARY KEY ("id")
)
CLUSTERED BY ("id") INTO 10 SHARDS

Column, produces this error: duplication['kwminus']
Steps to reproduce:
Sorry, I tried to create a sample, but the error does not reproduce if there are one or two rows in the table.

Sorry that you're running repeatedly into issues with this. We should do a better job testing this with different data sets :(
We'll have a closer look and come up with a fix.
Out of curiousity - what are you trying to do with the statistics?

@mfussenegger
I used query SELECT * FROM pg_catalog.pg_stats to check is statistics collected.
This error doesn’t bother me. I dont use this stats directly.
I created this ticket to help you - maybe this exception hides some other issue? Or something else?
If this behavior is normal - just close the ticket :)
I noticed a performance degradation after upgrading 4.0 -> 4.1. And I began to search the reasons.
I found exception in logs, I found ANALYZE statement in docs, and then I checks table pg_catalog.pg_stats - it was empty.
So I used this select to test - is statistics collected or not. I dont use any data from this table except manual test - table is empty \ table is not empty:)
At now this table is filled. So, I have to wait a few days to check average execution time.

I created this ticket to help you

Thank you, it does help us :)

I noticed a performance degradation after upgrading 4.0 -> 4.1.

Could you share some of the queries and the schema of the tables where you noticed a performance regression?
We run the scenarios in https://github.com/crate/crate-benchmarks nightly to try to detect performance regressions, but it has gaps - so if you've any queries where we could take a closer look at that would be very valuable for us.

@mfussenegger
I have to make a lot of changes in the code to upgrade. So I'm not sure where the problem is.
Here average execution time:

I see performance degradation in 3-5 times after 16-17 april.
I have table with 200k rows (400mb of data)
In table I have 2 array column:
...
is_visible boolean,
category_id array(int),
linked_ids array(int),
rating int
....

And I use query like
SELECT columns_list
FROM table
WHERE
 is_visible AND
 (
   ? = ANY(category_id) OR,
   ? = ANY(category_id) OR,
   ....
   (about 5-15-20 lines here)
 )
  AND linked_ids IS NOT NULL
  AND
 (
    ? = ANY(linked_ids) OR,
    ? = ANY(linked_ids) OR,
    ? = ANY(linked_ids) OR,
    .....
   (about 50-80-100-200 lines here)
)
ORDER BY rating
LIMIT ?
OFFSET ?

I found some optimization - I stopped use prepared statement parameters and started write numeric values directly to SQL query (yes, it is bad) - but it saved some time for me.
I made some other optimizations and for  a now the average query execution time is within the acceptable interval.

But I hope that the collected statistics will help reduce these numbers :)

@shm-dmitry thanks for reporting the issue. The fix will be available in the next 4.1.8 hotfix release.

source: gharchive/issue

authors: kovrus mfussenegger shm-dmitry

repo: crate/crate


text:
Ubuntu 14.04 LTS Install Issue

CrateDB version: 2.0.4
JVM version:
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

OS version / environment description:
AWS EC2 - `Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-4b133c5d

Problem description:
proc/self/fd/9:` 15: ulimit: Illegal option -u

in
/var/log/upstart/crate.log

after installing Crate 2.0.4

Steps to reproduce:
bash -c "$(curl -L install.crate.io)"

Use case:
Feature description:

hi @kylebush, thanks for reporting we will check that and keep you up to date.

hi @kylebush , i have been trying to reproduce the issue with a clean ubuntu 14.04 LTS installation and the same java version but i couldn't reproduce it. I've seen that you are using a special ec2 ami, does this have any uncommon configurations?

No special configuration, it is the AWS provided AMI - ami-4b133c5d.

Hi we could not find the AMI ami-4b133c5d, but we used another official Ubuntu 14.04 LTS (HVM) and we are able to reproduce the problem. We'll keep up updated.
I would however recommend to use a newer version of Ubuntu, e.g. 16.06 LTS.

We've identified the issue in the upstart script and we'll provide a new revision of the package.

@kylebush CrateDB 2.0.5-2 for Ubuntu is now available from the PPA.
https://launchpad.net/~crate/+archive/ubuntu/stable

authors: Taliik chaudum joemoe kylebush


text:
Whether dynamic columns can specify a word splitter

Use case:
User behavior analysis table, will be in later use, increase the different behavior column, in the dynamic increase column
Feature description:
Whether dynamic columns can specify a word splitter
dynamic columns can specify a word splitter

@gongweibiao1986 did our docs answer your question or could you explain your requirement further if not?


text:
Extend pg_catalog.pg_type with missing columns (at least typrelid)

Use case:
The PostgreSQL JDBC client invokes the following query when calling conn.getMetaData().getTypeInfo();
SELECT
    t.typname,t.oid
FROM
    pg_catalog.pg_type t
    JOIN pg_catalog.pg_namespace n ON (t.typnamespace = n.oid)
WHERE
    n.nspname  != 'pg_toast'
    AND  (t.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid))

This results in an error: Column typrelid unknown
PostgreSQL pg_type docs

Implemented in https://github.com/crate/crate/pull/9634


text:
Recover from corrupted Metadada caused by #13380

Summary of the changes / Why this improves CrateDB
Checklist

[ ] Added an entry in CHANGES.txt for user facing changes
[ ] Updated documentation & sql_features table for user facing changes
[ ] Touched code is covered by tests
[ ] CLA is signed
[ ] This does not contain breaking changes, or if it does:

It is released within a major release
It is recorded in CHANGES.txt
It was marked as deprecated in an earlier release if possible
You've thought about the consequences and other components are adapted
(E.g. AdminUI)

Currently, it is still a draft but it should have most of what is needed. The tests may seem verbose as it tries to show how my fixes affect the tables.

Hello @seut , Could you have a quick look at high level?

This list is WIP, will expand on it.
alter cluster swap table "m1"."t1" to "m1.s1"; // where both t1 and s1 are partitioned
// s1 is fully but t1 is partially recovered.

alter cluster swap table "m3.t3" to "m3.s3"; // where both t3 and s3 are partitioned
// both tables are partially recovered.

alter cluster swap table "m6.t6" to "m6"."s6"; // where t6 is partitioned and s6 is not partitioned
// t6 is fully but s6 is partially recovered.

alter cluster swap table "m7.t7" to "m7.s7"; // where t7 is partitioned and s7 is not partitioned
// t7 is fully but s7 is partially recovered.

Other variations are either duplicates of this list or fully recovered.

Hello @seut, could you have another rough look? I have tried to address things we discussed on Thursday.
I recently came across new scenarios have not considered yet, which I am working on right now. Thank you.

retest this please
unrelated : testTransientErrorsDuringRecoveryAreRetried
java.lang.AssertionError: timed out waiting for green state
	at __randomizedtesting.SeedInfo.seed([B4E7891983BBDC7F:DD0D654645BD34EB]:0)
	at org.junit.Assert.fail(Assert.java:89)
	at org.elasticsearch.test.IntegTestCase.ensureColor(IntegTestCase.java:735)
	at org.elasticsearch.test.IntegTestCase.ensureGreen(IntegTestCase.java:689)
	at org.elasticsearch.test.IntegTestCase.ensureGreen(IntegTestCase.java:678)
	at org.elasticsearch.indices.recovery.IndexRecoveryIT.testTransientErrorsDuringRecoveryAreRetried(IndexRecoveryIT.java:815)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.lang.Thread.run(Thread.java:1589)


text:
Add hash-join execution for left-outer-joins

Summary of the changes / Why this improves CrateDB
This implements hash-join execution for left-outer-joins according to https://github.com/crate/crate/issues/15147 by the following steps:

Extend HashInnerJoinBatchIterator to HashJoinBatchIterator which an additional option to emit non-matching join pairs with null values to support left-outer-join behaviour
Extend the planning pipeline to support Left Join-Type for Hash-Joins

Performance Improvements:
This is a comparison between the hash-join and nested-loop join execution on a table having 50 % matches and 50 % non-matches with different sizes running each time 100 iterations:
select count(*) from t1 left join t2 on t1.id = t2.id

Table sizes
Nestedloop (ms mean)
Hash-Join (ms mean)

10 / 10
2.045 ± 1.229
0.555 ± 0.110

100 / 100
4.455 ± 0.271
0.438 ± 0.028

1000 / 1000
169.494 ± 0.286
1.058 ± 0.018

10.000 / 10.000
21919.926 ± 653.076
7.955 ± 0.050

100.000 / 100.000
n/a
178.404 ± 4.188

@mfussenegger Could you give me some early feedback on this draft?

retest this please

New benchmarks are on its way.

There seems to be no overhead on the inner-hash-join according to the jmh bench:
this branch:
Result "io.crate.data.join.RowsBatchIteratorBenchmark.measureConsumeHashInnerJoin":
  2.646 ±(99.9%) 0.011 ms/op [Average]
  (min, avg, max) = (2.628, 2.646, 2.683), stdev = 0.014
  CI (99.9%): [2.636, 2.657] (assumes normal distribution)

Result "io.crate.data.join.RowsBatchIteratorBenchmark.measureConsumeHashInnerJoinWithHashCollisions":
  0.323 ±(99.9%) 0.003 ms/op [Average]
  (min, avg, max) = (0.318, 0.323, 0.331), stdev = 0.004
  CI (99.9%): [0.320, 0.326] (assumes normal distribution)

Benchmark                                                                 Mode  Cnt  Score   Error  Units
RowsBatchIteratorBenchmark.measureConsumeHashInnerJoin                    avgt   25  2.646 ± 0.011  ms/op
RowsBatchIteratorBenchmark.measureConsumeHashInnerJoinWithHashCollisions  avgt   25  0.323 ± 0.003  ms/op

master:
Result "io.crate.data.join.RowsBatchIteratorBenchmark.measureConsumeHashInnerJoin":
  2.679 ±(99.9%) 0.019 ms/op [Average]
  (min, avg, max) = (2.645, 2.679, 2.716), stdev = 0.025
  CI (99.9%): [2.660, 2.698] (assumes normal distribution)

Result "io.crate.data.join.RowsBatchIteratorBenchmark.measureConsumeHashInnerJoinWithHashCollisions":
  0.302 ±(99.9%) 0.002 ms/op [Average]
  (min, avg, max) = (0.297, 0.302, 0.311), stdev = 0.003
  CI (99.9%): [0.299, 0.304] (assumes normal distribution)

Benchmark                                                                 Mode  Cnt  Score   Error  Units
RowsBatchIteratorBenchmark.measureConsumeHashInnerJoin                    avgt   25  2.679 ± 0.019  ms/op
RowsBatchIteratorBenchmark.measureConsumeHashInnerJoinWithHashCollisions  avgt   25  0.302 ± 0.002  ms/op

@matriv Can you do another pass on this, please?

Please remove file .pom.xml.swp.

There seems to be no overhead on the inner-hash-join according to the jmh bench:
great, thank you!

I'd say to add a JMH benchmark as well.
Maybe you can do that already, but can also be done as a followup, as you like

I think it'll make sense to run end-to-end benchmarks for different sizes of tables to also see if for small sizes, NL could be faster than HashJoin.
Do you have any metrics for this? I think it would be nice to have an indication before merging the PR

Otherwise it look great, nice stuff!
Please give me just a bit more time, to take a closer look in the iterator (debug to understand it thoroughly), and I think we're good to go!

Do you have any metrics for this? I think it would be nice to have an indication before merging the PR

It's in the description of this pr.

(apologies, approved my accident)

authors: matriv mkleen


text:
ensured that PageDownstreams don’t emit anymore

when they are finished

ack

authors: bogensberger mfussenegger


text:
Replace DataTypeFactory with Supplier interface

DataTypeFactory doesn't do anything which the Supplier interface couldn't do.

Codecov Report

Merging #6102 into master will decrease coverage by 0.03%.
The diff coverage is 93.54%.

@@             Coverage Diff              @@
##             master    #6102      +/-   ##
============================================
- Coverage     83.16%   83.13%   -0.04%
  Complexity    12516    12516
============================================
  Files          1453     1453
  Lines         47347    47329      -18
  Branches       5814     5814
============================================
- Hits          39378    39348      -30
- Misses         5268     5281      +13
+ Partials       2701     2700       -1

Impacted Files
Coverage Δ
Complexity Δ

core/src/main/java/io/crate/types/StringType.java
91.42% <ø> (-0.24%)
17 <0> (-1)

core/src/main/java/io/crate/types/BooleanType.java
100% <ø> (ø)
18 <0> (-1)
:arrow_down:

core/src/main/java/io/crate/types/ObjectType.java
88.23% <ø> (-0.66%)
11 <0> (-1)

core/src/main/java/io/crate/types/DoubleType.java
100% <ø> (ø)
17 <0> (-1)
:arrow_down:

core/src/main/java/io/crate/types/ShortType.java
92% <ø> (-0.31%)
18 <0> (-1)

core/src/main/java/io/crate/types/FloatType.java
100% <ø> (ø)
19 <0> (-1)
:arrow_down:

...e/operation/aggregation/impl/TDigestStateType.java
63.63% <ø> (-3.04%)
5 <0> (-1)

...ore/src/main/java/io/crate/types/GeoShapeType.java
100% <ø> (ø)
17 <0> (-1)
:arrow_down:

...re/src/main/java/io/crate/types/UndefinedType.java
100% <ø> (ø)
10 <0> (-1)
:arrow_down:

core/src/main/java/io/crate/types/ByteType.java
95.83% <ø> (-0.17%)
18 <0> (-1)

... and 46 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56781a1...d4aa024. Read the comment docs.

authors: codecov-io mxm


text:
[BUG] [Fedora-38] crc setup freezes at "Checking if libvirt 'crc' network is available"

General information

OS: Fedora 38
Hypervisor: KVM
Did you run crc setup before starting it? I tried
Running CRC on: Laptop

CRC version
CRC version: 2.20.0+f3a947
OpenShift version: 4.13.0
Podman version: 4.4.4

CRC status
DEBU CRC version: 2.20.0+f3a947
DEBU OpenShift version: 4.13.0
DEBU Podman version: 4.4.4
DEBU Running 'crc status'

CRC config
- consent-telemetry                     : yes

Host Operating System
NAME="Fedora Linux"
VERSION="38 (Workstation Edition)"
ID=fedora
VERSION_ID=38
VERSION_CODENAME=""
PLATFORM_ID="platform:f38"
PRETTY_NAME="Fedora Linux 38 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:38"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f38/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=38
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=38
SUPPORT_END=2024-05-14
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Steps to reproduce

Download CRC binary and put it on PATH
Switch to MicroShift preset
Set RAM to 8000MB (not sure if that's relevant)
crc setup
crc start
I can't access the k8s API so I run crc stop
I run crc delete in preparation to switch to regular OpenShift
It freezes so I kill the process with ^C
Switch to default OpenShift profile
Run crc setup
It freezes at "Checking if libvirt 'crc' network is available"

Expected
crc setup exits within a few seconds
Actual
crc setup freezes.
Logs
I can't run crc, and trying to run crc delete -f also freezes.

crc setup worked fine for me but crc start hangs in the same stage. F38 as well.

It looks like this is the issue: https://github.com/systemd/systemd/issues/27953
Workaround: systemctl restart libvirtd.service

Seems like libvirtd was disabled for me. After enabling it, crc seems to be working

A restart might not work, better to do:
$ sudo systemctl enable --now libvirtd.service

I've been fighting this for the past few hours when I tried updating crc to the latest release.  I completely uninstalled libvert daemon and qemu-kvm and reinstalled, but that fixed nothing.  Finally got the it working after starting and enabling virtnetworkd, although I can't quite say for sure this is what fixed it.  I am also pretty sure that libvirtd doesn't actually have anything to do with running the VM, because I can clearly see it isn't running from the Cockpit console?
The following was in the libvirtd logs:
Failed to acquire pid file '/run/libvirt/network/driver.pid': Resource temporarily unavailable
I have also seen similar messages referring to librvirtd and qemu*.pid.
I was able to get libvirtd started after explicitly shutting it down and starting it again with systemctl, but a couple minutes later it shut itself done even as the crc vm kept running just fine.  I am pretty sure that libvirtd doesn't actually have anything to do with running the VM, because I can clearly see it isn't running from the Cockpit console.
I wish I understood these subsystems better to be more helpful, but even small data points like this might be helpful.

Recently they split libvirtd into separate services. This is why the main service might be OK in your case, but the network management service was not running (unavailable). This is specific to Fedora/systemd, and I understand there is an issue and a fix.
We might have to check what we can do to better assist in this case, as we are able to check the state of the services... but not all distros work this way.

Fwiw, after installing the libvirt package on a freshly installed fedora system, all the services below are enabled and running, and virsh -c qemu:///system ... was functional. libvirtd.service or libvirtd.socket are not part of that set.
$ systemctl list-unit-files --all|grep virt |grep enabled
virtlxcd.service                           enabled         enabled
virtqemud.service                          enabled         enabled
virtxend.service                           enabled         enabled
virtinterfaced.socket                      enabled         enabled
virtlockd.socket                           enabled         disabled
virtlogd.socket                            enabled         disabled
virtlxcd-admin.socket                      enabled         disabled
virtlxcd-ro.socket                         enabled         disabled
virtlxcd.socket                            enabled         disabled
virtnetworkd.socket                        enabled         enabled
virtnodedevd.socket                        enabled         enabled
virtnwfilterd.socket                       enabled         enabled
virtproxyd.socket                          enabled         enabled
virtqemud-admin.socket                     enabled         disabled
virtqemud-ro.socket                        enabled         disabled
virtqemud.socket                           enabled         disabled
virtsecretd.socket                         enabled         enabled
virtstoraged.socket                        enabled         enabled
virtxend-admin.socket                      enabled         disabled
virtxend-ro.socket                         enabled         disabled
virtxend.socket                            enabled         disabled

Bit of a follow up.  So after a few weeks of updating Fedora 38, I'm not having problems starting crc anymore (at least over a few system reboots for testing purposes), but the VM is completely shut down on every reboot now rather than just being put to sleep.  I went into Cockpit and saw it wasn't configured for an automatic start and see if that works, but it's a bit out of scope for this issue.  I am still on the penultimate release of crc (2.22.1+e8068b4) that I was on when I originally posted.
Unless more knowledgeable people than me (i.e. almost everyone) can figure out whether anymore time needs to spent on this, seems to me this one doesn't need to be an issue anymore?

autostart will not work, as when the VM is running, we considered CRC started... but in that case the openshift hasnt started as that is something we do as part of the crc start flow

From: hippyod @.>
Sent: Thursday, July 20, 2023 3:31:42 AM
To: crc-org/crc @.>
Cc: Gerard Braad @.>; Comment @.>
Subject: Re: [crc-org/crc] [BUG] [Fedora-38] crc setup freezes at "Checking if libvirt 'crc' network is available" (Issue #3719)
Bit of a follow up. So after a few weeks of updating Fedora 38, I'm not having problems starting crc anymore (at least over a few system reboots for testing purposes), but the VM is completely shut down on every reboot now rather than just being put to sleep. I went into Cockpit and saw it wasn't configured for an automatic start and see if that works, but it's a bit out of scope for this issue. I am still on the penultimate release of crc (2.22.1+e8068b4) that I was on when I originally posted.
Unless more knowledgeable people than me (i.e. almost everyone) can figure out whether anymore time needs to spent on this, seems to me this one doesn't need to be an issue anymore?
—
Reply to this email directly, view it on GitHubhttps://github.com/crc-org/crc/issues/3719#issuecomment-1642644441, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAAAOZQMUYUXUD3KHB7XEOTXRAYZ5ANCNFSM6AAAAAAZH62RAU.
You are receiving this because you commented.Message ID: @.***>

Updated version of systemd now available in f38 which does resolve this issue. I updated my f38 system today and it fixes it. I am closing the issue now.

Just FYI, now the CentOS 9 Stream got same issue. Hope they will resolve that soon.

authors: cfergeau danpawlik datho7561 gbraad hippyod jwendell praveenkumar

repo: crc-org/crc

license_source: github-api


text:
Update index.d.ts

better and safer typings
the typings were too loose, and missing the point of having them. this ensures proper (without typos) and proper self documentation of the operators.
tested the typings with all the examples listed on the README.md.

Coverage remained the same at 99.422% when pulling 75b06249e02afef5840bc1240d248f221dcc9edd on pocesar:typings into 297f21baaa02988b4e41b0ade8bd55bbd8aef723 on crcn:master.

Yeah, this is great. I've been meaning to update the typed definition file - thanks for doing that. This PR is available now in 3.3.3.

authors: coveralls crcn pocesar

license: mit


text:
License ambiguity

Hi.
This program is apparently under "MIT" license. https://github.com/creationix/git-browser/blob/master/package.json
However, there is no license file.
Moreover, "MIT license" is ambiguous. (X11) "This license is sometimes called the MIT license, but that term is misleading, since MIT has used many licenses for software." (Expat) "It is sometimes ambiguously referred to as the MIT License." https://www.gnu.org/licenses/license-list.html
Regards.

I included full license text.  That should resolve any questions.

Thanks.

authors: RyDroid creationix

repo: creationix/git-browser


text:
quotation marks around templated tweet language after donation

hi, i used the "tweet this" button on the cc donation page after i made a monthly donation and the resulting tweet has quotation marks around it:
https://twitter.com/ericsteuer/status/935595928047648769

fixed

authors: ericsteuer little-wow

license: MIT


text:
PNG icons to small at /downloads

https://creativecommons.org/about/downloads/ used to provide links to licensebuttons.net with a reasonable quality. Now the png icons are only 64x64 pixels. These are too small for common use on website.
Can we increase the size of the linked icons here.
Also see #953 for licensebuttons.net

Odd – I copied these directly from the old downloads page so they shouldn't have changed. I'd recommend that you use the SVG and scale for the time being.

Might be that I misremembered about the previous version. Issue remains, the PNG icons are to small to use. :)

Icons size increased to 1024x1024 px
also, Heart logos

authors: hugosolar little-wow mzeinstra


text:
There is an area that does not work on a 21:9 wide monitor.

There is an area that does not work on the wide monitor shown in the title.
If Crevice is restarted, it will work, but will not work again.

Hi@Teady999 ,
thank you for the report. Would you mind if  I ask more details?

actual display size (e.g. 1280x1080)
display scaling (e.g. 1.0, 1.25. 1.5)
the number of monitors and relative positions of each of them (if you have multiple monitors)
how long do you need to reproduce the issue?
where the area are you meaning for not working?

repo: creviceapp/creviceapp


text:
unexpected keyword argument 'task_type' in crewai tools config

Description
Getting error TypeError: BaseEmbedderConfig.__init__() got an unexpected keyword argument 'task_type' when code from https://docs.crewai.com/tools/WebsiteSearchTool/#customization-options is executed
Steps to Reproduce
from crewai import Agent, Task, Crew
from langchain_ollama import ChatOllama
from crewai_tools import WebsiteSearchTool
import os

tool = WebsiteSearchTool(
    config=dict(
        llm=dict(
            provider="ollama", # or google, openai, anthropic, llama2, ...
            config=dict(
                model="llama2"
            ),
        ),
        embedder=dict(
            provider="huggingface", # or openai, ollama, ...
            config=dict(
                model="sentence-transformers/all-MiniLM-L6-v2",
                task_type="retrieval_document",
            ),
        ),
    )
)

Save the above code to python file named test.py. Upon executing python test.py I am getting below error
TypeError: BaseEmbedderConfig.__init__() got an unexpected keyword argument 'task_type'
Expected behavior
To execute without any error
Screenshots/Code snippets

Operating System
Ubuntu 22.04
Python Version
3.12
crewAI Version
0.51.1
crewAI Tools Version
0.8.3
Virtual Environment
Venv
Evidence

Possible Solution

Additional context

Same here.

authors: alexdevassy sorin-costea

repo: crewAIInc/crewAI


text:
Can't install plugin

WhenEvery time I execute a commit I'm getting the following message:

ould not find plugin supporting checkstyle / Checkstyle,
available plugins: BeforeAll, Ci, Coffeelint, Common, ConsoleLog, Csslint, Debugger, GemfilePath, Go, GoBuild, GoFmt, Jshint, Jslint, Json, Local, MergeConflict, Migration, NbSpace, Pry, Rails, RspecFocus, Rubocop, Ruby, RubySymbolHashrockets, ScssLint, Tabs, Whitespace, Yaml

Happy to help to figure out the issue

Hi @icaspi
Thanks for using java-checkstyle.
Have you been done all steps to install it? in which step did you get this error?

Hey @icaspi
Since we have no updated on it should I close it?

I've got the same problem. @cristianoliveira
I follow all your instructions...

I see. I took a look on that and I think I already found the problem. I'm going to fix it.
Thank you for reporting that. :)

i am facing the same

if you have any updates please let me know

me too, same error

+1

authors: amitmawkin baihui212 cristianoliveira drei01 icaspi shidh

repo: cristianoliveira/java-checkstyle


text:
WSL symlink dereferencing is inconsistent across commands

Some commands follow links by default, some do not.
Command line flags are inconsistent (cp uses -P --no-dereference, mv uses -L --follow-links, etc.)
Standardize to:
-L  / --follow-links for flags, follow links by default.
Optionally support flags with same semantics for compatibility with Linux commands where needed.

On second thoughts the commands that need to have explicit specification for --follow-links behavior are: 'rm' and 'mv', i.e. are we renaming / removing the link or the pointed-to path? And nice to have in 'du' and 'grep', other than that behavior should be follow by default, since that is what rust std::fs seems to be doing for non-WSL symlinks.

repo: cristivlas/shmy


text:
Use LocalStorage for data persistence

Web storage APIs have come really far, so I thought I'd take a swing at making this tool save directly to your browser. It requires a modern browser, but otherwise should work everywhere. It should also make autosaving (#28) really easy.
I'll probably implement this one way or another on my fork since I frequently use this awesome tool. If there's interest then I'll post a PR 👍

👍 A PR would definitely be welcome!

PR #67 is now merged and deployed. Note that it only auto-saves when you change the active card.

authors: crobi sedge

repo: crobi/rpg-cards


text:
Logical/arithmetical shift?

How does C++'s shift function work? Does it keep sign bit?

According to wikipedia: If you are shifting signed int, eg. some_signed_int >> 5, the arithmetical shift is performed (signed bit is carried). When you are shifting unsigned int, logical shift is performed.
Source (see note 3): https://en.wikipedia.org/wiki/Arithmetic_shift#cite_note-3

authors: mathius xtracko

repo: crocs-muni/EACirc


text:
Store last notification time with user config

Tables user_config and user_last_notified track user configs and last notification date for users respectively. This information is gathered together into a unified object for the Python side by get_user_configs_for_frequency.sql which left joins the two tables. This process takes 1-2 mins on my local machine, indicating that it is a significant time sink.
The reason the two tables are separate is because the user_config table is wiped with each run and redownloaded from Wikidot. This fact also makes adding indexes to speed up the process useless, because rewriting the data is guaranteed.
A better approach would be:

Track last notification date in the same table as the rest of the user info.
Instead of wiping the data, selectively update/add/remove rows as needed according to the new data.

As only a tiny minority of users will update their config between each run, this should make both writes and reads vastly more efficient.

Benchmarking on my local machine:

Gap 1 is the simple act of getting user configs for a channel, which should be near-instant, but is inflated by needing to correlate the user and user timestamp tables.

After implementation of this issue in 06f0552:

Finding a channel's users took 1 min. That's a nice little time saving but still not nearly as much as I hoped.

repo: croque-scp/notifier


text:
CROSS_REMOTE=1 with persistent volume doesn't change project files

Checklist

[X] I've looked through the issues and pull requests for similar reports

Describe your issue
Using CROSS_REMOTE=1 with persistent volume, changing files in the project does not carry over across the first remote build.
What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?

[X] macOS
[ ] Windows
[X] Linux / BSD
[ ] other OS (specify in description)

What architecture is the host?

[X] x86_64 / AMD64
[ ] arm32
[X] arm64 (including Mac M1)

What container engine is cross using?

[X] docker
[ ] podman
[ ] other container engine (specify in description)

cross version
8d8d84b
Example
$ cross-util volumes create
$ cargo new --bin issue1016
$ cd issue1016
$ CROSS_REMOTE=1 cross run
...
   Compiling issue1008 v0.1.0 (/cross/Users/emil/workspace/issue1016)
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s
     Running `/linux-runner x86_64 target/x86_64-unknown-linux-gnu/debug/issue1016`
Hello, world!
$ # edit src/main.rs to say something else
$ CROSS_REMOTE=1 cross run
...
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
     Running `/linux-runner x86_64 target/x86_64-unknown-linux-gnu/debug/issue1016`
Hello, world!

Additional information / notes
tested in ci in https://github.com/cross-rs/cross/runs/8285127194?check_suite_focus=true

That shouldn't happen due to the fingerprinting done. The only thing I can imagine is if the modified timestamps aren't getting updated:
https://github.com/cross-rs/cross/blob/8d8d84bc5f180b1e6b10121de6c072a618dc7f8e/src/docker/remote.rs#L549-L576

The files are copied with docker cp, they just don't seem to stick. The fingerprinting is checked, files are marked as having been changed, but the copy doesn't work

I wonder if this is a wider issue, does updating a persistant volume also not work?

I wonder if this is a wider issue, does updating a persistant volume also not work?

It should, I'm going to take a deep look at this. We've been adding new toolchains to persistent data volumes ever since we switched it so we only copy the base toolchain over during initial creation, and not the addition files for a specific target, and only copy those other files later when we're cross-compiling while using a persistent data volume.
So, this shouldn't be happening, and if it was, there should have been earlier signs this wasn't working.

Manually verified this with running the code myself as well:
$ /usr/bin/docker run --userns host --name cross-stable-x86_64-unknown-linux-gnu-16b8c-a8314ef7d-x86_64-unknown-linux-gnu-issue1016-bb6bb --rm -v cross-stable-x86_64-unknown-linux-gnu-16b8c-a8314ef7d:/cross -v /cross/cargo/bin -it ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main bash
$ cat cross/home/ahuszagh/Desktop/cross/issue1016/src/main.rs
fn main() {
    println!("Hello, world!");
}

Or the file is unmodified. I'm unsure if the temporary directory, however, is populated. For example, for me, /home/ahuszagh/.local/share/cross-rs/tmp/.tmpYDT6yw.

This shouldn't be happening, since docker cp is supposed to overwrite files:

SRC_PATH specifies a file

DEST_PATH does not exist: the file is saved to a file created at DEST_PATH
DEST_PATH does not exist and ends with /: Error condition: the destination directory must exist.
DEST_PATH exists and is a file: the destination is overwritten with the source file’s contents
DEST_PATH exists and is a directory: the file is copied into this directory using the basename from SRC_PATH

The -a flag is supposed to just preserve the GID/UID information:

--archive , -a: Archive mode (copy all uid/gid information)

I'm not sure the cause of this, trying to debug the issue now. I wonder if the files are properly getting copied to the temp directory: I've seen that docker cp -a is properly invoked. The files should be copied to the temporary directory, since they are prior to fingerprinting.

I think the best solution is the 2 step approach: otherwise, we will have to copy either a directory or tarballs into the container, then we can either have a script that writes into the destination recursively (with overwriting existing files), we can decompress a tarball (a second set of copies), or we can copy with overwrite from src to dst (a second set of copies). The remove then copy step uses logic we already have and avoids redundant copies (since we already have to copy into the temp directory, then to the Docker container).

authors: Alexhuszagh Emilgardis

repo: cross-rs/cross


text:
Setup machinery to build package and controller binary images

Adds initial setup to build and publish provider images. Does not yet include tf plugins in controller image.

@kasey should we go ahead and get this merged so we can have CI on subsequent branches where I enable building in the plugins to the controller image?

@kasey should we go ahead and get this merged so we can have CI on subsequent PRs where I enable building in the plugins to the controller image? I can setup some integration tests as well.

sgtm

authors: hasheddan kasey


text:
DO NOT MERGE: nonportable class

Description of your changes

Changes strongly-typed classes from Class to NonPortableClass and updates claim controllers.
Do not merge until predicates are updated in crossplane-runtime and dependency version is bumped.
Partial fix for crossplaneio/crossplane#723 and crossplaneio/crossplane#703
Checklist

I have:

[x] Run make reviewable to ensure this PR is ready for review.
[x] Ensured this PR contains a neat, self documenting set of commits.
[x] Updated any relevant documentation, examples, or release notes.

Nice! https://github.com/crossplaneio/crossplane-runtime is merged, so this should be good to go once you bump the dep.

authors: hasheddan negz

repo: crossplaneio/stack-azure


text:
[ATIP] Fix ugly False assertion

BUG=https://crosswalk-project.org/jira/browse/CTS-1712

LGTM

LGTM

authors: Honry haoxli

repo: crosswalk-project/crosswalk-test-suite


text:
Slugification of capital umlauts can be improved

For example, in the filename template a capital Ü is transliterated to UE, which means that e.g. Überwacher is transliterated to UEberwacher.
Ideas: either take some explicit care of it, or slugify to a complete lower-case string.

Conversion for Umlauts is currently done here. I think manual replacement was done, because ´intl´ transliterates ü to u instead of ue.
Currently we don't check the context (Überwacher should transliterate to Ueberwacher, but TÜV should transliterate to TUEV), but this seems a little more complex. A regular expression would probably help.

Fixed here and in 460d6d3.

authors: a-tze jjeising

repo: crs-tools/tracker


text:
Disable User Interaction in Options

How can you disable user interaction using an option? I've tried setting an empty array for kCRToastInteractionRespondersKey, but it merges that and the defaults instead of overriding it.

This looks like a possible dupe of #160?

Yes, sorry.

authors: dmiedema jadar

repo: cruffenach/CRToast


text:
Fix ColorPicker screenshots by upgrading styled-components

Summary
The inconsistent style-components version is causing a few ColorPicker related screenshots to fail in #289.  This is mainly due to the ColorPicker use ref which is only supported in styled-components v4 (innerRef deprecated). Fixed by updating styled-components to v4.
Test
The existing screenshots should pass.

Any idea why the chart.js screenshots are changing? Is it related to this change or are they flaky?

The changes come from #289, likely not related to flakiness. Just merged #289. Gonna trigger a rebuild and see if the chart.js related screenshots will change

repo: cruise-automation/webviz


text:
variable speed pump buttons do not include body of water name

The buttons for the preset speed settings on variable speed pumps do not include the body of water name in the friendly name. Other entities do have the body of water name, we should ensure that this is consistent across the board.

As the entities are tied under a device for the body of water, I have made the naming consistent to omit the body of water from the friendly name.  This avoids stutter naming for the friendly name.  We are however including the BOW name in the entityID so that we can avoid collisions in case we have equipment named the same thing (or shared equipment) across multiple BOWs

repo: cryptk/haomnilogic-local


text:
Some buttons lead to a blank page (packaged web bundle)

See:
http://gfycat.com/PaltrySandyBallpython
Clicking "Retry" leads to an empty page in both the electron and the web ui.
Using the bundle created from "npm run-script build" in web/

@maqifrnswa can you comment on this and let us know if it's still an issue?

fixed!

authors: maqifrnswa wmbutler

repo: cryptonomex/graphene-ui


text:
Test renewal of annual membership

Create an annual membership, renew it before expiration, make sure the date is pushed back the proper amount regardless of when the renewal occurs.
Then try renewing a lapsed annual membership.  Make sure fees have reasonable semantics in the gap between expiry and renewal.

Related bugs:  #455 #539

This issue was moved to bitshares/bitshares-2#42

authors: theoreticalbts vikramrajkumar

repo: cryptonomex/graphene


text:
The Trivial class class U; end Doesn't Compile

The following code does not compile (https://play.crystal-lang.org/#/r/a6a0):
class U
end

Diagnostics:
In /usr/lib/crystal/comparable.cr:83:16

 83 | abstract def <=>(other : T)
                   ^--
Error: abstract `def Comparable(T)#<=>(other : T)` must be implemented by Slice(T)

Trivial changes (using any other letter than U) work.
Interestingly, a trivial modification to Slice(T) makes the error go away: just replace the type restriction variable U in the definition of <=> with something else, however this just moves the problem to another trivial class (replacing U witih Zee breaks the trivial class named Zee).
I'm still exploring, but I think this may be related to https://github.com/crystal-lang/crystal/issues/9173.
I'm  using Crystal v.0.35.1.

We have:
module Comparable(T)
  abstract def <=>(other : T)
end

struct Slice(T)
  include Comparable(Slice)

  def <=>(other : Slice(U)) forall U
  end
end

class U
end

What happens here is the compiler tries to match other : Slice(U) against other : T, but that T is assigned the Slice type (which is distinct from Slice(T) by the way), due to the generic include. Currently, abstract def lookup doesn't consider free vars:
https://github.com/crystal-lang/crystal/blob/cb09b0e218768c759f261424f10a0abb48edff0f/src/compiler/crystal/semantic/abstract_def_checker.cr#L239-L260
#10155 considers them, but this still fails because the PR currently ignores types substituted through generic inheritance/includes. As type lookup now succeeds, Slice(U) is obviously not substitutable for T or Slice, because the former is an instantiated generic and the latter isn't.
Supposing free vars are checked, the compiler would then determine that Slice(U) forall U is substitutable for T or Slice. That's fine for this case but if there is more than one type var the results would be different (that doesn't affect this issue though).

We have:
module Comparable(T)
  abstract def <=>(other : T)
end

struct Slice(T)
  include Comparable(Slice)

  def <=>(other : Slice(U)) forall U
  end
end

class U
end

What happens here is the compiler tries to match other : Slice(U) against other : T, but that T is assigned the Slice type (which is distinct from Slice(T) by the way), due to the generic include. Currently, abstract def lookup doesn't consider free vars:
https://github.com/crystal-lang/crystal/blob/cb09b0e218768c759f261424f10a0abb48edff0f/src/compiler/crystal/semantic/abstract_def_checker.cr#L239-L260
#10155 considers them, but this still fails because the PR currently ignores types substituted through generic inheritance/includes. As type lookup now succeeds, Slice(U) is obviously not substitutable for T or Slice, because the former is an instantiated generic and the latter isn't.
Supposing free vars are checked, the compiler would then determine that Slice(U) forall U is substitutable for T or Slice. That's fine for this case but if there is more than one type var the results would be different (that doesn't affect this issue though).

thanks @HertzDevil
why does this become a problem only for the class named U? upon failing to match Slice(U) does the compiler then see U as the class instead of a type variable?

thanks @HertzDevil
why does this become a problem only for the class named U? upon failing to match Slice(U) does the compiler then see U as the class instead of a type variable?

Turns out some of those generics aren't necessary:
module Foo
  abstract def foo(x : Int32)
end

class Bar
  include Foo

  def foo(x : Quux) forall Quux # okay
  end
end

module Foo
  abstract def foo(x : Int32)
end

class Bar # Error: abstract `def Foo#foo(x : Int32)` must be implemented by Bar
  include Foo

  def foo(x : Quux) forall Quux
  end
end

class Quux
end

authors: HertzDevil toddsundsted

repo: crystal-lang/crystal


text:
Invalid option: -v when linking with libcrypto/libssl

require "openssl"

pp OpenSSL::SSL::Context::Server.new

crystal i test.cr.
I looked into this a bit, and am pretty sure it's because of the Link annotation having -v within it: https://github.com/crystal-lang/crystal/blob/master/src/openssl/lib_crypto.cr#L37.

Stacktrace
Invalid option: -v (OptionParser::InvalidOption)
from /home/george/dev/git/crystal/src/option_parser.cr:128:45 in '->'
from /home/george/dev/git/crystal/src/option_parser.cr:494:27 in 'parse'
from /home/george/dev/git/crystal/src/option_parser.cr:116:5 in 'parse'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/context.cr:368:5 in 'loader'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/context.cr:380:5 in 'c_function'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1883:17 in 'compile_lib_call'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1764:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2990:5 in 'request_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:578:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2990:5 in 'request_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1219:5 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1979:7 in 'create_compiled_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1777:22 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1979:7 in 'create_compiled_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1777:22 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:447:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1399:5 in 'get_const_index_and_compiled_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2486:27 in 'initialize_const_if_needed'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1371:17 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2990:5 in 'request_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2144:9 in 'compile_call_args'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1773:5 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:1399:5 in 'get_const_index_and_compiled_def'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:680:31 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2904:5 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2994:5 in 'discard_value'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2852:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def:closure_owner'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2952:5 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def:closure_owner'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:2952:5 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
from /home/george/dev/git/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/compiler.cr:165:5 in 'compile'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/interpreter.cr:207:5 in 'interpret'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/repl.cr:146:5 in 'interpret'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/repl.cr:150:5 in 'interpret_and_exit_on_error'
from /home/george/dev/git/crystal/src/compiler/crystal/interpreter/repl.cr:121:5 in 'run_file'
from /home/george/dev/git/crystal/src/compiler/crystal/command/repl.cr:17:7 in 'repl'
from /home/george/dev/git/crystal/src/compiler/crystal/command.cr:100:7 in 'run'
from /home/george/dev/git/crystal/src/compiler/crystal/command.cr:51:5 in 'run'
from /home/george/dev/git/crystal/src/compiler/crystal/command.cr:50:3 in 'run'
from /home/george/dev/git/crystal/src/compiler/crystal.cr:11:1 in '__crystal_main'
from /home/george/dev/git/crystal/src/crystal/main.cr:115:5 in 'main_user_code'
from /home/george/dev/git/crystal/src/crystal/main.cr:101:7 in 'main'
from /home/george/dev/git/crystal/src/crystal/main.cr:127:3 in 'main'
from /usr/lib/libc.so.6 in '??'
from /usr/lib/libc.so.6 in '__libc_start_main'
from /home/george/dev/git/crystal/.build/crystal in '_start'
from ???

EDIT: libssl also has a -v flag.

It's probably because shell expansion is not yet implemented for ldflags on the interpreter's loader.

@Blacksmoke16 can you try your test code again but using the PR code above?

I would, but my machine is having some problems with openssl in general. Just thought I'd ask since you originally posted.

@mdwagner Applying your change resolves the issue. At least on my system; can't speak for other OS/arch if those would be any diff.

I can verify from I3oris/ic#5 that merging this fix into ic resolved this issue for me too (Ubuntu/x86_64)

Following is backtrace when i run crystal -i src/some_file.cr on one very small kemal web app.
Invalid option: -v (OptionParser::InvalidOption)
  from Crystal/crystal/src/option_parser.cr:128:45 in '->'
  from Crystal/crystal/src/option_parser.cr:494:27 in 'parse'
  from Crystal/crystal/src/option_parser.cr:116:5 in 'parse'
  from Crystal/crystal/src/compiler/crystal/interpreter/context.cr:365:1 in 'loader'
  from Crystal/crystal/src/compiler/crystal/interpreter/context.cr:378:5 in 'c_function'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1883:17 in 'compile_lib_call'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1764:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2990:5 in 'request_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:578:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2990:5 in 'request_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1219:5 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1979:7 in 'create_compiled_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1777:22 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1979:7 in 'create_compiled_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1777:22 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:447:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1399:5 in 'get_const_index_and_compiled_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2486:27 in 'initialize_const_if_needed'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1371:9 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2990:5 in 'request_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2144:9 in 'compile_call_args'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1773:5 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:1399:5 in 'get_const_index_and_compiled_def'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:680:31 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2904:5 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:3000:5 in 'accept_with_wants_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2994:5 in 'discard_value'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2852:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def:closure_owner'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2952:5 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:234:5 in 'compile_def:closure_owner'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:2952:5 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:566:7 in 'visit'
  from Crystal/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
  from Crystal/crystal/src/compiler/crystal/interpreter/compiler.cr:165:5 in 'compile'
  from Crystal/crystal/src/compiler/crystal/interpreter/interpreter.cr:207:5 in 'interpret'
  from Crystal/crystal/src/compiler/crystal/interpreter/repl.cr:146:5 in 'interpret'
  from Crystal/crystal/src/compiler/crystal/interpreter/repl.cr:150:5 in 'interpret_and_exit_on_error'
  from Crystal/crystal/src/compiler/crystal/interpreter/repl.cr:121:5 in 'run_file'
  from Crystal/crystal/src/compiler/crystal/command/repl.cr:17:7 in 'repl'
  from Crystal/crystal/src/compiler/crystal/command.cr:100:7 in 'run'
  from Crystal/crystal/src/compiler/crystal/command.cr:51:5 in 'run'
  from Crystal/crystal/src/compiler/crystal/command.cr:50:3 in 'run'
  from Crystal/crystal/src/compiler/crystal.cr:11:1 in '__crystal_main'
  from Crystal/crystal/src/crystal/main.cr:115:5 in 'main_user_code'
  from Crystal/crystal/src/crystal/main.cr:101:7 in 'main'
  from Crystal/crystal/src/crystal/main.cr:127:3 in 'main'
  from /usr/lib/libc.so.6 in '??'
  from /usr/lib/libc.so.6 in '__libc_start_main'
  from ../sysdeps/x86_64/start.S:117 in '_start'
  from ???

Crystal 1.5.0-dev [0123976d8] (2022-06-09)
LLVM: 13.0.1
Default target: x86_64-pc-linux-gnu on Arch


text:
Implement a rational data type

Built-in rational data type will give the ability to represent numbers like 1/3 and -11/17 without rounding.
There are different options: defaulting to the rational type when using 1/10 or using ruby inspired syntax with 1/10r

@RX14 BigRational is not the same as Rational ─ which would be a smaller and more primitive type  (and maybe generic?).
The issue "Implement a rational data type," does not necessarily prompt for a literal or operations on integers to return them. If there is no better way we can at least construct them manually Rational32.new 1, 3, or generic Rational(Int32), ─ hell, maybe even something à la IntX: Rat32.
I think this should be reopened, rationals are very nice to work with.

@Jens0512 For this to be reopened, there should be a reasonable cause why BigRational isn't enough. I don't think there is any.


text:
Array of String should have been expanded on early return

HTTP::Client.get("http://example.com/")
exit
require "http"

causes...
BUG: ["ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-CHACHA20-POLY1305", "ECDHE-ECDSA-AES128-GCM-SHA256", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384", "DHE-RSA-AES128-GCM-SHA256", "DHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-AES128-SHA256", "ECDHE-RSA-AES128-SHA256", "ECDHE-ECDSA-AES128-SHA", "ECDHE-RSA-AES256-SHA384", "ECDHE-RSA-AES128-SHA", "ECDHE-ECDSA-AES256-SHA384", "ECDHE-ECDSA-AES256-SHA", "ECDHE-RSA-AES256-SHA", "DHE-RSA-AES128-SHA256", "DHE-RSA-AES128-SHA", "DHE-RSA-AES256-SHA256", "DHE-RSA-AES256-SHA", "ECDHE-ECDSA-DES-CBC3-SHA", "ECDHE-RSA-DES-CBC3-SHA", "EDH-RSA-DES-CBC3-SHA", "AES128-GCM-SHA256", "AES256-GCM-SHA384", "AES128-SHA256", "AES256-SHA256", "AES128-SHA", "AES256-SHA", "DES-CBC3-SHA", "!RC4", "!aNULL", "!eNULL", "!LOW", "!3DES", "!MD5", "!EXP", "!PSK", "!SRP", "!DSS"] of ::String at /Users/martyn/crystal/crystal/src/openssl/ssl/context.cr:13:13 should have been expanded

Crystal 0.24.1+123 [80cbe6603] (2018-01-16)
LLVM: 5.0.0
Default target: x86_64-apple-macosx

Closed due to lack of interest

It seems like a bug, but its not really a valid program right? The exit won't let you reach the require

@bararchy well the require is not really a statement, it shouldn't be impacted by its place in the file, this definitely looks like a bug.
I don't know if it's lack of interest or I-have-absolutely-no-idea-why-this-thing-happened that makes the core devs push this issue to later/some day..

@bew makes sense.
@mjago can you re-open the issue? lets give the devs time to work on that and see what the issue is, maybe @RX14 or @straight-shoota has an idea.

If it says bug in the error it's ALWAYS a bug, even if it shouldn't compile or the code doesn't make sense.

Reduced:
A
exit

A = [1, 2, 3]

This issue seems to be fixed now.
The original example just runs a http request and the reduced example just works.

just ftr, it was fixed in Crystal 1.2.0.

authors: BlobCodes RX14 Sija asterite bararchy bew mjago


text:
Error while building crystal from sources: llvm/IR/DIBuilder.h: No such file or directory

Hello,
I've just got the latest master branch as advised in https://crystal-lang.org/docs/installation/from_source_repository.html but I have some compilation errors.
Using /usr/bin/llvm-config [version=3.4.2]
g++ -c  -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/include  -DNDEBUG
 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
--param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -fomit-frame-pointer
-std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual
-Wcast-qual
src/llvm/ext/llvm_ext.cc:1:31: fatal error: llvm/IR/DIBuilder.h: No such file or directory
 #include "llvm/IR/DIBuilder.h"
                               ^
compilation terminated.
make: *** [src/llvm/ext/llvm_ext.o] Error 1

I got this error with LLVM7 as well!
➜  crystal git:(master) make
Using /usr/bin/llvm-config [version=7.0.0]
g++ -c  -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/lib/llvm-7/include -std=c++0x -fuse-ld=gold -Wl,--no-keep-files-mapped -Wl,--no-map-whole-files -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -DNDEBUG  -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
src/llvm/ext/llvm_ext.cc:1:31: fatal error: llvm/IR/DIBuilder.h: No such file or directory
compilation terminated.
Makefile:123: recipe for target 'src/llvm/ext/llvm_ext.o' failed
make: *** [src/llvm/ext/llvm_ext.o] Error 1

I jist looked at LLVM git and DIBuilder.h hasn't gone away or changed since 6.0, so i'd go so far as to blame the packaging here.

authors: RX14 evandrojr ovidiugabriel


text:
Add shard.yml

Resolves #14363

When I tried this, the symlink directories at lib/markd/lib and lib/reply/lib were included in the commit, so I wonder if something went wrong in my setup

Ah no, I messed up with my git diff. It looked clean when it wasn't. 🤦 The lib symlinks are to be included, of course.

authors: HertzDevil straight-shoota


text:
Use dup3 and pipe2 to set O_CLOEXEC when available

We already used dup3 when available to set FD_CLOEXEC safely, but we were missing LibC bindings, so it wasn't used.
The patch implements for IO#reopen: we now prefer pipe2 over the regular pipe to set FD_CLOEXEC safely.
Both syscalls aren't standard, but they're widely available (Linux, BSD, but Darwin).
Companion to #14672

suggestion: add/rework specs.


text:
fix(web_socket): call on_close for all errors

I occasionally see Errno on our webserver when calling run and all the clean-up code is in the on_close callback which is not called.
Consider the websocket handler in the stdlib, when run is called and an IO error such as Errno occurs on_close is never called and hence any references stored by the user defined code are leaked
Not something I'm able to replicate, hence the lack of tests, but I see it in the logs and our monitoring also confirms a leak.

Why not remove the exception's type restriction entirely and call on_close on every error? Technically, there might not be any other than IO::EOFError | Errno being raised, but it should still express the intention. We can assume that when ws.receive raises (for whatever reason) items the websocket is no longer in a working state.

Yeah good point @straight-shoota I'll update

feel like reviewing @straight-shoota ?

IMO good candidate for 0.32.1.

Sure, let's make it to 0.32.1.

authors: Sija bcardiff stakach straight-shoota


text:
Compiler: add implicit block arguments (_1, _2, etc.)

Note: this PR exists because I wanted to see how hard was it to implement it. It's not decided yet whether this is something that we want... but I enjoy coding these things :-) . Also with this people can try it out themselves.
This is exactly like in Ruby. I chose _1, _2, etc. instead of &1, &2, etc. because & means the start of a block or a block arguments:
foo &.bar
foo &block_argument

so it would be a bit confusing to reuse & to also mean "block argument":
foo { bar &1 } # is &1 a block given to bar?

I also think _1 is visually less noisy than &1. And maybe _1 is a bit easier to type (no need to move the right hand to the middle of the keyboard).
Finally, it's the same as in Ruby so Rubyists will feel familiar with this syntax.
Examples
[1, 2, 3].each { puts _1 }
# Output:
# 1
# 2
# 3

files = ["foo.cr", "bar.cr"]
files.map { File.exists?(_1) }

# same as:
files.map { |file| File.exists?(file) }

%w(World Computer).each { puts "Hello #{_1}!" }
# Output:
# Hello World
# Hello Computer

Hash(String, Array(Int32)).new { _1[_2] = [0] }

# same as:
Hash(String, Array(Int32)).new { |h, k| h[k] = [0] }

Do I like it?
I think for cases like the File.exists? above where it's obvious that each block argument will be a file, and the block is pretty small, that it actually improves readability.
Also with try when you need to do something other than invoke a method on the yielded object:
file = # a nilable string
file.try { File.exists?(_1) }

# instead of:
file.try { |file| File.exists?(file) } # So many files! So confusing!

# or:
file.try { |the_file| File.exists?(the_file) }

Note how the two latter ways of writing it introduce a lot of noise (the block syntax, the variable name). The first way is pretty "zen" in my mind.
I also think it finishes generalizing the block syntax. Right now we have the explicit block syntax:
[1, 2, 3].map { |x| x.to_s }

We have the &. shorthand for when you want to invoke a method on the first and only block argument:
[1, 2, 3].map &.to_s

But no syntax exists for the general case when you want to do something with the block arguments without needing to explicitly mention them. Other languages have it (Kotlin, just for the first argument), Ruby now has _1 and _2, and Elixir has the general &(exp(&1, &2)) expansion syntax.
Breaking change
This is a tiny breaking change because if you had a variable named _1, well, now it's no longer a variable. But I think those cases shouldn't exist... I hope! And fixing those occurrences is easy.

I love it. And agree on the usefulness for shorter code and for try is really nice. That’s primarily what I’d use it for. Easier to write and read in these cases

This is similar in Elixir also: https://elixir-lang.org/getting-started/modules-and-functions.html
I don’t find it confusing using &1 because the concepts are related.
I love this feature. You know it because we talked several times about it 😉. But in any case I would leave the feature and discussion post 1.0

I could/would definitely use this right now, as it would make allot of my code shorter and easier to read.

Note: "you" here doesn't mean the author, just anyone

Ah yes. "Pass a block that accepts no arguments and gets the 2nd from the 1st."
That's how one reads this code. Easy discount on WTFs/sec. And don't try to tell me you'll get used to it. Well, even if you will, the vast majority won't. But I don't believe you will either. This will be a mental interrupt every single time.
Because you couldn't be bothered to declare the args, every time someone reads that code will have to stumble on it. Do we deserve that? Is it OK to keep going in the direction where code can be read only by its author even if it's not logically convoluted?
I personally wouldn't want that, and I definitely don't trust people to not abuse it (i.e. put it into any expression > 20 chars, where the distance between "cool, it accepts no args" and "wait, what's first?" is already too much) -- sadly Crystal would be particularly exposed to this compared to other languages due to the association with Ruby where there's just no common sense of restraint on one-liners.

What's the semantic for nested blocks and block short syntax?
files.each { Log.debug { _1 } }

That won't work, and it'll log nothing, or the arg to Log.debug, or fail at compile time if nothing is given to Log.debug' block (I don't remember).
But what about:
files.each { Log.debug &.entry(_1) }

Using the dsl syntax demoed in another log pr iirc, will that log each file in files ?

@bew it aways applies to the closest surrounding block
I do agree with @oprypin that this is not needed and that it might be negative to introduce the feature.

Yes, I think we should rather think about how to improve the pass a method as block syntax. Maybe we can allow something like this just in a block shorthand? I think this can solve @oprypin's arguments somewhat, first of all enforcing a short distance and and second it doesn't make you mentally enter into block parse mode by introducing a new "short hand block" parse mode.
Not a syntax proposal, just trying to show that the examples that motivate this can be equally solved with that:
[1, 2, 3].each { puts _1 }
[1, 2, 3].each &:puts
[1, 2, 3].each &:puts(_1)

files = ["foo.cr", "bar.cr"]
files.map { File.exists?(_1) }
files.map &:File.exists?
files.map &:File.exists?(_1)

%w(World Computer).each { puts "Hello #{_1}!" }
%w(World Computer).each &puts("Hello #{_1}!")

Hash(String, Array(Int32)).new { _1[_2] = [0] }
Hash(String, Array(Int32)).new  &.[_2]=([0])

Some more from the forum post. Not arguing that the proposal makes them strictly better than the current expanded form, just to demonstrate the problem space that can be attacked by it.
[1, 2, 3].map { _1 + 3 }
[1, 2, 3].map &.+(3)

(1..9).each_slice(3).map { _1 + _2 + _3 }
(1..9).each_slice(3).map &.+(_2 + _3) # of course that should just be &.sum

[{name: 'foo'}, {name: 'bar'}].map { @1[:name] }
[{name: 'foo'}, {name: 'bar'}].map &.[:name]

user = User.first?
user.try { ChargeCard.call(prince_in-cents: 500, user: _1 }
user.try &:ChargeCard.call(prince_in-cents: 500, user: _1)

password.value.try do
  copy_and_encrypt_password _1, to: encrypted_password
end
password.value.try &:copy_and_encrypt_password(to: encrypted_password)
# above is going to far probably and should be
password.value.try &:copy_and_encrypt_password(_1, to: encrypted_password)

So to formalize:

Extend &. expressions to allow to refer the arguments as _1, _2, _3, ....
If the call in the &. expression  has no explicit argument list, pass it the remaining arguments (second, third, fourth...).
Introduce &: Where &. expands to a call on the first block argument, &: simply skips that part of the expansion.
&: expressions support to refer to the arguments as _1, _2, _3, ... as well.
For &:, if the call has no explicit argument list, pass the arguments (first, second, third...)

So much for the base. Possible extensions

Don't require the number of block arguments to match the number of positional arguments exactly. That is if the the method takes fewer positional arguments than there's block arguments, ignore the extra block arguments.
If the call only has explicit named arguments, pass  the block arguments (for &. starting with the second, for &: starting with the first) to the method as positional arguments as above.

Please let's focus on the semantics of this proposal first. Any signs chosen here are explicitly not part of the proposal and just used for demonstration purposes! I would prefer to keep the discussion focused on semantics and in case those semantics would be a feature beneficial to the language, we can then discuss the best syntax for this.

I feel this feature takes us back to the cryptic Perl-land with all those magic $1 variables and such.
What I'd be reeeeally excited about though, is Elixir-like syntax allowing me to do thing like {"foo.txt" => "bar"}.each(&->File.write(&1, &2)) - which I was missing from the day I've discovered Elixir.

{"foo.txt" => "bar"}.each(&->File.write(&1, &2))

// note that you can do this already:
{"foo.txt" => "bar"}.each(&->File.write(String, String))
But yes, that, or https://github.com/crystal-lang/crystal/pull/9197, seems fine to me, as these don't exhibit the biggest problem I see with this proposal, which is that the syntax for a block with 0 args is reused for a block with any (not immediately visible) number of args.

@oprypin true indeed, what I've missed was the &.foo($1, $2) syntax.

Well, that's exactly what this current proposal gives you, then :smile: :question:

@Sija it seems this PR is what you want but with a different syntax?

Ah yes. "Pass a block that accepts no arguments and gets the 2nd from the 1st."

That's how one reads this code. Easy discount on WTFs/minute. And don't try to tell me you'll get used to it. Well, even if you will, the vast majority won't. But I don't believe you will either. This will be a mental interrupt every single time.

@oprypin I get what you are saying here. BUT, I personally think this is easier to read in the examples @asterite posted. Elixir has some similar syntax and I don't see it abused much and is generally only used for short method lines. Let's be honest too, people use short meaningless variable names with blocks already.
For example:
Benchmark.ips do |x|
  x.report("short sleep") { sleep 0.01 }
  x.report("shorter sleep") { sleep 0.001 }
end

What is x? Does anyone know or care? Probably not. I think it is very common when yielding blocks that the name is not particularly important.
With all that said, if this is not added it is fine. It is just syntactc sugar that I think has proven to be valuable in places like Elixir and is generally not abused, but I get the argument against it 👍

Also know that I first implemented this with &1, & 2, etc., so that syntax is definitely possible.
What @jhass suggests, or doing it almost like how elixir does it, by surrounding the block with &(...) might also be a better idea so that you know the replacement is a bit more scoped.

I like the idea of wrapping it so it is scoped! And I personally think &1 is easier to understand since it seems like a block related thing. _1 looks like an unused variable to me. But that could just be me :)

Elixir has some similar syntax and I don't see it abused much

OK but see the last part of my message.

people use short meaningless variable names with blocks already.

Yes but at least you see upfront how many of the variables there are (as opposed to seeming like there are none)

Yea maybe this proposal could go somewhere if it doesn't reuse the syntax for block with 0 args to mean block with any number of args.

@oprypin You mean this?

sadly Crystal would be particularly exposed to this compared to other languages due to the association with Ruby where there's just no common sense of restraint on one-liners.

Most elixir programmers came from Ruby so if anything this shows that it can work. especially if scoped with &()

I like the idea of wrapping it so it is scoped! And I personally think &1 is easier to understand since it seems like a block related thing. _1 looks like an unused variable to me. But that could just be me :)

For me, _1 also seems like an unused variable.

Most code is read many (10x) more times than it's written. Often by you. At 2am. Six months later.
For this reason, I'm a big fan of naming things even if it makes typing it a big longer.

Most code is read many (10x) more times than it's written. Often by you. At 2am. Six months later.

For this reason, I'm a big fan of naming things even if it makes typing it a bit longer

I generally agree with well named methods, argument, etc. But some cases there is no better name. Like in the try example or the benchmark example. IMO the &1 is just as easy or easier to read in those cases. Just wondering if you felt the same about those examples to or if those looked readable?
e.g.
title.value.try { slugify(&1) }

For one argument blocks add the keyword ‘it’
[1, 2, 3].each { print it }
(maybe in addition to _1 &1 $1 or #1)

Any chances on getting this merged after all? That would be a candy... @asterite?

Any chances on getting this merged after all? That would be a candy... @asterite?

authors: RX14 Sija asterite bew jhass jzakiya oprypin pannous paulcsmith rafaelfesi waj


text:
期待一个colab版本

如题

Unfortunately, colab removed support for Tensorflow 1.x, so it's impossible.

Running this code on colab is still possible! works for me

Running this code on colab is possible! works for me

Do you have an example to run it on colab? Thanks very much.

I think this is the code i used back then. Hope this helps!
-- coding: utf-8 --
"""FFHQ-UV.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1wq46NpggjpGKLbEQ6bAGZqY3Xkx_3mxa
#Git clone this repository and their script.
"""
from google.colab import drive
drive.mount('/content/gdrive')
Commented out IPython magic to ensure Python compatibility.
%cd gdrive/MyDrive
%cd FFHQ-UV
!echo $PYTHONPATH
Commented out IPython magic to ensure Python compatibility.
%env PYTHONPATH=
!echo $PYTHONPATH
! wget https://repo.anaconda.com/miniconda/Miniconda3-py39_23.1.0-1-Linux-x86_64.sh
! chmod +x Miniconda3-py39_23.1.0-1-Linux-x86_64.sh
! bash ./Miniconda3-py39_23.1.0-1-Linux-x86_64.sh -b -f -p /usr/local/
#apparently updating conda is neccessary # run as well
!conda install --channel defaults conda python=3.9 --yes
!conda update --channel defaults --all --yes
!chmod +x install_conda.sh
!conda init bash
!exec bash
conda create -n ffhq python=3.7 -y
conda activate ffhq
pip install torch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2
pip install dlib
pip install tensorboard
pip install tensorflow-gpu==1.15.0
pip install --upgrade azure-cognitiveservices-vision-face
pip install tqdm scikit-image opencv-python pillow imageio matplotlib mxnet Ninja google-auth google-auth-oauthlib click requests pyspng imageio-ffmpeg==0.4.3 scikit-learn torchdiffeq==0.0.1 flask kornia==0.2.0 lmdb psutil dominate rtree
cd thirdparty
conda install -c bottler nvidiacub
#this below needs to work OW try again
pip install -e iopath
pip install -e fvcore
pip install -e nvdiffrast
cd ..
chmod +x run_rgb_fitting_cropface630resize1024.sh
./run_rgb_fitting_cropface630resize1024.sh

repo: csbhr/FFHQ-UV


text:
[docs] Getting started instructions missing cli tool instructions

After going through the "Getting Started" section, when copying a component's code, there are often errors related to ~/lib and ~/components imports. Seems the steps on this page are missing the cli setup.
Also, earlier today there was a CLI section on the docs that seems to have disappeared, guess these parts of the docs are being actively worked on?

@aryzing
Thanks for taking your time to create this issue. I agree that the docs at this point could be a bit more precise.
How ever the step you are missing is part of the getting-started.mdx so I think we can just merge them.

Sure, seems like merging Setup + CLI into one would make sense

The Getting Started page has been revised.

authors: aryzing cschroeter

repo: cschroeter/park-ui


text:
post /bulk working or not?

i get this error. Installed the bot locally.
HTTP/1.1 400 Bad Request
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 68
ETag: W/"44-EwaRAyxpbHhvAU2bYzTUkZuZf8k"
Date: Tue, 09 Apr 2024 04:05:18 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"error":"You have too many pending requests","code":3,"status":400}

I think you should provide more information to describe this problem. How many accounts have you configured? Is there a web proxy? What is max_simultaneous_requests in the configuration file?

repo: csfloat/inspect


text:
Pretrained model correspond to which degradation space subset?

Hi and thanks for sharing your interesting research!
My question is related to the pretrained model:

the pretrained model correspond to which degradation space? S_1, S_2 or S_3?
Or does the pretrained model correspond to the training done for the parameters in the train_DASR.yml file? So all three degradation spaces with the given probability:

degree_list: ['weak_degrade_one_stage', 'standard_degrade_one_stage', 'severe_degrade_two_stage']
degree_prob: [0.3, 0.3, 0.4]

Would it be possible to share (if you have done it and if is possible) the pretrained model only for the degradation spaces separately, ie one model for weak_degrade_one_stage, one model for standard_degrade_one_stage and one model for severe_degrade_two_stage?
Thanks!

Hi, thanks for your question. The released model is trained using the train_DASR.yml file. Therefore, the degradation space covers all three degrees with the given probability. The last one is similar to the RealESRGAN, and the first and the second are mild and moderate ones, respectively. Actually, we aim to construct a wide yet balanced degradation space to mimic that in real applications. For more descriptions and analysis of the degradation space, please kindly refer to our paper.
For your second question, sure. We have conducted experiments on the 'severe_degrade_two_stage' by using our DASR, and it outperforms the baseline method to a large extent on severely degraded inputs. However, such a model is naturally restricted to those inputs, and the performance drops when facing clean inputs. The other two cases are similar. Actually, the main contribution of our method is to adaptively construct the SR model according to the degradation of inputs, which can achieve good performance with efficiency. You can validate the performance of DASR on respective subspaces. Thanks!

authors: csjliang g-moschetti

repo: csjliang/DASR


text:
If attribute value is a function returning !important it transforms to false

Hey,
Before describing the issue let me tell you a bit of a background, so it will be clear why !important is used in the first place.
We're working on embeddable widgets that can be included into our clients websites. Every client has a unique configuration where we specify various options including theming. Some websites use !important in their css and it affects our widget styles. The only way to override !important is by using another !important (I'm writing and crying now), but we don't want to put it on every attribute value by default because we will go to hell for that. So what we did is made a possibility to override certain values in theming configuration on a case-to-case basis.
For example (oversimplified case): the input in our widgets, has color: ({ theme }) => theme.color. Our default theme looks like this { color: '#f00' }.
The website we're putting our widgets on has input: { color: '#000 !important' } in their css. So they will override our amazing red color. In order to solve this we override theme in configuration to { color: '#f00 !important' }. But when stylesheets are appended instead of #f00 !important there is... false. 😐 Which is awkward.
Here is reproducible isolated case:
https://www.webpackbin.com/bins/-KrlDTFL8FtibtlIfHc4
I understand that it might be a rare and specific use-case, but maybe I'm doing something wrong or there is an explanation for such behavior. Thanks.

Its a pretty common case for embeddable widgets. I would write a plugin to auto add !important to each value.

So an actual bug is that if using function values and value has !important it renders a false. It is actually not related to react-jss nor is the story why you use important is relevant here as far as I can see.

Issue moved to cssinjs/jss #565 via ZenHub

authors: kof mistadikay

repo: cssinjs/react-jss